/* ============================================================================
   WATAN DELIGHTS — DESIGN SYSTEM
   ----------------------------------------------------------------------------
   Warm, light, food-first. The photography supplies the colour; the interface
   stays quiet around it. Rose is an accent, never the subject.

   Contrast (all verified against Warm Ivory #F7F3ED):
     Deep Espresso  15.8:1 on ivory · body text, headings, primary buttons
     Warm Gray       4.7:1 on ivory · secondary text — passes AA at any size
     Deep Rose       4.6:1 on ivory · links and accent text — passes AA
     Chai Rose       2.5:1 on ivory · DECORATIVE ONLY. Never put text on it and
                                      never use it as a text colour.

   Sections:
     1. Tokens          6. Header & nav        11. Cart
     2. Reset           7. Hero                12. Forms & checkout
     3. Typography      8. Product cards       13. Footer
     4. Layout          9. Sections            14. Utilities
     5. Buttons        10. Event / catering    15. Motion & print
============================================================================ */

/* ===========================================================================
   1. TOKENS
   ======================================================================== */
:root {
  /* Palette */
  --ivory:        #F7F3ED;
  --white-soft:   #FFFDFC;
  --espresso:     #28211D;
  --gray-warm:    #756B63;
  --rose:         #C98D95;
  --rose-deep:    #8F6268;
  --sand:         #E6DDD4;

  /* Roles */
  --bg:           var(--ivory);
  --surface:      var(--white-soft);
  --surface-alt:  #FBF8F4;
  --text:         var(--espresso);
  --text-muted:   var(--gray-warm);
  --text-invert:  var(--white-soft);
  --accent:       var(--rose-deep);   /* text + interactive accent (AA) */
  --accent-soft:  var(--rose);        /* fills, dots, decoration only */
  --accent-wash:  #F5E9EA;            /* tinted background for accent chips */
  --border:       var(--sand);
  --border-strong:#D6C9BC;

  /* Feedback */
  --danger:       #A03A3A;
  --danger-wash:  #F9EBEA;
  --success:      #3F6B4F;
  --success-wash: #E9F1EA;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia,
               'Times New Roman', serif;

  /* Fluid type scale */
  --fs-xs:   0.75rem;                             /* 12 */
  --fs-sm:   0.8125rem;                           /* 13 */
  --fs-base: 0.9375rem;                           /* 15 */
  --fs-md:   1rem;                                /* 16 */
  --fs-lg:   clamp(1.0625rem, 0.4vw + 0.97rem, 1.1875rem);
  --fs-xl:   clamp(1.375rem, 1vw + 1.15rem, 1.75rem);
  --fs-2xl:  clamp(1.75rem, 2vw + 1.3rem, 2.5rem);
  --fs-3xl:  clamp(2.25rem, 4.5vw + 1.1rem, 4rem);

  /* Spacing */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  /* Vertical rhythm between page sections — generous on purpose. */
  --sp-section: clamp(3.5rem, 7vw, 7rem);

  /* Shape */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Depth — soft and warm, never a grey drop shadow */
  --shadow-sm: 0 1px 2px rgba(40, 33, 29, 0.05);
  --shadow:    0 2px 8px rgba(40, 33, 29, 0.06);
  --shadow-md: 0 8px 24px rgba(40, 33, 29, 0.08);
  --shadow-lg: 0 18px 48px rgba(40, 33, 29, 0.12);

  /* Structure */
  --container: 1180px;
  --container-narrow: 760px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --tap: 44px;  /* minimum touch target */
}

/* ===========================================================================
   2. RESET
   ======================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;  /* stop iOS enlarging text on rotate */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  /* Set on html directly rather than relying on the body-to-viewport overflow
     propagation quirk — off-canvas fixed elements (.cart-drawer, .nav-links)
     sit translated past the right edge even when "closed", and fixed-position
     boxes aren't clipped by an ancestor's overflow unless that ancestor is the
     actual scroll root. Belt-and-braces: both html and body are hidden here. */
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Locked while a modal or the cart drawer is open. */
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--espresso); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

/* One consistent, high-contrast focus ring everywhere. Mouse users don't see
   it; keyboard users always do. */
:focus-visible {
  outline: 2px solid var(--espresso);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--accent-wash); color: var(--espresso); }

/* ===========================================================================
   3. TYPOGRAPHY
   ======================================================================== */
.display, h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--espresso);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }

h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Small caps label above a section heading. */
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.lede {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 56ch;
  text-wrap: pretty;
}

.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-sm     { font-size: var(--fs-sm); }

/* The traditional Afghan name, shown under the English one. Always present,
   never louder than the name that tells you what the food is. */
.name-traditional {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-base);
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ===========================================================================
   4. LAYOUT
   ======================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-section); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section-alt { background: var(--surface-alt); }

.section-head { margin-bottom: var(--sp-6); }
.section-head .lede { margin-top: var(--sp-3); }

/* Heading on the left, a "see all" link on the right; stacks on mobile. */
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* ===========================================================================
   5. BUTTONS
   ======================================================================== */
.btn {
  --btn-bg: var(--espresso);
  --btn-fg: var(--text-invert);
  --btn-border: var(--espresso);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0.75rem 1.5rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease),
              border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary:hover { --btn-bg: #3a302a; --btn-border: #3a302a; }

/* Outline on ivory — used for the secondary hero action. */
.btn-secondary {
  --btn-bg: transparent;
  --btn-fg: var(--espresso);
  --btn-border: var(--border-strong);
}
.btn-secondary:hover { --btn-bg: var(--surface); --btn-border: var(--espresso); }

/* The one place the rose becomes a filled surface. White on Deep Rose is
   5.1:1, so it stays readable. */
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-border: var(--accent); }
.btn-accent:hover { --btn-bg: #7d545a; --btn-border: #7d545a; }

/* On top of a photo. */
.btn-light { --btn-bg: var(--white-soft); --btn-fg: var(--espresso); --btn-border: var(--white-soft); }
.btn-light:hover { --btn-bg: #fff; }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-muted);
  --btn-border: transparent;
  text-transform: none;
  letter-spacing: 0;
}
.btn-ghost:hover { --btn-fg: var(--espresso); }

.btn-sm { min-height: 38px; padding: 0.45rem 1rem; font-size: var(--fs-xs); }
.btn-lg { min-height: 52px; padding: 0.9rem 2rem; font-size: var(--fs-base); }
.btn-block { display: flex; width: 100%; }

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

/* Busy state during checkout — the label is swapped in JS, this dims it. */
.btn.is-loading { pointer-events: none; opacity: 0.7; }

/* ===========================================================================
   6. HEADER & NAV
   ======================================================================== */

/* Thin announcement strip above everything. */
.announce {
  background: var(--espresso);
  color: var(--text-invert);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.5rem var(--sp-4);
}
.announce a { color: inherit; text-decoration: underline; }
.announce a:hover { color: var(--accent-soft); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 237, 0.88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
/* JS adds .is-stuck once the page scrolls, so the header only draws a rule
   when there's content behind it. */
.site-header.is-stuck { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  text-decoration: none;
  color: var(--espresso);
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand:hover { color: var(--espresso); }
/* WATAN leads, DELIGHTS follows quieter and smaller. */
.brand-primary { font-weight: 600; }
.brand-secondary {
  font-family: var(--font-sans);
  font-size: 0.6em;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav { display: flex; align-items: center; gap: var(--sp-5); margin-left: auto; }

.nav-links { display: flex; align-items: center; gap: var(--sp-5); list-style: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { color: var(--accent); }
.nav-link[aria-current='page'] {
  color: var(--espresso);
  box-shadow: inset 0 -2px 0 var(--accent-soft);
}

.header-actions { display: flex; align-items: center; gap: var(--sp-2); }

/* Cart button with a live item-count bubble. */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.cart-btn:hover { border-color: var(--espresso); }
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-btn[data-count='0'] .cart-count { display: none; }

/* Hamburger — hidden on desktop, shown under 860px. */
.nav-toggle {
  display: none;
  width: var(--tap);
  height: var(--tap);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}

/* ===========================================================================
   7. HERO
   ======================================================================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(3rem, 7vw, 6rem);
}

.hero-copy { max-width: 34rem; }
.hero h1 { margin-bottom: var(--sp-4); }
.hero .lede { margin-bottom: var(--sp-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* The origin line: present, quiet, never the headline. */
.hero-origin {
  margin-top: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* Small floating card over the photo (e.g. the Google rating). */
.hero-badge {
  position: absolute;
  left: var(--sp-4);
  bottom: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5rem 0.875rem;
  background: rgba(255, 253, 252, 0.94);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.hero-stars { color: var(--accent); letter-spacing: 0.08em; }

/* ===========================================================================
   8. PRODUCT CARDS
   ======================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
/* Homepage "a few featured products" — never more than one row on desktop. */
.product-grid-featured {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
/* Keyboard equivalent of the hover lift. */
.product-card:focus-within {
  border-color: var(--espresso);
  box-shadow: var(--shadow-md);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--sand);
  overflow: hidden;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.product-card:hover .product-media img { transform: scale(1.03); }

/* Fallback tile when a product has no photograph yet. */
.product-media-empty {
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: linear-gradient(160deg, var(--sand), var(--surface-alt));
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  flex: 1;
}

.product-name { font-size: var(--fs-md); font-weight: 600; line-height: 1.25; }
/* Whole-card click target without nesting interactive elements. */
.product-name a { color: inherit; text-decoration: none; }
.product-name a::after { content: ''; position: absolute; inset: 0; }

.product-blurb {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.product-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.product-price-from { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; }

/* Add-to-cart sits above the card-wide link overlay. */
.product-foot .btn { position: relative; z-index: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--accent-wash);
  color: var(--accent);
}
.badge-float {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  background: rgba(255, 253, 252, 0.95);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.badge-soon { background: var(--sand); color: var(--text-muted); }

.product-card.is-soon { opacity: 0.85; }
.product-card.is-soon:hover { transform: none; box-shadow: none; }

/* Filter chips above the menu grid. */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed='true'] {
  background: var(--espresso);
  border-color: var(--espresso);
  color: var(--text-invert);
}

/* ===========================================================================
   9. SECTIONS
   ======================================================================== */

/* Short brand story — image beside text. */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.story-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--sand);
  box-shadow: var(--shadow-md);
}
.story-media img { width: 100%; height: 100%; object-fit: cover; }

/* Reviews */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--sp-5);
}
.review-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.review-stars { color: var(--accent); letter-spacing: 0.1em; font-size: var(--fs-sm); }
.review-text { font-size: var(--fs-base); line-height: 1.6; flex: 1; }
.review-author { font-size: var(--fs-sm); font-weight: 600; }
.review-meta { font-size: var(--fs-xs); color: var(--text-muted); }

/* FAQ accordion, built on <details> so it works without JavaScript. */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--tap);
  padding: var(--sp-4) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease);
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-answer { padding-bottom: var(--sp-4); color: var(--text-muted); max-width: 68ch; }

/* ===========================================================================
   10. EVENT & CATERING CALLOUTS
   ======================================================================== */
.callout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-5);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.callout-accent { background: var(--accent-wash); border-color: #EBD8DA; }
.callout h2, .callout h3 { margin-bottom: var(--sp-2); }
.callout p { color: var(--text-muted); max-width: 52ch; }

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
}
.event-meta-item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.event-meta-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Event chooser on the pop-up preorder page. */
.event-option {
  display: block;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.event-option:hover { border-color: var(--border-strong); }
.event-option:has(input:checked) {
  border-color: var(--espresso);
  box-shadow: 0 0 0 1px var(--espresso);
}
.event-option:has(input:focus-visible) { outline: 2px solid var(--espresso); outline-offset: 3px; }
.event-option input { position: absolute; opacity: 0; pointer-events: none; }

/* ===========================================================================
   11. CART
   ======================================================================== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  height: 100dvh;              /* dvh so iOS Safari's toolbar can't clip it */
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  visibility: hidden;
}
.cart-drawer.is-open { transform: translateX(0); visibility: visible; }

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(40, 33, 29, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}
.cart-backdrop.is-open { opacity: 1; visibility: visible; }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.cart-items { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-5); list-style: none; }
.cart-foot { padding: var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-alt); }

.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--sp-3);
  align-items: start;
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line-media {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--sand);
}
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.cart-line-variant { font-size: var(--fs-xs); color: var(--text-muted); }
.cart-line-price { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Quantity stepper — 44px targets so it's usable with a thumb. */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.qty button {
  width: var(--tap);
  height: 36px;
  display: grid;
  place-items: center;
  font-size: var(--fs-md);
  color: var(--text-muted);
}
.qty button:hover:not([disabled]) { background: var(--surface-alt); color: var(--text); }
.qty button[disabled] { opacity: 0.35; cursor: not-allowed; }
.qty output {
  min-width: 2.25rem;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cart-totals { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.cart-total-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.cart-total-row.is-grand {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-md);
  font-weight: 700;
}
.cart-total-row span:last-child { font-variant-numeric: tabular-nums; }

/* Sticky mobile cart bar. */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: none;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(40, 33, 29, 0.08);
}
.cart-bar.is-visible { display: flex; }

/* ===========================================================================
   12. FORMS & CHECKOUT
   ======================================================================== */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

.label { font-size: var(--fs-sm); font-weight: 600; }
.label .req { color: var(--accent); }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);  /* 16px — stops iOS Safari zooming on focus */
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23756B63' stroke-width='1.6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--espresso);
  box-shadow: 0 0 0 3px rgba(40, 33, 29, 0.1);
}
.input::placeholder, .textarea::placeholder { color: #A79C93; }

/* Invalid only once the field has been touched — set by JS on blur/submit,
   never on a field the customer hasn't reached yet. */
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] {
  border-color: var(--danger);
}
.input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px rgba(160, 58, 58, 0.14); }

.field-error {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--danger);
}
.field-error:empty { display: none; }

.alert {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
}
.alert-error   { background: var(--danger-wash);  color: var(--danger); }
.alert-success { background: var(--success-wash); color: var(--success); }
.alert-info    { background: var(--accent-wash);  color: var(--accent); }

/* Radio/checkbox rendered as a selectable panel. */
.option-list { display: grid; gap: var(--sp-3); }
.option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.option:hover { border-color: var(--border-strong); }
.option:has(input:checked) { border-color: var(--espresso); box-shadow: 0 0 0 1px var(--espresso); }
.option:has(input:focus-visible) { outline: 2px solid var(--espresso); outline-offset: 3px; }
.option input { margin-top: 0.3rem; accent-color: var(--espresso); width: 18px; height: 18px; }
.option-title { font-size: var(--fs-sm); font-weight: 600; }
.option-note { font-size: var(--fs-xs); color: var(--text-muted); }

/* Checkout: form on the left, sticky order summary on the right. */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.summary-panel {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--espresso);
  color: var(--text-invert);
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* Empty states — a real message, never a blank panel. */
.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2rem; opacity: 0.6; }

/* ===========================================================================
   13. FOOTER
   ======================================================================== */
.site-footer {
  margin-top: var(--sp-section);
  padding-block: var(--sp-7) var(--sp-5);
  background: var(--espresso);
  color: #CFC6BF;
  font-size: var(--fs-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(255, 253, 252, 0.12);
}
.site-footer .brand { color: var(--text-invert); }
.site-footer .brand-secondary { color: #A79C93; }
.footer-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-invert);
  margin-bottom: var(--sp-3);
}
.footer-list { list-style: none; display: grid; gap: var(--sp-2); }
.footer-list a, .site-footer a { color: #CFC6BF; text-decoration: none; }
.footer-list a:hover, .site-footer a:hover { color: var(--text-invert); text-decoration: underline; }
.footer-list li a { display: inline-flex; align-items: center; min-height: 32px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
  font-size: var(--fs-xs);
  color: #A79C93;
}

/* ===========================================================================
   14. UTILITIES
   ======================================================================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visible only when focused — first tab stop on every page. */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100%;
  z-index: 300;
  padding: 0.7rem 1.1rem;
  background: var(--espresso);
  color: var(--text-invert);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; color: var(--text-invert); }

.hidden, [hidden] { display: none !important; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.full { width: 100%; }

/* ===========================================================================
   15. RESPONSIVE
   ======================================================================== */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; aspect-ratio: 16 / 10; }
  .story { grid-template-columns: 1fr; }
  .story-media { aspect-ratio: 16 / 10; }
  .checkout-layout { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-4) var(--sp-5) var(--sp-6);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }
  .nav-links.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-link {
    min-height: 52px;
    font-size: var(--fs-md);
    border-bottom: 1px solid var(--border);
  }
  .nav-link[aria-current='page'] { box-shadow: none; color: var(--accent); }
}

/* Compact controls are fine under a mouse, but a thumb needs the full 44px.
   Keyed to the pointer rather than the width so a small laptop window keeps
   the denser layout. */
@media (pointer: coarse) {
  .btn-sm, .chip, .qty button { min-height: var(--tap); }
  .qty button { height: var(--tap); }
}

@media (max-width: 640px) {
  :root { --sp-section: clamp(2.75rem, 9vw, 3.75rem); }
  .container { padding-inline: var(--sp-4); }
  .callout { grid-template-columns: 1fr; }
  .callout .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero-actions .btn { flex: 1 1 100%; }
  /* Room for the sticky cart bar. */
  body.has-cart-bar { padding-bottom: 5.5rem; }
}

/* Two products per row on small phones reads better than one giant card. */
@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .product-body { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
  .product-name { font-size: var(--fs-sm); }
  .product-blurb { display: none; }
  .product-foot { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
}

/* ===========================================================================
   16. MOTION & PRINT
   ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .announce, .cart-bar, .cart-drawer, .cart-backdrop, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .site-footer { background: none; color: #000; }
}
