/* ============================================================
   SITE HEADER (header + mobile sheet)
   Tokens are scoped to .site-chrome so they never leak into each
   page's own palette; only the chrome (header/footer) uses them.
   ============================================================ */

.site-chrome {
  --ink: #3d7d82;
  --ink-2: #346b6f;
  --ink-line: #67acb1;
  --on-ink: #ffffff;
  --on-ink-2: #ffffff;
  --taupe: #baaa9e;
  --taupe-2: #a8998e;
  --ink-text: #326b6f;
  --logo: #2a6b72;
  --heading: #837466;
  --field: #3d7d82;
  --field-2: #346b6f;
  --on-field: #ffffff;
  --on-field-2: #ffffff;
  --field-line: #67acb1;
  --white: #ffffff;
  --paper: #f1edea;
  --text: #1c1a17;
  --text-2: #6e6258;
  --line: #ddd3cb;
  --font-sans: "Figtree", "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Inconsolata", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Browsers give <body> an 8px default margin. Only auth.css and
   error-pages.css reset it, so every other page showed white strips around
   full-bleed sections and below the footer. This file loads on every page. */
body {
  margin: 0;
  background: #f1edea;
}

/* The header/footer are shared across every page, including ones that never
   declare a global box-sizing reset themselves — without this, min-width/
   width + padding combine under content-box and inflate elements like
   .cart-badge and .btn well past their intended size. */
.site-chrome,
.site-chrome *,
.site-chrome *::before,
.site-chrome *::after {
  box-sizing: border-box;
}

/* The header stays fixed on every page: every other page's own CSS already
   reserves top padding assuming a fixed header (see products/pdp.css,
   checkout/checkout.css, profile/profile.css, legal/legal.css, etc.) — making
   this `sticky` would double that gap. Only the home page's hero is designed
   to sit behind it (see css/home/layout.css .hero). */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  height: 72px;
}

.header__in {
  max-width: 1360px;
  margin: 0 auto;
  height: 72px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.header .nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header .nav a {
  color: var(--text);
  text-decoration: none;
  font: 500 1.0625rem/1.2 var(--font-sans);
  padding: 8px 0;
  position: relative;
}

.header .nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.header .nav a:hover::after {
  transform: scaleX(1);
}

.logo {
  display: inline-flex;
  color: var(--logo);
}

.logo__mark {
  display: block;
  height: 26px;
  width: auto;
}

.header .logo {
  justify-self: center;
  /* Taller tap area without moving the wordmark. */
  padding: 10px 4px;
}

.mobile-nav .logo__mark {
  height: 20px;
}

.header__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

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

/* Signed-in marker: a small sky-blue tick badge overlapping the account icon's corner. */
.icon-btn .icon-btn__tick {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  padding: 2px;
  border-radius: 50%;
  background: #e6eeef;
  color: var(--ink-text);
  stroke: var(--ink);
  stroke-width: 2;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--taupe);
  color: var(--text);
  font: 700 0.6875rem/18px var(--font-sans);
  text-align: center;
}

.menu-btn {
  display: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font: 700 0.75rem/1.2 var(--font-sans);
  letter-spacing: 0.03em;
}

.lang-opt[href] {
  text-decoration: none;
}

.lang-opt[href]:hover {
  color: var(--text);
}

.lang-opt--unavailable {
  opacity: 0.4;
}

/* Inactive language is dimmed by colour, not opacity, so it still clears AA (4.9:1 on paper). */
.lang-opt {
  color: #6e6258;
  transition: color 0.2s;
}

.lang-opt.active {
  opacity: 1;
  color: var(--ink-text);
  font-weight: 500;
}

.lang-divider {
  opacity: 0.3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 12px 22px;
  border-radius: 0;
  border: 1px solid transparent;
  font: 500 0.875rem/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.btn:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

/* ---------- Overlay variant (full-bleed hero behind a transparent header) ---------- */

.header--overlay {
  background: transparent;
  border-bottom-color: transparent;
}

.header--overlay .nav a,
.header--overlay .logo,
.header--overlay .lang-switch,
.header--overlay .icon-btn {
  color: var(--on-ink);
}

.header--overlay .icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.header--overlay .lang-opt {
  color: rgba(255, 255, 255, 0.78);
}

.header--overlay .lang-opt.active {
  color: var(--on-ink);
}

.header--overlay.header--scrolled {
  background: var(--paper);
  border-bottom-color: var(--line);
}

.header--overlay.header--scrolled .logo {
  color: var(--logo);
}

.header--overlay.header--scrolled .nav a,
.header--overlay.header--scrolled .lang-switch,
.header--overlay.header--scrolled .icon-btn {
  color: var(--text);
}

.header--overlay.header--scrolled .icon-btn:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.header--overlay.header--scrolled .lang-opt {
  color: #6e6258;
}

.header--overlay.header--scrolled .lang-opt.active {
  color: var(--ink-text);
}

/* Brand focus ring for the shared chrome, which sits outside .site-shell. */
.site-chrome :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--taupe);
}

.footer.site-chrome :focus-visible {
  outline-color: var(--on-field);
  box-shadow: none;
}

/* The footer's hidden labels sit outside .site-shell, so the chrome needs its own copy. */
.site-chrome .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mobile sheet ---------- */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

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

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  height: 72px;
  border-bottom: 1px solid var(--line);
}

.mobile-nav__link {
  display: block;
  padding: 22px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font: 600 1.75rem/1.2 var(--font-sans);
}

/* The header's EN/BG switch is hidden on phones, so the sheet carries one. */
.mobile-nav .lang-switch {
  display: inline-flex;
  height: 56px;
  margin: 12px clamp(20px, 4vw, 56px);
  padding: 0;
  font-size: 1rem;
}

@media (max-width: 820px) {
  .header__in {
    grid-template-columns: auto 1fr auto;
  }

  .header .nav {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .header {
    height: 60px;
  }

  .header__in {
    height: 60px;
  }

  .header .logo__mark {
    height: 20px;
  }

  .lang-switch {
    display: none;
  }
}
