/*
Theme Name: Spaxmax
Template: twentytwentyfive
Description: Mobile-first child theme for spaxmax.com. Navy, black and white palette with Gantari text and Playfair Display headings.
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 8.0
Text Domain: spaxmax
License: GNU General Public License v2 or later
*/

/* Tokens from theme.json in use here:
   --wp--preset--color--base / contrast / body   page, ink (headings, dark bars), body copy
   --wp--preset--color--accent-1 surface   accent-2 surface strong   accent-3 navy   accent-4 muted text   accent-6 line   border
   --wp--preset--font-family--body (Gantari) / display (Playfair Display)
   --wp--custom--tap-target, --wp--custom--tabbar-height, --wp--custom--radius--* */

/* ---------- Base ---------- */

/* Headings in ink over body copy in #333; inside dark or coloured sections they take that section's colour. */
:root :where(h1, h2, h3, h4, h5, h6) { color: var(--wp--preset--color--contrast); }
:root :where(.has-text-color, .spx-hero, .spx-promo__slide--dark) :where(h1, h2, h3, h4, h5, h6) { color: inherit; }

/* iOS zooms the page into any field with text under 16px. */
:where(input, select, textarea) { font-size: max(16px, 1em); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 2px;
}
.wp-element-button, .wp-block-button__link { min-height: 48px; }

/* ---------- Header ---------- */

/* --spx-head-stick (set by header.js on phones) is the height above the search field that may scroll away. */
header.wp-block-template-part:has(.spx-header) {
  position: sticky;
  top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--spx-head-stick, 0px));
  z-index: 40;
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid var(--wp--preset--color--accent-6);
  transition: transform 0.2s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
header.wp-block-template-part.is-hidden { transform: translateY(-100%); }

/* While the cart drawer is open, lift the header (which holds it) above the bottom bars. */
header.wp-block-template-part:has(.wc-block-components-drawer__screen-overlay:not(.wc-block-components-drawer__screen-overlay--is-hidden)) { z-index: 60; }

/* Phone (Lenskart's arrangement): account, wordmark, cart and menu on one row; full-width search under it. */
.spx-header__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "account logo cart nav" "search search search search";
  align-items: center;
  gap: 0.5rem 0;
  padding-block: 0.375rem 0.75rem;
}
.spx-header__row > * { margin: 0 !important; }
.spx-header__row > .wp-block-site-title { grid-area: logo; padding-left: 0.25rem; }
.spx-header__row > .spx-nav { grid-area: nav; }
.spx-header__row > .wp-block-search { grid-area: search; }
.spx-header__row > .wp-block-woocommerce-customer-account { grid-area: account; }
.spx-header__row > .wp-block-woocommerce-mini-cart { grid-area: cart; }

.spx-header .wc-block-customer-account a,
.spx-header .wc-block-mini-cart__button,
.spx-nav__toggle {
  display: grid; place-items: center;
  min-width: var(--wp--custom--tap-target); min-height: var(--wp--custom--tap-target); padding: 0;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.spx-header .wc-block-mini-cart__icon, .spx-header .wc-block-customer-account__account-icon { width: 24px; height: 24px; }
.spx-nav__toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.spx-nav__links { display: none; margin: 0; padding: 0; list-style: none; }
.spx-mega-scrim, .spx-mega[hidden], .spx-mega__cards[hidden] { display: none; }
/* Announcement strip above the header: a 43px navy bar, as Lenskart's app banner. */
.spx-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 2.6875rem;
  padding: 0.375rem max(var(--wp--style--root--padding-right, 1rem), env(safe-area-inset-right, 0px)) 0.375rem max(var(--wp--style--root--padding-left, 1rem), env(safe-area-inset-left, 0px));
  background: var(--wp--preset--color--accent-3); color: var(--wp--preset--color--base);
}
.spx-strip__text { margin: 0; font-size: 0.9375rem; font-weight: 500; line-height: 1.25; }
/* 30px pill; the ::before stretches its tap area to the full 44px. */
.spx-strip__cta {
  position: relative; flex: none; display: inline-flex; align-items: center; min-height: 1.875rem; padding: 0 0.875rem;
  border-radius: 8px; background: var(--wp--preset--color--base); color: var(--wp--preset--color--accent-3);
  font-size: 0.875rem; font-weight: 700; text-decoration: none;
}
.spx-strip__cta::before { content: ""; position: absolute; inset: calc((1.875rem - var(--wp--custom--tap-target)) / 2) 0; }

.spx-tabbar__item[aria-current="page"]::before {
  content: ""; position: absolute; inset: 0 18% auto; height: 3px; border-radius: 0 0 3px 3px; background: currentColor;
}

.spx-header__search .wp-block-search__inside-wrapper {
  min-height: var(--wp--custom--tap-target);
  padding: 0 0.25rem 0 1rem;
  border: 1px solid var(--wp--preset--color--accent-6);
  border-radius: var(--wp--custom--radius--pill);
  background: var(--wp--preset--color--accent-1);
}
.spx-header__search .wp-block-search__input { border: 0; padding: 0; background: transparent; }
.spx-header__search .wp-block-search__input::placeholder { color: var(--wp--preset--color--accent-4); opacity: 1; }
.spx-header__search .wp-block-search__button {
  min-height: 0; min-width: var(--wp--custom--tap-target); margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--wp--preset--color--contrast);
}

/* Phones and tablets (Lenskart's 122px black header): avatar and wordmark left, cart and menu right,
   then a 46px light search field with a navy icon on the left. After the base search rules so it overrides them. */
@media (max-width: 781.98px) {
  header.wp-block-template-part:has(.spx-header) {
    background: var(--wp--preset--color--contrast);
    border-bottom-color: color-mix(in srgb, var(--wp--preset--color--base) 18%, var(--wp--preset--color--contrast));
  }
  .spx-header, .spx-header .wp-block-site-title a, .spx-header .wc-block-customer-account a,
  .spx-header .wc-block-mini-cart__button, .spx-nav__toggle { color: var(--wp--preset--color--base); }
  .spx-header__row { gap: 1rem 0; padding-block: 0.375rem 0.625rem; }
  .spx-header__row > .wp-block-site-title { padding-left: 0.5rem; font-size: 1.375rem; }
  /* Account as a 32px light avatar; its edge sits on the page margin. */
  .spx-header .wc-block-customer-account a { margin-left: -0.375rem; }
  .spx-header .wc-block-customer-account__account-icon {
    width: 2rem; height: 2rem; padding: 0.3125rem; border-radius: 50%;
    background: var(--wp--preset--color--border); color: var(--wp--preset--color--accent-3);
  }
  .spx-nav__toggle { margin-right: -0.625rem; }
  .spx-header__search .wp-block-search__inside-wrapper {
    min-height: 2.875rem; padding: 0 1rem 0 0.25rem; border: 0; border-radius: 10px; background: var(--wp--preset--color--accent-2);
  }
  .spx-header__search .wp-block-search__button { order: -1; color: var(--wp--preset--color--accent-3); }
  .spx-header__search .wp-block-search__button svg { transform: scaleX(-1); } /* handle to the lower right */
  .spx-header__search .wp-block-search__input { color: var(--wp--preset--color--contrast); }
  .spx-header__search .wp-block-search__input::placeholder { color: color-mix(in srgb, var(--wp--preset--color--accent-4) 82%, var(--wp--preset--color--base)); }
  /* Scrolled: only the search row shows, as Lenskart's white bar with a bordered white field and a soft shadow. */
  header.wp-block-template-part.is-compact:has(.spx-header) {
    background: var(--wp--preset--color--base); border-bottom-color: transparent; box-shadow: 0 6px 12px -8px rgb(0 0 0 / 0.18);
  }
  header.is-compact .spx-header__search .wp-block-search__inside-wrapper {
    background: var(--wp--preset--color--base); box-shadow: inset 0 0 0 1px var(--wp--preset--color--border);
  }
}

/* Desktop (Lenskart proportions): a 76px bar with wordmark, category links, compact search, account, cart. */
@media (min-width: 782px) {
  .spx-header__row {
    grid-template-columns: auto 1fr minmax(12rem, 16rem) auto auto;
    grid-template-areas: "logo nav search account cart";
    column-gap: 0.75rem;
    min-height: 76px;
    padding-block: 0;
  }
  .spx-header__row > .wp-block-site-title { padding: 0 2rem 0 0; }
  .spx-header__search .wp-block-search__inside-wrapper { min-height: 40px; }
  .spx-nav__toggle { display: none; }
  .spx-nav__links { display: flex; gap: 2rem; }
  .spx-nav__item { display: flex; }
  .spx-nav__link {
    position: relative; display: flex; align-items: center; min-height: 76px; padding: 0;
    border: 0; background: none; color: inherit; cursor: pointer;
    font: inherit; font-size: 1rem; font-weight: 400; letter-spacing: -0.01em; text-decoration: none;
  }
  .spx-nav__link::after {
    content: ""; position: absolute; inset: auto 0 1.4rem; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
  }
  .spx-nav__link:hover::after, .spx-nav__link[aria-expanded="true"]::after { transform: scaleX(1); }

  /* Open mega menu: dark scrim over the page, header turns dark with white links. */
  .spx-mega-open .spx-mega-scrim {
    display: block; position: fixed; inset: 0; z-index: -1;
    background: color-mix(in srgb, var(--wp--preset--color--contrast) 82%, transparent);
  }
  .spx-mega-open header.wp-block-template-part:has(.spx-header) {
    background: transparent; color: var(--wp--preset--color--base);
    border-bottom-color: color-mix(in srgb, var(--wp--preset--color--base) 15%, transparent);
  }
  .spx-mega-open .spx-header a, .spx-mega-open .spx-header .wc-block-mini-cart__button { color: var(--wp--preset--color--base); }
  .spx-mega-open .spx-header__search .wp-block-search__inside-wrapper {
    background: color-mix(in srgb, var(--wp--preset--color--base) 10%, transparent);
    border-color: color-mix(in srgb, var(--wp--preset--color--base) 25%, transparent);
  }
  .spx-mega-open .spx-header__search .wp-block-search__input,
  .spx-mega-open .spx-header__search .wp-block-search__button { color: var(--wp--preset--color--base); }
  .spx-mega-open .spx-header__search .wp-block-search__input::placeholder { color: color-mix(in srgb, var(--wp--preset--color--base) 65%, transparent); }

  .spx-mega {
    position: absolute; inset: 100% 0 auto;
    max-height: calc(100vh - 76px); overflow-y: auto;
    padding-block: 2.5rem 3rem;
    color: var(--wp--preset--color--base);
  }
  .spx-mega__inner {
    display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 3.5rem;
    width: min(var(--wp--style--global--wide-size, 1340px), 100% - 2 * var(--wp--style--root--padding-left, 2rem));
    margin-inline: auto;
  }
  .spx-mega__tabs { display: grid; align-content: start; }
  .spx-mega__tab {
    padding: 0.875rem 0; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 18%, transparent);
    background: none; color: color-mix(in srgb, var(--wp--preset--color--base) 55%, transparent); cursor: pointer; text-align: left;
    font-family: var(--wp--preset--font-family--display); font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2;
  }
  .spx-mega__tab[aria-selected="true"] { border-bottom-color: var(--wp--preset--color--base); color: var(--wp--preset--color--base); }
  .spx-mega__body { display: grid; align-content: start; gap: 1.75rem; }
  .spx-mega__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem; }
  .spx-mega__card {
    display: grid; justify-items: center; align-content: center; gap: 0.875rem; min-height: 9rem; padding: 1.25rem 1rem;
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 18%, transparent); border-radius: var(--wp--custom--radius--card);
    background: color-mix(in srgb, var(--wp--preset--color--base) 6%, transparent); color: var(--wp--preset--color--base);
    font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
  .spx-mega__card:hover, .spx-mega__card:focus-visible {
    background: color-mix(in srgb, var(--wp--preset--color--base) 14%, transparent);
    border-color: color-mix(in srgb, var(--wp--preset--color--base) 45%, transparent);
  }
  .spx-mega__card .spx-frame { width: 72%; max-width: 8rem; }
  .spx-mega__card--text span {
    font-family: var(--wp--preset--font-family--display); font-size: 1.375rem; font-weight: 500;
    letter-spacing: -0.01em; text-transform: none; text-align: center;
  }
  .spx-mega__all {
    justify-self: start; color: var(--wp--preset--color--base);
    font-size: var(--wp--preset--font-size--small); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-underline-offset: 4px;
  }
}

/* Narrow desktops and landscape tablets: tighter links so the cart stays on screen. */
@media (min-width: 782px) and (max-width: 1023.98px) {
  .spx-header__row > .wp-block-site-title { padding-right: 1rem; }
  .spx-nav__links { gap: 1.25rem; }
}

/* Phone and tablet menu: full-height drawer from the left. */
.spx-menu {
  width: min(420px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  margin: 0 auto 0 0; padding: 0; border: 0;
  background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast);
}
.spx-menu[open] { display: flex; flex-direction: column; }
.spx-menu::backdrop { background: rgb(0 0 0 / 0.45); }
@media (prefers-reduced-motion: no-preference) {
  .spx-menu[open] { animation: spx-menu-in 0.2s ease-out; }
  @keyframes spx-menu-in { from { transform: translateX(-100%); } }
}
.spx-menu__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(0.375rem + env(safe-area-inset-top, 0px)) 0.375rem 0.375rem 1rem;
  border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.spx-menu__brand { color: inherit; font-family: var(--wp--preset--font-family--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.spx-menu__close {
  width: var(--wp--custom--tap-target); height: var(--wp--custom--tap-target);
  border: 0; background: none; color: inherit; font-size: 1.75rem; line-height: 1; cursor: pointer;
}
.spx-menu__body { flex: 1; overflow-y: auto; padding: 0.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.spx-menu__cat { border-bottom: 1px solid var(--wp--preset--color--accent-6); }
.spx-menu__cat summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; cursor: pointer; list-style: none;
  font-family: var(--wp--preset--font-family--display); font-size: 1.375rem; font-weight: 500; letter-spacing: -0.01em;
}
.spx-menu__cat summary::-webkit-details-marker { display: none; }
.spx-menu__cat summary::after {
  content: ""; width: 0.55rem; height: 0.55rem; margin-right: 0.375rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.2s ease;
}
.spx-menu__cat[open] summary::after { transform: rotate(-135deg); }
.spx-menu__inner { display: grid; gap: 0.5rem; padding-bottom: 1.25rem; }
.spx-menu__group { margin: 0.5rem 0 0; color: var(--wp--preset--color--accent-4); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.spx-menu__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spx-menu__all { margin-top: 0.5rem; color: inherit; font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.spx-menu__link {
  display: flex; align-items: center; min-height: 3.5rem; border-bottom: 1px solid var(--wp--preset--color--accent-6);
  color: inherit; font-weight: 600; text-decoration: none;
}
@media (min-width: 782px) {
  .spx-menu { display: none; }
}

/* ---------- Bottom tab bar (phones) ---------- */

.spx-tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--wp--preset--color--base);
  border-top: 1px solid var(--wp--preset--color--accent-6);
}
.spx-tabbar__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--wp--custom--tabbar-height);
  color: var(--wp--preset--color--accent-4);
  text-decoration: none;
}
.spx-tabbar svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* 12px is the one exception to the 13px minimum: the platform convention for tab labels. */
.spx-tabbar__label { font-size: 0.75rem; font-weight: 500; line-height: 1.2; }
.spx-tabbar__item[aria-current="page"] { color: var(--wp--preset--color--contrast); }
.spx-tabbar__item[aria-current="page"] .spx-tabbar__label { font-weight: 700; }
.spx-tabbar__item[aria-current="page"] svg { stroke-width: 2; }

@media (max-width: 781.98px) {
  body:has(.spx-tabbar) { padding-bottom: calc(var(--wp--custom--tabbar-height) + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 782px) {
  .spx-tabbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  header.wp-block-template-part:has(.spx-header) { transition: none; }
}

/* ---------- Frame drawings, shape/category tiles and chips ---------- */

.spx-frame { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.spx-frame--dark g > * { fill: currentColor; fill-opacity: 0.85; }
.spx-frame--tint g > * { fill: color-mix(in srgb, var(--wp--preset--color--accent-3) 16%, transparent); }

.spx-frame-links { display: grid; gap: 0.75rem; }
/* Rows that scroll sideways on phones bleed to the screen edge so the next item peeks in. */
.spx-frame-links--shapes {
  grid-auto-flow: column;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin-inline: calc(-1 * var(--wp--style--root--padding-left, 1rem));
  padding-inline: var(--wp--style--root--padding-left, 1rem);
  scroll-padding-inline: var(--wp--style--root--padding-left, 1rem);
}
.spx-frame-links--shapes::-webkit-scrollbar { display: none; }
.spx-frame-links--tiles.spx-frame-links--shapes { grid-auto-columns: 5.25rem; gap: 1.25rem; }
.spx-frame-links--categories { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }

/* Shape tiles (home): drawn like the category rows' photo tiles, an 84px grey square with the label under it,
   20px apart, so 3.6 fit on a 390px phone and the next one peeks in. */
.spx-frame-tile {
  display: grid; justify-items: center; gap: 0.125rem;
  color: var(--wp--preset--color--contrast); text-decoration: none;
  scroll-snap-align: start;
}
.spx-frame-tile__art {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0 10%;
  border-radius: 0.75rem; background: #F7F7F7;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent);
}
.spx-frame-tile__label { color: #66657F; font-size: 0.8125rem; font-weight: 500; text-align: center; }
.spx-frame-tile:hover .spx-frame-tile__label { color: var(--wp--preset--color--accent-3); }
.spx-frame-tile:focus-visible { outline: none; }
.spx-frame-tile:focus-visible .spx-frame-tile__art { outline: 2px solid var(--wp--preset--color--accent-3); outline-offset: 2px; }

.spx-frame-links--chips { grid-auto-columns: max-content; gap: 0.5rem; }
.spx-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: var(--wp--custom--tap-target);
  padding: 0 1rem 0 0.75rem;
  border: 1px solid var(--wp--preset--color--accent-6);
  border-radius: var(--wp--custom--radius--pill);
  color: var(--wp--preset--color--contrast);
  font-size: var(--wp--preset--font-size--small); font-weight: 500;
  text-decoration: none; white-space: nowrap;
  scroll-snap-align: start;
}
.spx-chip__art { width: 2.25rem; }
.spx-chip[aria-current] { border-color: transparent; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

@media (min-width: 782px) {
  .spx-frame-links--tiles.spx-frame-links--shapes {
    grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 7.5rem); gap: 1.25rem;
    overflow: visible; margin-inline: 0; padding-inline: 0;
  }
  .spx-frame-tile__label { font-size: 1rem; }
}

/* ---------- Product cards ---------- */

.wp-block-woocommerce-product-collection .spx-cards.wc-block-product-template {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 0.75rem;
}
@media (min-width: 600px) { .wp-block-woocommerce-product-collection .spx-cards.wc-block-product-template { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .wp-block-woocommerce-product-collection .spx-cards.wc-block-product-template { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.25rem; } }

.wc-block-product-template > .wc-block-product { position: relative; display: grid; align-content: start; gap: 0.375rem; margin: 0; }
.wc-block-product .wc-block-components-product-image {
  margin: 0 0 0.25rem; overflow: hidden;
  border-radius: var(--wp--custom--radius--card); background: var(--wp--preset--color--accent-1);
}
.wc-block-product .wc-block-components-product-image img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.wc-block-product .spx-card__title {
  margin: 0; text-align: left;
  font-family: var(--wp--preset--font-family--body); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; line-height: 1.3;
}
.wc-block-product .spx-card__title a { color: inherit; text-decoration: none; }
/* The whole card is the tap target. */
.wc-block-product .spx-card__title a::after { content: ""; position: absolute; inset: 0; }
.spx-card__meta { margin: 0; color: var(--wp--preset--color--accent-4); font-size: 0.8125rem; }
.spx-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.5rem; }
.spx-card__price .wp-block-woocommerce-product-price { margin: 0; text-align: left; font-size: 1rem; font-weight: 700; }
/* Sale price first, struck MRP after it. */
.spx-card__price .wc-block-components-product-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem; }
.spx-card__price ins { order: -1; text-decoration: none; }
.spx-card__price del { color: var(--wp--preset--color--accent-4); font-size: 0.8125rem; font-weight: 400; }
.spx-card__off { color: var(--wp--preset--color--success); font-size: 0.8125rem; font-weight: 600; }

/* Home bestsellers: swipeable row on phones, four columns on desktop. */
.wp-block-woocommerce-product-collection .spx-rail.wc-block-product-template {
  display: grid; grid-auto-flow: column; grid-auto-columns: 42%; grid-template-columns: none; gap: 0.75rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-block: 0; margin-inline: calc(-1 * var(--wp--style--root--padding-left, 1rem));
  padding-inline: var(--wp--style--root--padding-left, 1rem);
  scroll-padding-inline: var(--wp--style--root--padding-left, 1rem);
}
.spx-rail::-webkit-scrollbar { display: none; }
.spx-rail > .wc-block-product { gap: 0.25rem; scroll-snap-align: start; }
.spx-rail .wc-block-components-product-image { margin-bottom: 0.25rem; border-radius: 0.75rem; background: #F7F7F7; }
.spx-rail .spx-card__title {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--wp--preset--color--contrast); font-size: 0.8125rem; font-weight: 600; line-height: 1.3;
}
.spx-rail .spx-card__meta { color: #66657F; font-size: 0.75rem; }
.spx-rail .spx-card__price { gap: 0.125rem 0.375rem; white-space: nowrap; } /* one line from 360px; wraps on smaller phones */
.spx-rail .spx-card__price .wp-block-woocommerce-product-price { color: var(--wp--preset--color--accent-3); font-size: 0.875rem; }
.spx-rail .spx-card__price del, .spx-rail .spx-card__off { font-size: 0.75rem; }
@media (min-width: 782px) {
  .wp-block-woocommerce-product-collection .spx-rail.wc-block-product-template {
    grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.25rem;
    overflow: visible; margin-inline: 0; padding-inline: 0;
  }
}

/* ---------- Product listing ---------- */

.spx-plp__head { display: grid; gap: 0.25rem; padding-top: 0.75rem; }
.spx-plp .woocommerce-breadcrumb, .spx-plp .wp-block-woocommerce-breadcrumbs { margin: 0; color: var(--wp--preset--color--accent-4); font-size: 0.8125rem; }
.spx-plp .wp-block-woocommerce-breadcrumbs a { color: inherit; }
.spx-plp .wp-block-query-title { margin: 0; font-size: var(--wp--preset--font-size--x-large); }
.spx-collection { display: grid; gap: 1rem; margin-top: 0.75rem; }
.spx-collection > .wp-block-woocommerce-product-results-count,
.spx-collection .woocommerce-result-count { margin: 0; color: var(--wp--preset--color--accent-4); font-size: var(--wp--preset--font-size--small); }

.spx-controls__label { margin: 0; color: var(--wp--preset--color--accent-4); font-size: 0.75rem; }
.spx-controls .woocommerce-ordering { margin: 0; }
/* 16px stops iOS zooming in when the picker opens; selector outranks WooCommerce's own select styles. */
.spx-controls .woocommerce-ordering select.orderby { font-size: 16px; font-weight: 600; }

.wc-block-product-filters h3 {
  margin: 0 0 0.625rem;
  font-family: var(--wp--preset--font-family--body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.wc-block-product-filters .wp-block-woocommerce-product-filter-attribute,
.wc-block-product-filters .wp-block-woocommerce-product-filter-price { margin-block: 0 1.5rem; }
/* Filter chips: same pill as the shape chips, full tap-target height. */
.wc-block-product-filters .wc-block-product-filter-chips__item {
  min-height: var(--wp--custom--tap-target); padding: 0 1rem;
  border: 1px solid var(--wp--preset--color--accent-6); border-radius: var(--wp--custom--radius--pill);
  font-size: var(--wp--preset--font-size--small);
}
.wc-block-product-filters .wc-block-product-filter-chips__item[aria-checked="true"] {
  border-color: transparent; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base);
}

/* "Load more": the pagination's next link, styled as a button; listing.js appends instead of navigating. */
.spx-pagination { margin-top: 1rem; }
.spx-pagination .wp-block-query-pagination-previous { display: none; }
.spx-pagination .wp-block-query-pagination-next {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 2rem;
  border: 1px solid var(--wp--preset--color--contrast); border-radius: var(--wp--custom--radius--button);
  color: var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--small); font-weight: 600;
  letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase;
}
.spx-pagination .wp-block-query-pagination-next[aria-busy] { opacity: 0.5; }

@media (max-width: 781.98px) {
  /* Phones: Sort | Filter bar fixed to the bottom, in place of the tab bar. */
  .spx-controls {
    position: fixed; inset: auto 0 0; z-index: 45;
    display: grid; grid-template-columns: 1fr 1fr;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--wp--preset--color--base); border-top: 1px solid var(--wp--preset--color--accent-6);
  }
  .spx-controls > * { position: relative; margin: 0 !important; min-height: var(--wp--custom--tabbar-height); }
  .spx-controls > * + * { border-left: 1px solid var(--wp--preset--color--accent-6); }
  /* The whole Sort cell is the native select, so the phone's own picker opens; the label sits on top. */
  .spx-controls__label { position: absolute; top: 0.5rem; inset-inline: 0; text-align: center; pointer-events: none; }
  .spx-controls__sort, .spx-controls__sort .woocommerce-ordering { display: grid; }
  .spx-controls__sort select {
    width: 100%; min-height: var(--wp--custom--tabbar-height); font-size: 16px;
    appearance: none; padding: 1.25rem 0.5rem 0.375rem; border: 0; border-radius: 0;
    background: transparent; color: var(--wp--preset--color--contrast); text-align: center; text-align-last: center;
  }
  .spx-controls .wc-block-product-filters { display: grid; height: 100%; }
  .spx-controls .wc-block-product-filters__open-overlay {
    width: 100%; height: 100%; justify-content: center; gap: 0.5rem; border: 0; border-radius: 0;
    background: transparent; color: var(--wp--preset--color--contrast); font-weight: 600;
  }
  body:has(.spx-controls) { padding-bottom: calc(var(--wp--custom--tabbar-height) + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 782px) {
  /* Desktop: filters become a sticky left column. Named areas, because WooCommerce may insert a notices
     element; the last row is 1fr so the tall sidebar's height lands there instead of pushing the cards down. */
  .spx-collection {
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto 1fr;
    grid-template-areas: "chips chips" "controls notices" "controls count" "controls cards" "controls pager" "controls empty";
    gap: 0 2.5rem;
  }
  .spx-collection > .wc-block-components-notices { grid-area: notices; }
  .spx-collection > .spx-frame-links { grid-area: chips; margin-bottom: 1.5rem; }
  .spx-collection > .wp-block-woocommerce-product-results-count { grid-area: count; margin-bottom: 1rem; }
  .spx-collection > .wc-block-product-template { grid-area: cards; }
  .spx-collection > .wp-block-query-pagination { grid-area: pager; }
  .spx-collection > .wp-block-woocommerce-product-collection-no-results { grid-area: empty; }
  .spx-collection > .spx-controls {
    grid-area: controls; align-self: start;
    position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 6rem);
    display: grid; gap: 1.5rem;
  }
  .spx-controls__label { margin-bottom: 0.25rem; }
  .spx-controls .woocommerce-ordering select { width: 100%; min-height: var(--wp--custom--tap-target); font-size: 16px; }
}

/* ---------- Home ---------- */

/* The hero sits right under the header: WordPress otherwise puts its 16px block gap between the page's top-level parts. */
.wp-site-blocks > .spx-home { margin-block-start: 0; }
.spx-home > * + * { margin-block-start: var(--wp--preset--spacing--60); }
.spx-home > .spx-hero { margin-block-start: 0; }
.spx-home > .spx-promo { margin-block-start: 0.875rem; }

/* Hero (Lenskart's phone hero): a 2:1 photo, small pill, two-line message (regular, then bold) and a white
   button on the left, and a shallow curve along the bottom (8px deep on phones). */
.spx-hero {
  position: relative; isolation: isolate; display: grid; overflow: hidden;
  min-height: max(12rem, 50vw); /* 2:1 (the hero is full width), but never too short for the copy on small phones */
  background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base);
  border-radius: 0 0 50% 50% / 0 0 0.5rem 0.5rem;
}
.spx-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 100% 30%; }
.spx-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--wp--preset--color--contrast) 55%, transparent) 0%,
    color-mix(in srgb, var(--wp--preset--color--contrast) 20%, transparent) 50%,
    transparent 70%);
}
/* margin-block: 0 overrides the flow layout's block gap, which would push the copy down. */
.spx-hero > .spx-hero__content {
  align-self: center; display: grid; justify-items: start; gap: 0.75rem;
  width: min(var(--wp--style--global--wide-size, 1340px), 100%); margin: 0 auto;
  padding: 2rem var(--wp--style--root--padding-right, 1rem) 1.25rem var(--wp--style--root--padding-left, 1rem);
}
.spx-hero__content > * { margin: 0; }
.spx-hero__pill {
  padding: 0.1875rem 0.75rem; border-radius: var(--wp--custom--radius--pill);
  background: color-mix(in srgb, var(--wp--preset--color--base) 20%, transparent);
  color: color-mix(in srgb, var(--wp--preset--color--base) 90%, transparent);
  font-size: 0.8125rem; line-height: 1.3;
}
.spx-hero__pill strong { color: var(--wp--preset--color--base); font-weight: 700; }
.spx-hero__title {
  max-width: 16ch; color: inherit;
  font-family: var(--wp--preset--font-family--body); font-size: clamp(1.1875rem, 4.8vw, 2.75rem);
  font-weight: 400; letter-spacing: -0.01em; line-height: 1.35;
}
.spx-hero__title strong { font-weight: 700; }
.spx-hero .wp-block-buttons { margin-top: 0.125rem; }
.spx-hero__cta .wp-block-button__link {
  min-height: 2.5rem; padding: 0 1.25rem; border-radius: 8px; align-content: center;
  background: var(--wp--preset--color--base); color: var(--wp--preset--color--accent-3);
  font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.spx-hero__cta .wp-block-button__link:hover { background: color-mix(in srgb, var(--wp--preset--color--base) 88%, var(--wp--preset--color--accent-3)); }
@media (min-width: 782px) {
  .spx-hero { min-height: clamp(26rem, 40vw, 36rem); border-radius: 0 0 50% 50% / 0 0 1.5rem 1.5rem; }
  .spx-hero > .spx-hero__content { gap: 1.25rem; padding-block: 3rem 3.5rem; }
  .spx-hero__pill { padding: 0.375rem 1rem; font-size: 0.9375rem; }
  .spx-hero__cta .wp-block-button__link { min-height: 3.25rem; padding: 0 2rem; font-size: 1.0625rem; }
}

/* Promo banners (Lenskart's outlined 4:1 cards): serif title with an italic second line, a boxed tag under it,
   a small round arrow and the position marker inside the card. Swipe on phones, side by side on desktop. */
/* minmax(0, 1fr): the cards' aspect ratio would otherwise widen the column to fit both side by side. */
.spx-promo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.spx-promo__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 0.75rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.spx-promo__track::-webkit-scrollbar { display: none; }
/* The track is a flow group: without this WordPress's block gap pushes every card after the first 16px down. */
.spx-promo__track > .spx-promo__slide { margin: 0; }
.spx-promo__slide {
  position: relative; isolation: isolate; display: grid; align-content: center; justify-items: start; gap: 0.3125rem;
  aspect-ratio: 4 / 1; min-height: 5.5rem; padding: 0.5rem 3rem 0.5rem 1rem; overflow: hidden;
  justify-self: stretch; /* grid items with a ratio otherwise size from it (88px min-height → 352px wide) */
  border: 2px solid var(--wp--preset--color--contrast); border-radius: 0.875rem;
  color: var(--wp--preset--color--contrast); scroll-snap-align: start;
}
.spx-promo__slide > * { margin: 0; }
.spx-promo__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 75% 30%; }
.spx-promo__slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent) 0%,
    color-mix(in srgb, var(--wp--preset--color--base) 55%, transparent) 42%,
    transparent 65%);
}
.spx-promo__slide--dark { color: var(--wp--preset--color--base); }
.spx-promo__slide--dark::before {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--wp--preset--color--contrast) 72%, transparent) 0%,
    color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent) 42%,
    transparent 65%);
}
.spx-promo__title {
  max-width: 12ch; color: inherit;
  font-family: var(--wp--preset--font-family--display); font-size: clamp(1.375rem, 6.2vw, 2.5rem);
  font-weight: 500; letter-spacing: -0.03em; line-height: 0.95;
}
.spx-promo__title em { display: block; font-style: italic; font-weight: 400; }
.spx-promo__tag {
  padding: 0.125rem 0.5rem;
  background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent); color: var(--wp--preset--color--contrast);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; line-height: 1.4; text-transform: uppercase;
}
.spx-promo__slide:not(.spx-promo__slide--dark) .spx-promo__tag { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
/* The link's text stays for screen readers; visually it is the round arrow, and the whole card is its tap area.
   Its paragraph covers the card (out of the grid flow), so the arrow and tap area are placed against the card. */
.spx-promo__link { position: absolute; inset: 0; }
.spx-promo__link a { font-size: 0; color: transparent; }
.spx-promo__link a::before {
  content: ""; position: absolute; right: 0.625rem; bottom: 0.625rem; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--wp--preset--color--contrast) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 1rem no-repeat;
}
.spx-promo__link a::after { content: ""; position: absolute; inset: 0; }
.spx-promo__slide:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--contrast); outline-offset: 3px; }
/* Position marker: a short white track with the current banner in navy, inside the card's bottom edge. */
.spx-promo__dots { position: absolute; left: 50%; bottom: 0.125rem; display: flex; transform: translateX(-50%); }
.spx-promo__dots button { position: relative; width: 1.75rem; height: 1rem; padding: 0; border: 0; background: none; cursor: pointer; }
.spx-promo__dots button::before {
  content: ""; position: absolute; inset: 50% 0 auto; height: 2px; transform: translateY(-50%);
  background: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
}
.spx-promo__dots button[aria-current="true"]::before { background: var(--wp--preset--color--accent-3); }
@media (min-width: 782px) {
  .spx-promo__track { grid-auto-columns: calc(50% - 0.375rem); overflow: visible; }
  .spx-promo__slide { aspect-ratio: auto; min-height: clamp(9.5rem, 15vw, 13rem); gap: 0.75rem; padding: 1.5rem 5rem 1.5rem 2rem; border-radius: 1.25rem; }
  .spx-promo__title { font-size: clamp(1.75rem, 2.8vw, 2.5rem); }
  .spx-promo__tag { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
  .spx-promo__link a::before { right: 1.25rem; bottom: 1.25rem; width: 2.75rem; height: 2.75rem; background-size: 1.25rem; }
  .spx-promo__dots { display: none; }
}

/* Category rows (Lenskart's phone "Eyeglasses / Sunglasses"), measured at 390px: 20px bold navy name with a lavender
   chip, then four 80.5 x 87.5 photo tiles 12px apart, a 14px label under each, and the sale tile's "Starts @" badge.
   Margins put the heading's cap 33px under the promo cards and 50px under the previous row's labels. */
.spx-home > .spx-cat { margin-block-start: 1.6875rem; }
.spx-home > .spx-cat + .spx-cat { margin-block-start: 1.9375rem; }
/* After the festive band: the heading's cap 27px under the band's lower edge. */
.spx-home > .spx-edit + .spx-cat { margin-block-start: 1.375rem; }
.spx-cat__head { display: flex; align-items: center; gap: 0.625rem; }
.spx-cat__title {
  margin: 0; color: var(--wp--preset--color--accent-3);
  font-family: var(--wp--preset--font-family--body); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
}
.spx-cat__title a { color: inherit; text-decoration: none; }
.spx-cat__chip {
  display: inline-flex; align-items: center; height: 1.125rem; padding: 0 0.5rem; border-radius: var(--wp--custom--radius--pill);
  background: #F3F1FD; color: var(--wp--preset--color--accent-3);
  font-size: 0.6875rem; font-weight: 600; line-height: 1;
}
.spx-cat__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 0.4375rem 0 0; padding: 0; list-style: none; }
.spx-cat__tile { display: grid; gap: 0.125rem; justify-items: center; color: inherit; text-decoration: none; }
.spx-cat__img {
  position: relative; display: block; width: 100%; aspect-ratio: 23 / 25; overflow: hidden;
  border-radius: 0.75rem; background: #F7F7F7;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent);
}
.spx-cat__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.spx-cat__img--art { display: grid; place-items: center; padding: 0 12%; color: var(--wp--preset--color--contrast); }
.spx-cat__badge {
  position: absolute; top: 0; left: 50%; z-index: 1; transform: translateX(-50%);
  padding: 0 0.375rem; border-radius: var(--wp--custom--radius--pill);
  background: var(--wp--preset--color--accent-4); color: var(--wp--preset--color--base);
  font-size: 0.625rem; font-style: italic; font-weight: 700; letter-spacing: -0.01em; line-height: 0.875rem; white-space: nowrap;
}
.spx-cat__label { color: #66657F; font-size: 0.8125rem; font-weight: 500; } /* Lenskart's label grey, 5.6:1 on white */
.spx-cat__tile:hover .spx-cat__label { color: var(--wp--preset--color--accent-3); }
.spx-cat__tile:focus-visible { outline: none; }
.spx-cat__tile:focus-visible .spx-cat__img { outline: 2px solid var(--wp--preset--color--accent-3); outline-offset: 2px; }
@media (min-width: 782px) {
  .spx-home > .spx-cat { margin-block-start: var(--wp--preset--spacing--60); }
  .spx-cat__title { font-size: 1.5rem; }
  .spx-cat__tiles { grid-template-columns: repeat(4, 9.5rem); gap: 1.25rem; margin-top: 1rem; }
  .spx-cat__label { font-size: 1rem; }
}

/* Festive edit (Lenskart's black "celebration" band), measured at 390px: a black section whose top and bottom
   edges are shallow arcs (12.4px deep), a 30px two-line serif title (roman, then italic) between gold flourishes,
   a small italic line, and half-screen-wide 3:4 photo cards with gold borders that scroll sideways.
   The arcs are a mask, so whatever is behind the section shows through them. */
.spx-home > .spx-edit { margin-block-start: 1.125rem; }
.spx-edit {
  --spx-sag: clamp(0.75rem, 3.2vw, 2.5rem);
  --spx-edit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 0Q50 20 100 0V10H0z'/%3E%3C/svg%3E") top / 100% var(--spx-sag) no-repeat,
    linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--spx-sag) + 2px) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 10Q50 -10 100 10V0H0z'/%3E%3C/svg%3E") bottom / 100% var(--spx-sag) no-repeat;
  position: relative; isolation: isolate; overflow: hidden;
  padding: 3.25rem 0 2.8125rem;
  background: #000; /* Lenskart's band is pure black, a shade darker than ink */
  color: color-mix(in srgb, var(--wp--preset--color--base) 85%, var(--wp--preset--color--gold));
  -webkit-mask: var(--spx-edit-mask);
  mask: var(--spx-edit-mask);
}
.spx-home .spx-edit > * { margin: 0; } /* (0,2,0): beats the flow layout's block gap */
/* Drawn for a 390px-wide screen and kept at that size, centred on the title; the ends fade out, so on wider
   screens they stop short of the edges unnoticed, and on narrower ones they run off. */
.spx-edit__flourish {
  position: absolute; top: 0; left: 50%; z-index: -1; width: 390px; height: 110px; transform: translateX(-50%);
  color: var(--wp--preset--color--gold); pointer-events: none;
}
.spx-edit .spx-edit__title {
  padding: 0 1rem; color: inherit; text-align: center;
  font-family: var(--wp--preset--font-family--display); font-size: 1.875rem; font-weight: 400; letter-spacing: -0.05em; line-height: 0.82;
}
.spx-edit .spx-edit__sub {
  margin-top: 0.5rem; padding: 0 1rem; text-align: center;
  color: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent); font-size: 0.75rem; font-style: italic;
}
/* (0,3,0): WordPress gives lists in full-width groups its 16px root padding; the cards start 20px in. */
.spx-home .spx-edit > .spx-edit__cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: 50vw; gap: 0.75rem;
  margin: 0.5rem 0 0; padding: 0 1.25rem; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem; scrollbar-width: none;
}
.spx-edit__cards::-webkit-scrollbar { display: none; }
.spx-edit__cards > li { scroll-snap-align: start; }
.spx-edit__card {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--gold) 72%, #000); border-radius: 0.75rem;
  color: var(--wp--preset--color--base); text-decoration: none;
}
.spx-edit__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Shade under the label, and a thin chevron at the bottom right. */
.spx-edit__card::before { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); }
.spx-edit__card::after {
  content: ""; position: absolute; right: 1.0625rem; bottom: 1.125rem; width: 0.4375rem; height: 0.4375rem;
  border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); opacity: 0.85;
}
.spx-edit__label {
  position: absolute; left: 0.875rem; right: 2rem; bottom: 0.75rem;
  font-size: 0.875rem; font-style: italic; font-weight: 600; line-height: 1.25;
}
.spx-edit__card:focus-visible { outline: 2px solid var(--wp--preset--color--gold); outline-offset: 2px; }
@media (min-width: 782px) {
  .spx-home .spx-edit > .spx-edit__cards { grid-auto-columns: 16rem; justify-content: center; padding-inline: var(--wp--style--root--padding-left); }
}

/* Eye test banner, where Lenskart's phone page has its banner (measured at 390px: 358 x 82, 16px corners,
   32px under the row above): navy card linking to the eye test page, offer on the left, a trial-frame photo
   fading into the middle, and a white button on the right. The whole card is the link. */
.spx-home > .spx-banner { margin-block-start: 1.875rem; }
.spx-banner {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 5.125rem; padding: 0.5rem 1rem; overflow: hidden; border-radius: 1rem;
  background: linear-gradient(105deg, var(--wp--preset--color--accent-3) 0%, #0B1660 55%, #132E78 100%);
  color: var(--wp--preset--color--base); text-decoration: none;
}
.spx-banner__img {
  position: absolute; z-index: -1; top: 50%; left: 54%; width: auto; height: 135%; transform: translate(-50%, -50%);
  -webkit-mask: radial-gradient(closest-side, #000 55%, transparent); mask: radial-gradient(closest-side, #000 55%, transparent);
}
.spx-banner__text { display: grid; justify-items: start; }
.spx-banner__icon {
  display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-bottom: 0.3125rem; border-radius: 50%;
  background: color-mix(in srgb, var(--wp--preset--color--base) 14%, transparent);
}
.spx-banner__icon svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spx-banner__title { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.spx-banner__sub { color: color-mix(in srgb, var(--wp--preset--color--base) 75%, transparent); font-size: 0.75rem; line-height: 1.35; }
.spx-banner__cta {
  flex: none; display: inline-flex; align-items: center; height: 1.875rem; padding: 0 0.875rem; border-radius: 0.5rem;
  background: var(--wp--preset--color--base); color: var(--wp--preset--color--accent-3); font-size: 0.8125rem; font-weight: 700;
}
.spx-banner:hover .spx-banner__cta { background: color-mix(in srgb, var(--wp--preset--color--base) 88%, var(--wp--preset--color--accent-3)); }
.spx-banner:focus-visible { outline: 2px solid var(--wp--preset--color--accent-3); outline-offset: 3px; }
@media (min-width: 782px) {
  .spx-banner { min-height: 8rem; padding: 1.25rem 2.5rem; border-radius: 1.25rem; }
  .spx-banner__title { font-size: 1.5rem; }
  .spx-banner__sub { font-size: 1rem; }
  .spx-banner__cta { height: 2.75rem; padding: 0 1.5rem; font-size: 1rem; }
}

/* Curated collections (Lenskart's "Exclusively at" grid), measured at 390px: heading and a 16px grey line, then
   two columns of 170px square cards 18px apart. Each card is a photo in a frame: a 2px gradient ring (its colours
   set per card in --spx-ring), a 3px white gap, then the photo with a dark fade and the centred title and tag. */
.spx-section.spx-row.spx-excl { gap: 0; } /* (0,3,0): over the rows' 7px gap, which comes later */
.spx-section .spx-excl__sub { color: #66657F; font-size: 1rem; line-height: 1.43; }
/* (0,2,0): the section's children otherwise lose their margins to .spx-section > *, which comes later. */
.spx-excl .spx-excl__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem;
  margin: 0.125rem 0 0; padding: 0; list-style: none;
}
.spx-excl__card {
  display: block; aspect-ratio: 1; padding: 3px; border: 2px solid transparent; border-radius: 1.25rem;
  background: linear-gradient(var(--wp--preset--color--base), var(--wp--preset--color--base)) padding-box, var(--spx-ring, var(--wp--preset--color--border)) border-box;
  color: var(--wp--preset--color--base); text-decoration: none;
}
.spx-excl__img { position: relative; display: block; height: 100%; overflow: hidden; border-radius: 0.9375rem; background: var(--wp--preset--color--contrast); }
.spx-excl__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.spx-excl__img::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.78)); }
.spx-excl__text {
  position: absolute; inset: auto 0.5rem 0.5625rem; z-index: 1; display: grid; justify-items: center; text-align: center;
}
.spx-excl__title { font-size: 1.0625rem; font-weight: 600; line-height: 1.2; }
.spx-excl__tag { color: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent); font-size: 0.75rem; font-style: italic; font-weight: 600; line-height: 1.3; }
.spx-excl__tag--caps { font-size: 0.625rem; font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; }
.spx-excl__card:focus-visible { outline: 2px solid var(--wp--preset--color--accent-3); outline-offset: 2px; }
@media (min-width: 782px) {
  .spx-excl .spx-excl__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1rem; }
  .spx-excl__title { font-size: 1.375rem; }
  .spx-excl__tag { font-size: 0.875rem; }
  .spx-excl__tag--caps { font-size: 0.75rem; }
}

/* The Spaxmax Edge (Lenskart's closing brand band), measured at 390px: 468px tall with the festive band's 12.4px top
   arc, slate fading to sky blue, a 26px white title, a 42px translucent two-line line, and a photo whose sky fades
   into the gradient; it sits flush on the footer. */
.spx-home > .spx-edge { margin-block-start: var(--wp--preset--spacing--60); }
.spx-edge {
  --spx-sag: clamp(0.75rem, 3.2vw, 2.5rem);
  --spx-edge-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 0Q50 20 100 0V10H0z'/%3E%3C/svg%3E") top / 100% var(--spx-sag) no-repeat,
    linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--spx-sag) + 1px) no-repeat;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 29.25rem; padding: 2.875rem 1rem 0;
  background: linear-gradient(#1B2730 0%, #1E2B32 11%, #2A3C46 21%, #465D69 33%, #61889E 43%, #81B9DA 50%);
  color: var(--wp--preset--color--base);
  -webkit-mask: var(--spx-edge-mask);
  mask: var(--spx-edge-mask);
}
.spx-home .spx-edge > * { margin: 0; }
.spx-edge .spx-edge__title { color: inherit; font-family: var(--wp--preset--font-family--body); font-size: 1.625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.spx-home .spx-edge > .spx-edge__line {
  margin-top: 0.75rem; color: color-mix(in srgb, var(--wp--preset--color--base) 62%, transparent);
  font-size: 2.625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 0.885;
}
/* Square photo on the band's floor; its top 38% (empty sky) fades into the gradient. */
.spx-edge__img {
  position: absolute; left: 0; bottom: 0; z-index: -1; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 100%;
  -webkit-mask: linear-gradient(transparent, #000 38%); mask: linear-gradient(transparent, #000 38%);
}
/* No block gap between the band and the footer. */
.wp-site-blocks > .spx-home:has(> .spx-edge:last-child) + .wp-block-template-part { margin-block-start: 0; }
@media (min-width: 782px) {
  .spx-edge { min-height: 34rem; padding: 4rem max(2rem, calc((100% - var(--wp--style--global--wide-size)) / 2)) 0; }
  .spx-edge__img { left: auto; right: 0; width: min(36rem, 55%); }
  .spx-home .spx-edge > .spx-edge__line { font-size: 4rem; }
}

/* ---------- Footer (Lenskart's phone footer on navy) ---------- */
/* Measured at 390px: 18px bold heading, 13px underlined "Show more", then 57px fold-out rows with thin light lines. */
.wp-site-blocks > .wp-block-template-part:has(.spx-foot) { margin-block-start: var(--wp--preset--spacing--70); }
.spx-foot { padding: 0.9375rem max(1rem, env(safe-area-inset-right, 0px)) 1.5rem max(1rem, env(safe-area-inset-left, 0px)); background: var(--wp--preset--color--accent-3); color: var(--wp--preset--color--base); }
.spx-foot__inner { max-width: var(--wp--style--global--wide-size, 1340px); margin: 0 auto; }
.spx-foot .spx-foot__title { margin: 0; color: inherit; font-family: var(--wp--preset--font-family--body); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.spx-foot summary { display: flex; align-items: center; cursor: pointer; list-style: none; }
.spx-foot summary::-webkit-details-marker { display: none; }
.spx-foot summary::after {
  content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin: -0.25rem 0.25rem 0 0.5rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.2s ease;
}
.spx-foot details[open] > summary::after { margin-top: 0.25rem; transform: rotate(-135deg); }
.spx-foot__more { margin-top: 0.875rem; }
.spx-foot__more summary { display: inline-flex; min-height: 1.1625rem; font-size: 0.8125rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.spx-foot__more summary::after { width: 0.375rem; height: 0.375rem; }
.spx-foot__open, .spx-foot__more[open] .spx-foot__closed { display: none; }
.spx-foot__more[open] .spx-foot__open { display: inline; }
.spx-foot__more p { margin: 0.75rem 0 0; color: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent); font-size: 0.875rem; line-height: 1.5; }
.spx-foot__nav { margin-top: 0.8125rem; }
.spx-foot__group { border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 75%, transparent); }
.spx-foot__group summary { justify-content: space-between; min-height: 3.5rem; font-size: 1rem; font-weight: 600; }
.spx-foot__group summary::after { margin-right: 0.375rem; }
.spx-foot__group ul { display: grid; gap: 0.25rem; margin: -0.25rem 0 0; padding: 0 0 1rem; list-style: none; }
.spx-foot__group a {
  display: flex; align-items: center; min-height: 2.5rem;
  color: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent); font-size: 0.9375rem; text-decoration: none;
}
.spx-foot__group a:hover { color: var(--wp--preset--color--base); text-decoration: underline; }
.spx-foot a:focus-visible, .spx-foot summary:focus-visible { outline: 2px solid var(--wp--preset--color--base); outline-offset: 2px; }
.spx-foot__legal { margin: 1.5rem 0 0; color: color-mix(in srgb, var(--wp--preset--color--base) 65%, transparent); font-size: 0.8125rem; }
@media (min-width: 782px) {
  .spx-foot { padding-block: 2.5rem 2rem; }
  .spx-foot__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2.5rem; }
}

/* minmax(0, 1fr): without it the bestseller rail widens the column instead of scrolling inside it. */
.spx-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.spx-home > .spx-row { margin-block-start: 1.6875rem; }
.spx-home > .spx-row + .spx-row { margin-block-start: 1.9375rem; }
.spx-section.spx-row { gap: 0.4375rem; }
.spx-section__head { align-items: center; }
.spx-section__head .spx-row__more { font-size: 0.8125rem; font-weight: 600; }
.spx-row__more a { color: var(--wp--preset--color--accent-3); text-decoration: none; }
.spx-row__more a::after { content: " \203A"; }
/* Vertical only: the shape row's negative side margins let it scroll edge to edge. */
.spx-section > *, .spx-section__head > * { margin-block: 0; }
.spx-section__head p { font-size: var(--wp--preset--font-size--small); font-weight: 600; }


/* Promises: 2x2 grey cards (four across on desktop), each with a navy line icon in a white circle. The icons follow
   the list order in the home template: prescription lenses, exchange, warranty, secure checkout. */
.spx-trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.spx-trust li {
  display: flex; align-items: center; gap: 0.625rem; min-height: 4rem; padding: 0.75rem;
  border-radius: 0.75rem; background: #F7F7F7;
  color: var(--wp--preset--color--contrast); font-size: 0.8125rem; font-weight: 600; line-height: 1.3;
}
.spx-trust li::before {
  content: ""; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--wp--preset--color--base) var(--spx-icon) center / 1.25rem no-repeat;
  box-shadow: inset 0 0 0 1px var(--wp--preset--color--border);
}
.spx-trust li:nth-child(1) { --spx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000042' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6.5' cy='14' r='3.5'/%3E%3Ccircle cx='17.5' cy='14' r='3.5'/%3E%3Cpath d='M10 13.5c1.3-1 2.7-1 4 0M3 14l1.5-6M21 14l-1.5-6'/%3E%3C/svg%3E"); }
.spx-trust li:nth-child(2) { --spx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000042' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h14l-3.5-3.5M20 15H6l3.5 3.5'/%3E%3C/svg%3E"); }
.spx-trust li:nth-child(3) { --spx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000042' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.spx-trust li:nth-child(4) { --spx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000042' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
@media (min-width: 782px) { .spx-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
