/* ==========================================================================
   JOTL — inner pages.
   Loaded by /shop/ and any page that is not the home page. tokens.css and
   base.css do the reset and the type ramp; components.css carries the shared
   chrome and .product-card. This sheet only lays out the shop.

   Sections
   1. Page shell and hero
   2. Layout: sidebar plus results
   3. Toolbar (search, sort, mobile filter button)
   4. Filter panel and options
   5. Active-filter chips
   6. Results head and grid
   7. Card extras the shop adds
   8. Responsive: drawer below 1000px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page shell and hero
   -------------------------------------------------------------------------- */

.site-main.shop {
  padding-bottom: var(--space-7);
}

.shop-hero {
  padding-block: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-sunken);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  font-size: var(--type-label-sm, 12px);
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--gold-text);
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.breadcrumb__sep {
  color: var(--outline-variant);
}

.breadcrumb [aria-current="page"] {
  color: var(--on-surface);
}

.shop-hero__eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--gold-text);
}

.shop-hero__title {
  margin: 0 0 var(--space-4);
  max-width: 18ch;
}

.shop-hero__lede {
  margin: 0;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: var(--type-body-lg, 18px);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   2. Layout: sidebar plus results
   -------------------------------------------------------------------------- */

.shop-body {
  padding-top: var(--space-5);
}

.shop-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-4);
}

.shop-results {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   3. Toolbar — search and sort, with the filter button on small screens
   -------------------------------------------------------------------------- */

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--hairline);
}

.shop-toolbar__filters {
  display: none;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: var(--space-2);
  padding-inline: 0.35em;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: var(--weight-semibold, 600);
  font-variant-numeric: tabular-nums;
}

.shop-toolbar__search {
  flex: 1 1 16rem;
  position: relative;
  display: block;
}

.shop-toolbar__search input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--type-body-md, 15px);
}

.shop-toolbar__search input::placeholder {
  color: var(--text-muted);
}

.shop-toolbar__search input:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 2px;
}

.shop-toolbar__sort {
  display: block;
}

.shop-toolbar__sort select {
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--type-body-sm, 14px);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) calc(50% + 1px),
                       calc(100% - 0.8rem) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.shop-toolbar__sort select:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. Filter panel and options
   -------------------------------------------------------------------------- */

/* Backdrop exists only for the mobile drawer; hidden on the wide layout. */
.filter-backdrop {
  display: none;
}

.filter-panel {
  position: sticky;
  top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}

.filter-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.filter-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-sm, 1.25rem);
  font-weight: var(--weight-regular, 400);
}

/* The close button only exists for the mobile drawer. */
.filter-panel__close {
  display: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--on-surface);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.filter-group {
  margin: 0;
  padding: var(--space-4) 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

.filter-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.filter-group__legend {
  padding: 0;
  margin-bottom: var(--space-2);
  color: var(--on-surface);
  font-size: var(--type-label-apothecary, 11px);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0;
  color: var(--on-surface-variant);
  font-size: var(--type-body-sm, 14px);
  cursor: pointer;
}

.filter-option:hover {
  color: var(--on-surface);
}

.filter-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.filter-option input:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 2px;
}

.filter-option input:checked + .filter-option__label {
  color: var(--on-surface);
  font-weight: var(--weight-semibold, 600);
}

.filter-group__note {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: var(--type-label-sm, 12px);
  line-height: 1.5;
}

.filter-form {
  margin: 0;
}

.filter-form__submit {
  margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   5. Active-filter chips
   -------------------------------------------------------------------------- */

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--gold-rim);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--type-label-sm, 12px);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard);
}

.filter-chip:hover {
  border-color: var(--gold-text);
  background: var(--surface-container);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 2px;
}

.filter-chip__x {
  color: var(--text-muted);
  font-size: 1em;
  line-height: 1;
}

.filter-chip--clear {
  border-color: transparent;
  background: transparent;
  color: var(--gold-text);
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

/* --------------------------------------------------------------------------
   6. Results head and grid
   -------------------------------------------------------------------------- */

.shop-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.shop-results__count {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-body-sm, 14px);
  font-variant-numeric: tabular-nums;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1240px) {
  .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The card a ?product= link arrived for. A gold rim, no movement. */
.product-card--target {
  border-color: var(--gold-text);
  box-shadow: var(--elev-gold, 0 0 0 1px var(--gold-rim));
}

/* --------------------------------------------------------------------------
   7. Card extras the shop adds — summary, rating and stock line.
   .product-card itself is shared and lives in components.css.
   -------------------------------------------------------------------------- */

.product-card__summary {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-body-sm, 14px);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__rating {
  color: var(--gold-text);
  font-size: var(--type-label-sm, 12px);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.02em;
}

.product-card__stock {
  color: var(--text-muted);
  font-size: var(--type-label-sm, 12px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-card .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   8. Responsive — below 1000px the sidebar becomes an off-canvas drawer.
   Same markup, one class on <body>, so nothing is duplicated for mobile.
   -------------------------------------------------------------------------- */

@media (max-width: 999px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .shop-toolbar__filters {
    display: inline-flex;
  }

  .filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(1, 12, 9, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-standard);
  }

  .filter-panel {
    position: fixed;
    z-index: 61;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(22rem, 88vw);
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--hairline);
    border-radius: 0;
    transform: translateX(-102%);
    transition: transform var(--dur-base) var(--ease-enter);
  }

  .filter-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* The submit button is only useful when the drawer hides the results. */
  .filter-form {
  margin: 0;
}

.filter-form__submit {
    display: block;
  }

  .filters-open .filter-panel {
    transform: translateX(0);
  }

  .filters-open .filter-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .filters-open {
    overflow: hidden;
  }
}

@media (max-width: 639px) {
  .shop-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-hero {
    padding-block: var(--space-5) var(--space-4);
  }

  .shop-toolbar__sort {
    flex: 1 1 100%;
  }

  .shop-toolbar__sort select {
    width: 100%;
  }
}

/* On the wider layout the form is always visible, so the submit button is a
   convenience rather than the only way to apply a change. */
@media (min-width: 1000px) {
  .filter-form {
  margin: 0;
}

.filter-form__submit {
    display: none;
  }
}


/* ==========================================================================
   Product detail page (Phase 5)
   Mobile first: gallery stacks above the buy box below 900px. Every value
   comes from tokens.css, so light and dark mode follow automatically.
   ========================================================================== */

.product-page {
  padding-block: var(--space-5) var(--space-7);
}

/* Breadcrumb --------------------------------------------------------------
   .breadcrumb and .breadcrumb__sep are shared with the shop page. Scoped
   here only so the extra category segment product.js unhides sits correctly
   in the trail in both colour schemes. */

.product-page .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-5);
  font-size: var(--type-label-sm);
  letter-spacing: var(--type-label-sm-ls);
  color: var(--text-muted);
}

.product-page .breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: var(--border-width) solid transparent;
}

.product-page .breadcrumb a:hover {
  color: var(--gold-text);
  border-bottom-color: var(--gold-rim);
}

.product-page .breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.product-page .breadcrumb [aria-current="page"] {
  color: inherit;
}

/* Loading, missing and error states ---------------------------------------
   One .product-shell carries them all, so the page never jumps: it holds a
   minimum height while the catalogue is in flight. */

.product-shell {
  min-block-size: 22rem;
}

.product-status {
  max-inline-size: 46ch;
  margin: 0;
  padding-block: var(--space-6);
  color: var(--text-muted);
}

.product-status--missing,
.product-status--error {
  padding: var(--space-6);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--elev-1);
}

.product-status__title {
  margin-block: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: var(--type-headline-md);
  line-height: var(--type-headline-md-lh);
  color: inherit;
}

.product-status__body {
  margin-block: 0 var(--space-4);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
}

.product-status__body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
}

.product-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
}

/* The two-column frame ---------------------------------------------------- */

.product-detail {
  display: block;
}

.product-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

/* Gallery -----------------------------------------------------------------
   Rule D: the source art is 512px, so the frame is capped there rather than
   upscaled to fill a wide column. */

.product-gallery {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}

.product-gallery__frame {
  margin: 0;
  inline-size: 100%;
  max-inline-size: 512px;
  overflow: hidden;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
  box-shadow: var(--elev-1);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.product-gallery__image {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: 512px;
  object-fit: contain;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  inline-size: 100%;
  max-inline-size: 512px;
  justify-content: center;
}

.product-gallery__thumb-item {
  margin: 0;
}

.product-thumb {
  display: block;
  inline-size: 4.5rem;
  block-size: 4.5rem;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-container-low);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-thumb:hover {
  border-color: var(--gold-rim);
  transform: translateY(-1px);
}

.product-thumb[aria-pressed="true"] {
  border-color: var(--gold-rim);
  box-shadow: var(--elev-gold);
}

.product-thumb__img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* Buy box ----------------------------------------------------------------- */

.product-buy {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--elev-1);
}

.product-buy__eyebrow {
  margin: 0;
}

.product-buy__flag {
  margin: 0;
}

.product-buy__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-lg-mobile, var(--type-headline-md));
  line-height: var(--type-headline-lg-mobile-lh, var(--type-headline-md-lh));
  letter-spacing: var(--type-headline-lg-ls, normal);
  color: inherit;
}

.product-buy__rating {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--type-label-md);
  color: var(--text-muted);
}

.product-buy__rating--empty {
  font-style: italic;
}

.product-buy__stars {
  color: var(--gold-text);
  letter-spacing: 0.08em;
}

.product-buy__summary {
  margin: 0;
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--text-muted);
}

.product-buy__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  padding-block: var(--space-2) 0;
}

.product-buy__price-now {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  font-weight: var(--type-headline-sm-weight, 400);
}

.product-buy__price-was {
  font-size: var(--type-body-sm);
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-buy__price-note {
  margin: 0;
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--gold-muted-text);
}

/* Size selector ----------------------------------------------------------- */

.product-size {
  margin: 0;
  padding: var(--space-3) 0 0;
  border: 0;
  border-top: var(--border-width) solid var(--hairline);
}

.product-size__legend {
  padding: 0;
  font-size: var(--type-label-md);
  font-weight: var(--type-label-md-weight, 600);
  color: var(--text-muted);
}

.product-size__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
}

.product-size__option {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-container-low);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.product-size__option:hover {
  border-color: var(--gold-rim);
}

/* The radio itself is taken out of flow but stays focusable, so the keyboard
   and screen readers keep working while the label carries the look. */
.product-size__option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.product-size__option:focus-within {
  border-color: var(--gold-rim);
  box-shadow: var(--elev-gold);
}

.product-size__option:has(input:checked) {
  border-color: var(--gold-rim);
  box-shadow: var(--elev-gold);
  background: var(--surface-container-high, var(--bg-raised));
}

.product-size__option input:checked ~ .product-size__label {
  color: var(--gold-text);
}

.product-size__label {
  font-size: var(--type-label-md);
  font-weight: var(--type-label-md-weight, 600);
}

.product-size__price {
  font-size: var(--type-label-sm);
  color: var(--text-muted);
}

/* Subscribe and save ------------------------------------------------------ */

.product-subscribe {
  padding-block-start: var(--space-3);
  border-top: var(--border-width) solid var(--hairline);
}

.product-subscribe__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.product-subscribe__row input {
  flex: 0 0 auto;
  inline-size: 1.15rem;
  block-size: 1.15rem;
  margin-block-start: 0.2rem;
  accent-color: var(--gold-text);
  cursor: pointer;
}

.product-subscribe__copy {
  display: grid;
  gap: 0.2rem;
}

.product-subscribe__title {
  font-size: var(--type-label-md);
  font-weight: var(--type-label-md-weight, 600);
}

.product-subscribe__note {
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--text-muted);
}

/* Add to bag -------------------------------------------------------------- */

.product-buy__add {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  inline-size: 100%;
}

.product-buy__add-price {
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  font-weight: 400;
  opacity: 0.85;
}

.product-buy__stock {
  margin: 0;
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--text-muted);
}

.product-buy__stock-label {
  font-weight: var(--type-label-sm-weight, 600);
  color: var(--gold-muted-text);
}

.product-buy__fineprint {
  margin: 0;
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--text-muted);
  opacity: 0.9;
}

.product-buy__add[disabled] {
  cursor: not-allowed;
}

/* Below-the-fold sections ------------------------------------------------- */

.product-sections {
  display: grid;
  gap: 0;
  margin-block-start: var(--space-6);
}

.product-section {
  padding-block: var(--space-5);
  border-top: var(--border-width) solid var(--hairline);
}

.product-section:first-child {
  border-top: 0;
}

.product-section__title {
  margin-block: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: var(--type-headline-md);
  line-height: var(--type-headline-md-lh);
}

.product-section__lede {
  max-inline-size: 62ch;
  margin-block: 0 var(--space-4);
  font-size: var(--type-body-lg);
  line-height: var(--type-body-lg-lh);
  color: var(--text-muted);
}

.product-section__subtitle {
  margin-block: var(--space-4) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  font-weight: var(--type-label-md-weight, 600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-muted-text);
}

/* The science: actives as cards */

.product-actives {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-active {
  padding: var(--space-4);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-container-low);
}

.product-active__name {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
}

.product-active__plain {
  margin: 0 0 var(--space-2);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
}

.product-active__role {
  margin: 0;
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--gold-muted-text);
}

/* How to use */

.product-steps,
.product-cautions {
  max-inline-size: 62ch;
  margin: 0;
  padding-inline-start: 1.35rem;
  display: grid;
  gap: var(--space-2);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
}

.product-steps li::marker {
  color: var(--gold-text);
  font-family: var(--font-mono);
}

.product-cautions {
  color: var(--text-muted);
}

.product-patchtest {
  max-inline-size: 62ch;
  margin-block-start: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-md);
  background: var(--surface-container-low);
}

.product-patchtest p {
  margin: 0;
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.product-patchtest .product-patchtest__title {
  margin-block-end: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  font-weight: var(--type-label-sm-weight, 600);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* Honest timeline */

.product-timeline {
  padding: var(--space-5) var(--space-4);
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
  box-shadow: var(--elev-gold);
}

.product-timeline__badge {
  display: inline-block;
  margin: 0 0 var(--space-3);
  padding: 0.35rem 0.85rem;
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-pill);
  font-size: var(--type-label-sm);
  letter-spacing: var(--type-label-sm-ls, 0.06em);
  text-transform: uppercase;
  color: var(--gold-text);
}

.product-timeline__body {
  max-inline-size: 62ch;
  margin: 0 0 var(--space-3);
  font-size: var(--type-body-lg);
  line-height: var(--type-body-lg-lh);
}

.product-timeline__footnote {
  max-inline-size: 62ch;
  margin: 0;
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--text-muted);
  font-style: italic;
}

/* Full INCI list */

.product-inci {
  max-inline-size: 62ch;
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-container-low);
}

.product-inci__summary {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-size: var(--type-label-md);
  font-weight: var(--type-label-md-weight, 600);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.product-inci__summary::-webkit-details-marker {
  display: none;
}

.product-inci__summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.1em;
  color: var(--gold-text);
  line-height: 1;
}

.product-inci[open] .product-inci__summary::after {
  content: "\2212";
}

.product-inci__summary:hover {
  color: var(--gold-text);
}

.product-inci__summary:focus-visible {
  outline: 2px solid var(--gold-rim);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.product-inci__list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-block-start: var(--border-width) solid var(--hairline);
  padding-inline-start: calc(var(--space-4) + 0.6rem);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.product-inci__note {
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--text-muted);
  opacity: 0.85;
}

/* Two columns from 640px -------------------------------------------------- */

@media (min-width: 640px) {
  .product-buy {
    padding: var(--space-5);
  }

  .product-actives {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-timeline {
    padding: var(--space-6) var(--space-5);
  }
}

/* Gallery beside the buy box from 900px ----------------------------------- */

@media (min-width: 900px) {
  .product-detail__layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--space-6);
  }

  .product-gallery {
    position: sticky;
    top: var(--space-5);
    justify-items: start;
  }

  .product-gallery__thumbs {
    justify-content: flex-start;
  }

  .product-buy__title {
    font-size: var(--type-headline-lg);
    line-height: var(--type-headline-lg-lh);
    letter-spacing: var(--type-headline-lg-ls, normal);
  }

  .product-sections {
    margin-block-start: var(--space-7);
  }

  .product-section {
    padding-block: var(--space-6);
  }

  .product-actives {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .product-detail__layout {
    gap: var(--space-7);
  }
}

/* Motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .product-thumb,
  .product-size__option {
    transition: none;
  }

  .product-thumb:hover {
    transform: none;
  }
}

/* ==========================================================================
   Quiz — /quiz/index.html
   One question on stage at a time, centred, maximum focus.
   ========================================================================== */

.quiz-page,
.results-page {
  background: var(--bg);
}

.quiz-shell,
.results-shell {
  padding-block: var(--space-6) var(--space-7);
}

.quiz {
  max-width: 660px;
  margin-inline: auto;
}

.quiz__head {
  text-align: center;
  margin-block-end: var(--space-5);
}

.quiz__head--compact {
  margin-block-end: var(--space-4);
}

.quiz__head--compact .quiz__lede {
  display: none;
}

.quiz__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--type-headline-lg);
  line-height: var(--type-headline-lg-lh);
  letter-spacing: var(--type-headline-lg-ls);
  color: var(--on-surface);
}

.quiz__lede {
  max-width: var(--measure);
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: var(--type-body-lg);
  line-height: var(--type-body-lg-lh);
  color: var(--on-surface-variant);
}

/* Progress ---------------------------------------------------------------- */

.quiz-progress {
  margin-block-end: var(--space-5);
}

.quiz-progress__track {
  position: relative;
  height: 3px;
  overflow: hidden;
  background: var(--hairline);
  border-radius: var(--radius-pill);
}

.quiz-progress__bar {
  display: block;
  height: 100%;
  inline-size: 0;
  background: var(--gradient-gold-sheen);
  border-radius: inherit;
  transition: inline-size var(--dur-base) var(--ease-standard);
}

.quiz-progress__count {
  margin-block-start: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  letter-spacing: var(--type-label-sm-ls);
  color: var(--gold-muted-text);
  text-align: center;
}

/* Stage and card ---------------------------------------------------------- */

.quiz-stage {
  min-height: 340px;
}

.quiz-card {
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: var(--surface-container-low, var(--bg-raised));
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  animation: quiz-card-in var(--dur-slow) var(--ease-enter) both;
}

@keyframes quiz-card-in {
  from {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-card__area {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  color: var(--gold-muted-text);
}

.quiz-card__prompt {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--type-headline-md);
  line-height: var(--type-headline-md-lh);
  color: var(--on-surface);
  text-wrap: balance;
}

/* Options ----------------------------------------------------------------- */

.quiz-options {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.quiz-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-raised);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}

.quiz-option:hover {
  border-color: var(--gold-rim);
  background: var(--bg-inset);
  transform: translateY(-1px);
}

.quiz-option:focus-within {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.quiz-option:has(.quiz-option__input:checked) {
  border-color: var(--gold-decor);
  background: var(--bg-inset);
  box-shadow: var(--elev-gold);
}

.quiz-option__input {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  pointer-events: none;
}

.quiz-option__mark {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  margin-block-start: 2px;
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-circle);
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.quiz-option:has(.quiz-option__input:checked) .quiz-option__mark {
  border-color: var(--gold-decor);
  box-shadow: inset 0 0 0 4px var(--gold-decor);
}

.quiz-option__label {
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--on-surface);
}

/* Navigation -------------------------------------------------------------- */

.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin-block-start: var(--space-4);
}

.quiz-nav__back,
.quiz-nav__next {
  min-height: var(--control-height-md);
  padding-inline: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  line-height: var(--type-label-md-lh);
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--hairline);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard);
}

.quiz-nav__back:hover:not(:disabled) {
  color: var(--on-surface);
  border-color: var(--gold-rim);
}

.quiz-nav__back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz-nav__next {
  margin-inline-start: auto;
  border-color: var(--gold-decor);
  background: var(--gold-decor);
  color: var(--bg);
  font-weight: var(--weight-semibold);
}

.quiz-nav__next:hover:not(:disabled) {
  background: var(--gold-text);
  border-color: var(--gold-text);
}

.quiz-nav__next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz__foot {
  margin-block-start: var(--space-5);
  text-align: center;
}

.quiz__reset {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
}

.quiz__reset:hover {
  color: var(--gold-text);
}

/* No-script / status ------------------------------------------------------ */

.quiz-status,
.results-status {
  padding: var(--space-5);
  background: var(--surface-container-low, var(--bg-raised));
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
  text-align: center;
}

.quiz-status__title,
.results-status__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--on-surface);
}

.quiz-status__body,
.results-status__body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--on-surface-variant);
}

.results-status--error {
  border-color: var(--error);
}

.results-status--error .results-status__title {
  color: var(--error);
}

.results-status--soft {
  background: var(--bg-inset);
  border-style: dashed;
}

.results-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-block-start: var(--space-4);
}

/* ==========================================================================
   Results — /quiz/results.html
   ========================================================================== */

.results-wrap {
  max-width: var(--container-lg);
  margin-inline: auto;
}

.results {
  display: block;
}

.results__head {
  max-width: var(--measure);
  margin-block-end: var(--space-5);
}

.results__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--type-headline-lg);
  line-height: var(--type-headline-lg-lh);
  letter-spacing: var(--type-headline-lg-ls);
  color: var(--on-surface);
  text-wrap: balance;
}

.results__lede {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-lg);
  line-height: var(--type-body-lg-lh);
  color: var(--on-surface-variant);
}

/* Focus list -------------------------------------------------------------- */

.results-focus {
  padding: var(--space-4) var(--space-5);
  margin-block-end: var(--space-6);
  background: var(--bg-inset);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
}

.results-focus__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  color: var(--gold-muted-text);
}

.results-focus__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-inline-start: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--on-surface-variant);
}

/* Routine grid ------------------------------------------------------------ */

.routine-grid {
  display: grid;
  gap: var(--space-5);
  margin-block-end: var(--space-6);
}

.routine {
  padding: var(--space-4);
  background: var(--surface-container-low, var(--bg-raised));
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-lg);
}

.routine__head {
  margin-block-end: var(--space-3);
  padding-block-end: var(--space-3);
  border-block-end: var(--border-width) solid var(--hairline);
}

.routine__title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--on-surface);
}

.routine__note {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
}

.routine__steps {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Routine step ------------------------------------------------------------ */

.routine-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding-block-end: var(--space-3);
  border-block-end: var(--border-width) solid var(--hairline);
}

.routine-step:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.routine-step__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-inset);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-sm);
}

.routine-step__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.routine-step__img--empty {
  background: var(--gradient-veil);
}

.routine-step__body {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.routine-step__when {
  font-family: var(--font-mono);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  color: var(--gold-muted-text);
}

.routine-step__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--on-surface);
}

.routine-step__title a {
  color: inherit;
  text-decoration: none;
}

.routine-step__title a:hover {
  color: var(--gold-text);
}

.routine-step__why {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
}

.routine-step__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
  margin-block-start: var(--space-1);
}

.routine-step__size {
  font-family: var(--font-mono);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  color: var(--on-surface-variant);
}

.routine-step__price {
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--on-surface);
}

.routine-step__add {
  justify-self: start;
  min-height: var(--control-height-sm);
  padding-inline: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  line-height: var(--type-label-sm-lh);
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--gold-text);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.routine-step__add:hover:not(:disabled) {
  background: var(--gold-decor);
  border-color: var(--gold-decor);
  color: var(--bg);
}

.routine-step__add:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Actions ----------------------------------------------------------------- */

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-block-end: var(--space-4);
}

.results-addall {
  min-height: var(--control-height-lg);
  padding-inline: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  line-height: var(--type-label-md-lh);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  border: var(--border-width) solid var(--gold-decor);
  border-radius: var(--radius-pill);
  background: var(--gold-decor);
  color: var(--bg);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.results-addall:hover:not(:disabled) {
  background: var(--gold-text);
  border-color: var(--gold-text);
}

.results-addall:disabled {
  opacity: 0.5;
  cursor: default;
}

.results-actions__note {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
}

.results-retake {
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.results-retake:hover {
  color: var(--gold-text);
}

/* Email capture (unwired — see note in results.js) ------------------------ */

.results-list {
  max-width: var(--measure);
  padding: var(--space-5);
  margin-block: var(--space-6) var(--space-4);
  background: var(--bg-inset);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-md);
}

.results-list__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--on-surface);
}

.results-list__lede {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
}

.quiz-list {
  display: grid;
  gap: var(--space-2);
}

.quiz-list__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.quiz-list__input {
  flex: 1 1 220px;
  min-height: var(--control-height-md);
  padding-inline: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  color: var(--on-surface);
  background: var(--bg-raised);
  border: var(--border-width) solid var(--hairline);
  border-radius: var(--radius-sm);
}

.quiz-list__input:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.quiz-list__submit {
  min-height: var(--control-height-md);
  padding-inline: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  line-height: var(--type-label-md-lh);
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--gold-text);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.quiz-list__submit:hover {
  background: var(--gold-decor);
  color: var(--bg);
}

.quiz-list__note {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--on-surface-variant);
}

.quiz-list__note--error {
  color: var(--error);
}

/* Motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .quiz-card {
    animation: none;
  }

  .quiz-progress__bar,
  .quiz-option,
  .quiz-option__mark,
  .quiz-nav__back,
  .quiz-nav__next,
  .routine-step__add,
  .results-addall,
  .quiz-list__submit {
    transition: none;
  }

  .quiz-option:hover {
    transform: none;
  }
}

/* Results — two columns once there is room -------------------------------- */

@media (min-width: 900px) {
  .routine-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .results__head,
  .results-focus {
    max-width: 72ch;
  }
}
