/* ==========================================================================
   JOTL — components.css
   Global components shared by every page:
     Header and mega-menu · currency switcher · search panel
     Footer · trust badges
     Cart drawer and its primitives (buttons, quantity stepper, meter)
     Cookie banner
     Placeholder card (Image honesty policy, Rule B)
   Depends on tokens.css and base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   Three weights, used consistently. Every one is at least 44px tall on a
   pointer device, has a visible focus ring, and reads correctly in both
   themes because it references semantic aliases rather than raw scales.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height-md);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  font-weight: var(--weight-semibold);
  line-height: var(--type-label-md-lh);
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-pill);
  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),
    box-shadow var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: var(--on-primary);
}

:root[data-theme="dark"] .btn--primary:hover {
  background: var(--secondary-fixed);
  border-color: var(--secondary-fixed);
  color: var(--on-primary);
}

.btn--gold {
  background: var(--gradient-gold-sheen);
  background-size: 200% 100%;
  color: #231B00;
  border-color: transparent;
}

.btn--gold:hover {
  background-position: 100% 0;
  color: #231B00;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-inset);
  color: var(--text);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--sm {
  min-height: var(--control-height-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--type-label-sm);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Icon buttons — every icon-only control needs an accessible name in markup.
   -------------------------------------------------------------------------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: var(--control-height-md);
  height: var(--control-height-md);
  color: var(--text);
  border-radius: var(--radius-pill);
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.icon-btn:hover {
  background: var(--bg-inset);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-apothecary);
  line-height: var(--type-label-apothecary-lh);
  font-weight: var(--type-label-apothecary-weight);
  letter-spacing: var(--type-label-apothecary-ls);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge--gold {
  background: var(--secondary-container);
  color: #231B00;
}

.badge--emerald {
  background: var(--primary-container);
  color: #ADCEC0;
}

.badge--outline {
  border: var(--border-width) solid var(--border);
  color: var(--text-muted);
}

/* Cart count — sits on the header cart button. */
.cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}

:root[data-theme="dark"] .cart-count {
  color: #071712;
}

.cart-count.is-pop {
  animation: cart-pop var(--dur-slow) var(--ease-out-soft);
}

@keyframes cart-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Skip link target and page shell
   -------------------------------------------------------------------------- */

.site-main {
  min-height: 50vh;
}

/* --------------------------------------------------------------------------
   HEADER
   Sticky, three-column grid so the wordmark stays optically centred no matter
   how wide the utility cluster gets.
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: var(--border-width) solid var(--hairline);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header.is-scrolled {
  box-shadow: var(--elev-1);
  border-bottom-color: var(--border);
}

.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height-mobile);
}

@media (min-width: 1024px) {
  .header-bar {
    height: var(--header-height);
  }
}

/* --- Wordmark --- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  justify-self: center;
}

.wordmark__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--gold-text);
}

.wordmark__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wordmark__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--weight-regular);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wordmark__tag {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 479px) {
  .wordmark__tag {
    display: none;
  }

  .wordmark__name {
    font-size: 18px;
    letter-spacing: 0.12em;
  }
}

/* --- Primary navigation row (desktop) --- */

.header-nav {
  display: none;
}

@media (min-width: 1024px) {
  .header-nav {
    display: block;
    border-top: var(--border-width) solid var(--hairline);
  }
}

.header-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--margin-desktop);
}

.header-nav__list > li {
  margin: 0;
}

.header-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  position: relative;
  transition: color var(--dur-fast) var(--ease-standard);
}

.header-nav__link:hover,
.header-nav__link[aria-expanded="true"] {
  color: var(--text);
}

/* The gold hairline that draws in under the active or hovered item. */
.header-nav__link::after {
  content: "";
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: 8px;
  height: 1px;
  background: var(--gold-decor);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out-soft);
}

.header-nav__link:hover::after,
.header-nav__link[aria-expanded="true"]::after,
.header-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-nav__link[aria-current="page"] {
  color: var(--text);
}

.header-nav__chevron {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform var(--dur-fast) var(--ease-standard);
}

.header-nav__link[aria-expanded="true"] .header-nav__chevron {
  transform: rotate(180deg);
}

/* --- Utility cluster --- */

.header-utils {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}

.header-utils__start {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* The mobile menu button lives on the left; search/theme/cart stay right. */
@media (max-width: 1023px) {
  .header-bar {
    grid-template-columns: auto 1fr auto;
  }

  .wordmark {
    justify-self: center;
  }

  .header-utils .icon-btn--search,
  .header-utils .currency {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Currency switcher
   A native <select> on purpose: it is the control every platform already
   handles correctly, including screen readers and phone pickers. It is styled
   to match the header rather than replaced by a custom listbox.
   -------------------------------------------------------------------------- */

.currency {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.currency__select {
  appearance: none;
  -webkit-appearance: none;
  min-height: var(--control-height-sm);
  padding: var(--space-1) 26px var(--space-1) var(--space-3);
  background-color: transparent;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.currency__select:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* The select's own option list is painted by the OS, but the popup in Chrome
   and Firefox on desktop follows the page background, so set it explicitly. */
.currency__select option {
  background: var(--bg-raised);
  color: var(--text);
}

.currency__chevron {
  position: absolute;
  right: 9px;
  width: 10px;
  height: 10px;
  pointer-events: none;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
}

/* --------------------------------------------------------------------------
   Theme toggle
   A single button with a sun/moon pair; the correct icon is revealed by the
   aria-pressed state rather than by CSS-only class names, so the visual state
   can never drift from the announced state.
   -------------------------------------------------------------------------- */

.theme-toggle svg {
  transition: transform var(--dur-base) var(--ease-out-soft);
}

.theme-toggle .theme-toggle__sun {
  display: none;
}

.theme-toggle[aria-pressed="true"] .theme-toggle__moon {
  display: none;
}

.theme-toggle[aria-pressed="true"] .theme-toggle__sun {
  display: block;
}

.theme-toggle:hover svg {
  transform: rotate(18deg);
}

/* --------------------------------------------------------------------------
   MEGA-MENU
   One panel, opened by "Shop all". Columns are grouped by category, concern
   and type so the megamenu mirrors how the shop page filters.
   -------------------------------------------------------------------------- */

.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--bg-raised);
  border-bottom: var(--border-width) solid var(--border);
  box-shadow: var(--elev-3);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-out-soft);
}

.mega.is-open {
  opacity: 1;
  transform: translateY(0);
}

.mega__inner {
  max-width: var(--container-xl);
  margin-inline: auto;
  padding: var(--space-5) var(--margin-desktop);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 1.15fr;
  gap: var(--space-5);
}

.mega__col-title {
  font-family: var(--font-body);
  font-size: var(--type-label-apothecary);
  font-weight: var(--type-label-apothecary-weight);
  letter-spacing: var(--type-label-apothecary-ls);
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: var(--space-3);
}

.mega__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega__link {
  display: block;
  padding: 7px var(--space-2);
  margin-left: calc(var(--space-2) * -1);
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.mega__link:hover,
.mega__link:focus-visible {
  background: var(--bg-inset);
  color: var(--text);
}

/* The feature card — the one image in the menu. Rule D applies: never
   upscaled past native, so it is capped and framed. */
.mega__feature {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 10%, var(--glow) 0%, transparent 62%),
    var(--gradient-cosmic-deep);
  color: #E8ECE9;
  text-decoration: none;
}

.mega__feature-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 512px;
  margin-inline: auto;
  opacity: 0.55;
}

.mega__feature-body {
  position: relative;
  z-index: 1;
}

.mega__feature-eyebrow {
  font-family: var(--font-body);
  font-size: var(--type-label-apothecary);
  font-weight: var(--type-label-apothecary-weight);
  letter-spacing: var(--type-label-apothecary-ls);
  text-transform: uppercase;
  color: var(--secondary-fixed);
}

.mega__feature-title {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  margin-top: var(--space-1);
}

.mega__feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  color: var(--secondary-fixed);
}

.mega__feature:hover .mega__feature-cta {
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   SEARCH PANEL
   -------------------------------------------------------------------------- */

.search-panel {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(64px, 14vh, 160px);
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}

.search-panel.is-open {
  opacity: 1;
}

.search-panel__box {
  width: min(680px, calc(100% - 2 * var(--margin-mobile)));
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-4);
  padding: var(--space-4);
  transform: translateY(-12px);
  transition: transform var(--dur-base) var(--ease-out-soft);
}

.search-panel.is-open .search-panel__box {
  transform: translateY(0);
}

.search-panel__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
  padding-bottom: var(--space-2);
}

.search-panel__row svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.search-panel__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: var(--space-2) 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--text);
}

.search-panel__input:focus {
  outline: none;
}

.search-panel__hint {
  margin-top: var(--space-3);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.search-panel__hint kbd {
  padding: 1px 6px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11px;
}

.search-panel__submit {
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   MOBILE NAV DRAWER
   -------------------------------------------------------------------------- */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  background: var(--scrim-strong);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}

.mobile-nav.is-open {
  opacity: 1;
}

.mobile-nav__panel {
  width: min(400px, 88vw);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--dur-base) var(--ease-out-soft);
}

.mobile-nav.is-open .mobile-nav__panel {
  transform: translateX(0);
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--hairline);
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  z-index: 1;
}

.mobile-nav__body {
  padding: var(--space-4);
  flex: 1;
}

.mobile-nav__group + .mobile-nav__group {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--hairline);
}

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--control-height-md);
  padding: var(--space-2) 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  color: var(--text);
  text-decoration: none;
}

.mobile-nav__sub {
  list-style: none;
  padding: 0;
  margin: var(--space-1) 0 var(--space-2);
}

.mobile-nav__sub a {
  display: block;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: var(--border-width) solid var(--border);
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  color: var(--text-muted);
  text-decoration: none;
}

.mobile-nav__sub a:hover {
  color: var(--text);
  border-left-color: var(--gold-decor);
}

.mobile-nav__foot {
  padding: var(--space-4);
  border-top: var(--border-width) solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mobile-nav__utils {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   CART DRAWER
   -------------------------------------------------------------------------- */

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: flex;
  justify-content: flex-end;
}

.cart-drawer__scrim {
  flex: 1;
  background: var(--scrim);
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}

.cart-drawer.is-open .cart-drawer__scrim {
  opacity: 1;
}

.cart-drawer__panel {
  width: min(440px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  box-shadow: var(--elev-4);
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out-soft);
}

.cart-drawer.is-open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: var(--border-width) solid var(--hairline);
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  z-index: 2;
}

.cart-drawer__title {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.cart-drawer__count {
  font-family: var(--font-body);
  font-size: var(--type-label-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--type-label-sm-ls);
  text-transform: uppercase;
  color: var(--text-muted);
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-3) var(--space-4);
}

.cart-drawer__footer {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: var(--border-width) solid var(--hairline);
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cart-drawer__trust {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.cart-drawer__trust svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 3px;
  fill: var(--gold-decor);
}

/* --- Empty state --- */

.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-3);
  gap: var(--space-2);
}

.cart-drawer__empty-mark {
  width: 72px;
  height: 72px;
  color: var(--gold-decor);
  margin-bottom: var(--space-2);
}

.cart-drawer__empty-title {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
}

.cart-drawer__empty-copy {
  font-size: var(--type-body-md);
  color: var(--text-muted);
  max-width: 30ch;
  margin-bottom: var(--space-2);
}

.cart-drawer__empty .btn {
  width: 100%;
}

/* --- Lines --- */

.cart-drawer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-width) solid var(--hairline);
}

.cart-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cart-line__media img {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--hairline);
}

.cart-line__noimg {
  width: 72px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: var(--border-width) dashed var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 24px;
}

.cart-line__detail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-line__title {
  font-family: var(--font-body);
  font-size: var(--type-body-md);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  color: var(--text);
}

.cart-line__variant {
  font-size: var(--type-body-sm);
  color: var(--text-muted);
}

.cart-line__cadence {
  margin-top: 2px;
}

.cart-line__estimate {
  font-size: 11px;
  line-height: 14px;
  color: var(--text-muted);
}

.cart-line__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.cart-line__price {
  font-size: var(--type-body-md);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.cart-line__was {
  display: block;
  font-size: 11px;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  text-decoration: line-through;
  text-align: right;
}

.cart-line__remove {
  align-self: flex-start;
  font-size: var(--type-body-sm);
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-standard);
}

.cart-line__remove:hover {
  color: var(--error);
}

/* --- Quantity stepper --- */

.qty {
  display: inline-flex;
  align-items: center;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.qty__btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  transition: background-color var(--dur-fast) var(--ease-standard);
}

.qty__btn:hover {
  background: var(--bg-inset);
}

/* Spinners fight the stepper and shrink the hit area on touch. */
.qty__input {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: var(--type-body-sm);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty__input:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}

/* --- Shipping meter --- */

.cart-drawer__shipping {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-sunken);
  border-radius: var(--radius-sm);
}

.cart-drawer__shipping-text {
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.meter {
  position: relative;
  height: 3px;
  margin-top: var(--space-2);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
}

.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--gradient-gold-sheen);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-out-soft);
}

.meter__star {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: var(--radius-circle);
  background: var(--gold-decor);
  box-shadow: 0 0 0 3px var(--bg-sunken);
  transform: translateY(-50%);
  transition: left var(--dur-slow) var(--ease-out-soft);
}

.cart-drawer__totals {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-drawer__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: var(--type-body-lg);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-sunken);
  border-top: var(--border-width) solid var(--border);
  margin-top: var(--space-7);
  position: relative;
  overflow: hidden;
}

/* A faint constellation grid, so the footer reads as brand rather than as a
   grey block. Purely decorative and hidden from assistive tech in markup. */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, var(--star-dim) 0, transparent 100%),
    radial-gradient(1px 1px at 28% 62%, var(--star-dim) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 47% 30%, var(--star-dim) 0, transparent 100%),
    radial-gradient(1px 1px at 63% 78%, var(--star-dim) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 81% 22%, var(--star-dim) 0, transparent 100%),
    radial-gradient(1px 1px at 92% 58%, var(--star-dim) 0, transparent 100%);
  opacity: 0.9;
}

.site-footer > * {
  position: relative;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
}

@media (min-width: 768px) {
  .footer-main {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .footer-main {
    grid-template-columns: 1.6fr repeat(4, 1fr);
  }
}

.footer-brand__wordmark {
  margin-bottom: var(--space-3);
}

.footer-brand__copy {
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
  max-width: 34ch;
}

.footer-col__title {
  font-family: var(--font-body);
  font-size: var(--type-label-apothecary);
  font-weight: var(--type-label-apothecary-weight);
  letter-spacing: var(--type-label-apothecary-ls);
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: var(--space-3);
}

.footer-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.footer-col__list li {
  margin: 0;
}

.footer-col__list a,
.footer-col__list span {
  display: inline-block;
  padding: 5px 0;
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}

.footer-col__list a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* --- Safety contact — deliberately prominent, not a small print line --- */

.footer-safety {
  padding: var(--space-3);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
}

.footer-safety p {
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.footer-safety a {
  font-weight: var(--weight-semibold);
  color: var(--text);
}

/* --- Trust strip --- */

.footer-trust {
  border-top: var(--border-width) solid var(--hairline);
  padding-block: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.footer-trust__label {
  font-family: var(--font-body);
  font-size: var(--type-label-apothecary);
  font-weight: var(--type-label-apothecary-weight);
  letter-spacing: var(--type-label-apothecary-ls);
  text-transform: uppercase;
  color: var(--text-muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}

.badges li {
  margin: 0;
}

.badge-cert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.badge-cert svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* --- Bottom bar --- */

.footer-bottom {
  border-top: var(--border-width) solid var(--hairline);
  padding-block: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-bottom__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-bottom a:hover {
  color: var(--text);
}

.footer-social {
  display: flex;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-circle);
  border: var(--border-width) solid var(--border);
  color: var(--text-muted);
  transition:
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.footer-social a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.footer-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   COOKIE BANNER
   The three headline actions carry equal visual weight. Equal width, equal
   height, equal type treatment; only the accent colour differs, and even that
   is a 1px border rather than a filled block. This is the requirement from
   the brief and it is also what ICO guidance calls valid consent.
   -------------------------------------------------------------------------- */

.cookie-banner {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: var(--z-cookie-banner);
  background: var(--bg-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-4);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-out-soft);
}

.cookie-banner.is-open {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .cookie-banner {
    left: auto;
    right: var(--space-4);
    bottom: var(--space-4);
    width: min(520px, calc(100vw - 2 * var(--space-4)));
  }
}

.cookie-banner__inner {
  padding: var(--space-4);
}

.cookie-banner__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.cookie-banner__glyph {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: var(--gold-decor);
}

.cookie-banner__title {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: 1.25;
}

.cookie-banner__copy {
  margin-top: var(--space-2);
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
}

.cookie-banner__copy a {
  color: var(--link);
}

/* --- The equal-weight action row --- */

.cookie-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

@media (min-width: 480px) {
  .cookie-actions {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height-md);
  padding: var(--space-2) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-align: center;
  color: var(--text);
  background: transparent;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.cookie-btn:hover {
  background: var(--bg-inset);
  border-color: var(--gold-decor);
}

.cookie-btn:focus-visible {
  outline-offset: 2px;
}

/* The only difference between the three is the accent on the border. Nothing
   is filled, so no action looks like "the right answer". */
.cookie-btn--accept {
  border-color: var(--gold-decor);
}

/* --- Customise panel --- */

.consent-panel {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border-width) solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.consent-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.consent-toggle__label {
  font-family: var(--font-body);
  font-size: var(--type-label-md);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  display: block;
}

.consent-toggle__desc {
  margin-top: 3px;
  font-size: var(--type-body-sm);
  line-height: 1.45;
  color: var(--text-muted);
}

/* A switch, built on a checkbox so it works without JavaScript tricks and is
   announced as a checkbox rather than an unlabelled button. */
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin-top: 2px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-inset);
  border: var(--border-width) solid var(--border-strong);
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-circle);
  background: var(--text-muted);
  transform: translateY(-50%);
  transition:
    transform var(--dur-fast) var(--ease-out-soft),
    background-color var(--dur-fast) var(--ease-standard);
}

.switch input:checked + .switch__track {
  background: var(--primary-container);
  border-color: var(--primary-container);
}

.switch input:checked + .switch__track::after {
  transform: translate(18px, -50%);
  background: var(--secondary-fixed);
}

.switch input:focus-visible + .switch__track {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.switch input[disabled] + .switch__track {
  opacity: 0.6;
  cursor: not-allowed;
}

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

/* --------------------------------------------------------------------------
   PLACEHOLDER CARD — Image honesty policy, Rule B

   Used wherever a real photograph is required and does not exist yet. It is
   deliberately handsome: a placeholder that looks like an error encourages
   someone to drop a stock image in just to make it go away. A warm bordered
   plate with an abstract silhouette and explicit copy does the opposite.
   -------------------------------------------------------------------------- */

.placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 320px;
  padding: var(--space-5) var(--space-4);
  text-align: center;
  border: var(--border-width) solid var(--gold-rim);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 70% at 50% 0%, var(--glow) 0%, transparent 66%),
    var(--gradient-cosmic);
  color: var(--text);
}

.placeholder-card__silhouette {
  width: 160px;
  height: 160px;
  color: var(--gold-decor);
  opacity: 0.85;
}

.placeholder-card__title {
  font-family: var(--font-display);
  font-size: var(--type-headline-sm);
  line-height: var(--type-headline-sm-lh);
  max-width: 26ch;
}

.placeholder-card__copy {
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
  max-width: 44ch;
}

.placeholder-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: var(--border-width) dashed var(--border-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Demo scaffold for index.html only
   Deleted in Phase 3 when the real home page replaces the stub.
   -------------------------------------------------------------------------- */

.demo-section {
  padding-block: var(--space-6);
  border-bottom: var(--border-width) solid var(--hairline);
}

.demo-note {
  font-size: var(--type-body-sm);
  line-height: var(--type-body-sm-lh);
  color: var(--text-muted);
  max-width: var(--measure);
}

.demo-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: var(--space-4);
}

.demo-plate {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-width) solid var(--hairline);
  background:
    radial-gradient(90% 80% at 50% 20%, var(--glow) 0%, transparent 68%),
    var(--gradient-cosmic);
}

/* Rule D in practice: the source is 512px, so the rendered box never exceeds
   it, and the glow behind it makes the small plate look framed rather than
   stretched. Swap in a 1600px photograph and raise --plate-cap. */
.demo-plate {
  --plate-cap: 512px;
}

.demo-plate img {
  display: block;
  width: 100%;
  max-width: var(--plate-cap);
  height: auto;
  margin-inline: auto;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

.demo-plate__label {
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  border-top: var(--border-width) solid var(--hairline);
}

.prose-note {
  max-width: var(--measure);
  font-size: var(--type-body-md);
  line-height: var(--type-body-md-lh);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Reduced motion — the drawer and banner become instant rather than sliding.
   Tokens already collapse durations; these catch the transforms themselves.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .cart-drawer__panel,
  .mobile-nav__panel,
  .cookie-banner,
  .search-panel__box,
  .mega {
    transform: none !important;
  }
}


/* --------------------------------------------------------------------------
 Product card — shared by the home page's featured row and the shop grid.
 Moved here from home.css in Phase 4 so /shop/ gets it without loading the
 home page's stylesheet.
 -------------------------------------------------------------------------- */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-container-lowest);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}

@media (prefers-reduced-motion: no-preference) {
  .product-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-rim);
    box-shadow: var(--elev-2);
  }
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-container);
}

/* Rule D again: the media box is fixed by aspect-ratio, the image fills it
   with object-fit and is never asked to render wider than 512px of source. */
.product-card__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: var(--card-cap);
  margin-inline: auto;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .product-card:hover .product-card__img { transform: scale(1.03); }
}

.product-card__flag {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--gold-rim);
  background: var(--surface-container-lowest);
  color: var(--gold-text);
  font-size: 10px;
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: var(--space-2);
  padding: var(--space-4);
}

.product-card__eyebrow {
  color: var(--on-surface-variant);
  font-size: var(--type-label-apothecary, 11px);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-headline-sm, 1.375rem);
  line-height: 1.3;
  color: var(--on-surface);
}

.product-card__title a {
  color: inherit;
  text-decoration: none;
}

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

.product-card__size {
  color: var(--on-surface-variant);
  font-size: var(--type-body-sm, 13px);
}

.product-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
}

.product-card__price {
  font-family: var(--font-body);
  font-size: var(--type-body-lg, 18px);
  font-weight: var(--weight-semibold, 600);
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
}

/* The "≈" marker cart.js uses when a price was converted. Kept visually
   quieter so it never reads as a sale badge. */
.product-card__price-note {
  display: block;
  color: var(--on-surface-variant);
  font-size: 11px;
  font-weight: var(--weight-regular, 400);
  letter-spacing: 0.02em;
}


/* --------------------------------------------------------------------------
 Collection states — shared by the home featured row and the shop grid.
 A grid marked data-state="loading" shows three skeleton cards; the status
 paragraph below it carries the empty or error sentence, so nothing is ever
 swallowed by a silently blank list.
 -------------------------------------------------------------------------- */
.collection-status {
  margin: var(--space-5) 0 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: var(--type-body-md, 16px);
  line-height: 1.6;
}

.collection-status:empty {
  display: none;
}

[data-state="loading"] > li,
.skeleton-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  min-height: 320px;
}

[data-state="loading"] > li::after,
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in srgb, var(--surface-container-high) 70%, transparent) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: jotl-shimmer 1.4s ease-in-out infinite;
}

@keyframes jotl-shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-state="loading"] > li::after,
  .skeleton-card::after {
    animation: none;
  }
}
