/* ==========================================================================
   MOROMOKEH ESSENTIAL STORE — Design System
   Built from the brand mark: black, white and warm ivory, nothing else
   chromatic except a single muted, functional sale/error red. Editorial
   Didone display type against a clean geometric sans. Sharp/near-sharp
   corners, shadow used only as a rare, soft cue for real elevation
   (hover, floating panels) - never as flat-card decoration.

   Contents:
    1. Fonts              8. Buttons          15. Product page
    2. Design tokens       9. Forms            16. Cart
    3. Reset              10. Hero             17. Checkout
    4. Base typography    11. Sections         18. Footer
    5. Layout/container   12. Categories       19. Utilities
    6. Header             13. Product grid     20. Responsive
    7. Navigation         14. Product card
   ========================================================================== */

/* ---------- 1. Fonts ---------- */
/* Loaded via <link> in base.html (Bodoni Moda + Manrope) so the request
   starts in <head> rather than being discovered mid-stylesheet. */

/* ---------- 2. Design tokens ---------- */
:root {
  /* The mark is black on white - everything else is built around that. */
  --ink: #131110;
  --ink-soft: #4a4542;
  --ink-faint: #8c857c;

  --paper: #ffffff;
  --ivory: #faf8f5;
  --tint: #f1ede6;

  --line: #e6e1d8;
  --line-strong: #d2c9ba;

  /* Functional only - never decorative. */
  --sale: #a13b2e;
  --sale-tint: #f7e9e6;
  --success: #2f6b45;
  --success-tint: #e7f0ea;
  --warn: #8a6a1f;
  --warn-tint: #f5edd9;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-pill: 999px;

  /* Depth stays soft and rare - a hint of lift, never an obvious drop shadow. */
  --shadow-xs: 0 1px 3px rgba(19, 17, 16, 0.05);
  --shadow-sm: 0 8px 24px rgba(19, 17, 16, 0.08);
  --shadow-md: 0 16px 40px rgba(19, 17, 16, 0.12);
  --lift: 0 16px 40px rgba(19, 17, 16, 0.18);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur: 0.28s;
  --dur-slow: 0.7s;

  --font-display: "Bodoni Moda", Georgia, serif;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1320px;
  --header-h: 64px;
  --bottom-nav-h: 60px;
}

/* ---------- 3. Reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(19,17,16,0.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- 4. Base typography ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
p { margin: 0; color: var(--ink-soft); }

.display-1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 5vw, 68px); line-height: 1.0; letter-spacing: -0.01em; }
.display-2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.005em; }
.display-3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; font-weight: 700;
  color: var(--ink-faint); margin-bottom: var(--space-3);
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; }
.eyebrow.on-dark { color: rgba(250,248,245,0.6); }

.lead { font-size: 16.5px; color: var(--ink-soft); max-width: 44ch; }

.page-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 38px); margin: var(--space-7) 0 var(--space-2); }
.listing-head .page-title, .order-summary-card .page-title, .page-narrow .page-title { margin-top: 0; }

/* ---------- 5. Layout / container ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--space-8) 0; }
.section-tight { padding: var(--space-6) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); }
.section-head .view-all { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; transition: opacity var(--dur) var(--ease); }
.section-head .view-all:hover { opacity: 0.6; }

/* Visible by default so content never depends on JS running. main.js adds
   .js-ready to <html> only once it has actually executed, and that's the
   only thing allowed to opt an element into the hidden/animated state. */
.reveal { opacity: 1; transform: none; }
.js-ready .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.js-ready .reveal.is-visible { opacity: 1; transform: none; }

.empty-state { padding: var(--space-9) var(--space-4); text-align: center; color: var(--ink-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-state p { margin: 0 auto; max-width: 42ch; }

/* ---------- 6. Header ---------- */
/* z-index 47: the header is a positioned stacking context, so .main-nav and
   .search-overlay nested inside it (z-index 45/46) only win comparisons
   *inside* that context - against the body-level .scrim (z-index 44) it's
   actually the header's own z-index that gets compared. It has to clear 44
   or the scrim washes out both panels despite their higher local numbers. */
.site-header { position: sticky; top: 0; z-index: 47; background: var(--paper); border-bottom: 1px solid transparent; box-shadow: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.site-header.is-scrolled { border-color: var(--line); box-shadow: var(--shadow-xs); }
.header-inner { display: flex; align-items: center; gap: var(--space-5); height: var(--header-h); }

.brand-lockup { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-lockup img { width: 34px; height: 34px; flex-shrink: 0; }
.wordmark { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.wordmark span { display: block; font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }

/* ---------- 7. Navigation ---------- */
.main-nav { display: flex; gap: var(--space-6); flex: 1; }
.main-nav a { position: relative; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; padding: 4px 0; }
.main-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px; background: var(--ink); transition: right var(--dur) var(--ease); }
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: var(--space-1); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); transition: background-color var(--dur) var(--ease); }
.icon-btn:hover { background: var(--tint); }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink); transition: background-color var(--dur) var(--ease); }
.cart-link:hover { background: var(--tint); }
.cart-count { position: absolute; top: -4px; right: -4px; background: var(--ink); color: var(--paper); font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.cart-count.pulse { animation: cartCountPulse 0.5s var(--ease); }
@keyframes cartCountPulse { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

.header-search { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); overflow: hidden; transition: border-color var(--dur) var(--ease); height: 38px; }
.header-search:focus-within { border-color: var(--ink); }
.header-search input { border: 0; padding: 0 4px 0 16px; width: 170px; background: transparent; font-size: 13.5px; height: 100%; }
.header-search input:focus { outline: none; }
.header-search input::placeholder { color: var(--ink-faint); }

.search-toggle { display: none; }
.search-overlay {
  position: fixed; top: var(--header-h); left: 0; right: 0; background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); z-index: 46; max-height: 0; overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.search-overlay.open { max-height: 96px; }
.search-overlay form { max-width: 640px; margin: 0 auto; padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-3); align-items: center; }
.search-overlay input { flex: 1; border: 0; border-bottom: 1.5px solid var(--line-strong); background: transparent; font-size: 16px; padding: var(--space-2) 2px; color: var(--ink); }
.search-overlay input:focus { outline: none; border-bottom-color: var(--ink); }
.search-overlay button { flex-shrink: 0; }

.cat-strip { display: flex; gap: var(--space-2); overflow-x: auto; white-space: nowrap; padding: 10px var(--space-5); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip a { flex-shrink: 0; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; }
.cat-strip a:hover { border-color: var(--ink); }
@media (min-width: 1025px) { .cat-strip { display: none; } }

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 38px; height: 38px; border: 0; background: transparent; flex-shrink: 0; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Shared dim backdrop for the mobile nav drawer and search overlay - sits
   below the header (which keeps its own close control legible and
   tappable) and below whichever panel is actually open. */
.scrim {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
  background: rgba(19, 17, 16, 0.36); z-index: 44;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.scrim.visible { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .search-toggle { display: inline-flex; }
  .main-nav {
    display: flex; flex-direction: column; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--paper); padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom)); gap: 0; z-index: 45; overflow-y: auto;
    box-shadow: var(--shadow-md);
    transform: translateX(-100%); transition: transform 0.4s var(--ease); visibility: hidden;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .main-nav a {
    padding: 15px 0; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 19px; font-weight: 500;
    opacity: 0; transform: translateX(-10px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .main-nav a::after { display: none; }
  /* A quiet stagger as the drawer opens - each link a beat behind the last. */
  .main-nav.open a { opacity: 1; transform: none; }
  .main-nav.open a:nth-child(1) { transition-delay: 0.05s; }
  .main-nav.open a:nth-child(2) { transition-delay: 0.09s; }
  .main-nav.open a:nth-child(3) { transition-delay: 0.13s; }
  .main-nav.open a:nth-child(4) { transition-delay: 0.17s; }
  .main-nav.open a:nth-child(5) { transition-delay: 0.21s; }
  .main-nav.open a:nth-child(6) { transition-delay: 0.25s; }
  .main-nav.open a:nth-child(7) { transition-delay: 0.29s; }
  .main-nav.open a:nth-child(8) { transition-delay: 0.33s; }
  .main-nav.open a:nth-child(n+9) { transition-delay: 0.36s; }
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 28px; height: 48px; border-radius: var(--radius-xs); border: 1px solid transparent;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn-light:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 11.5px; }
.btn-danger { background: transparent; border-color: var(--sale); color: var(--sale); }
.btn-danger:hover { background: var(--sale); color: #fff; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- 9. Forms ---------- */
.field { margin-bottom: var(--space-5); }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: var(--space-2); color: var(--ink); }
.hint { font-size: 12px; color: var(--ink-faint); }
.field .hint { margin-top: var(--space-1); }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=number], .field input[type=password], .field input[type=search],
.field select, .field textarea {
  width: 100%; height: 48px; padding: 0 var(--space-4); border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs); background: var(--paper); color: var(--ink); font-size: 14.5px;
  transition: border-color var(--dur) var(--ease);
}
.field textarea { height: auto; padding: var(--space-3) var(--space-4); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.checkbox-row { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; margin-bottom: var(--space-3); }
.checkbox-row input { width: 16px; height: 16px; }

.flash-stack { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.flash { padding: var(--space-3) var(--space-4); border-radius: var(--radius-xs); font-size: 14px; border: 1px solid; }
.flash-success { background: var(--success-tint); color: var(--success); border-color: #c7e0cd; }
.flash-error { background: var(--sale-tint); color: var(--sale); border-color: #edc9be; }

/* ---------- 10. Hero (product-led bento, no personal photography) ---------- */
.hero { background: var(--paper); }
.hero-bento {
  display: grid; gap: 3px;
  grid-template-columns: 1fr; grid-template-rows: auto;
  min-height: auto;
}
.hero-bento .tile { position: relative; overflow: hidden; background: var(--tint); }
.hero-bento .tile img { width: 100%; height: 100%; object-fit: cover; }
.js-ready .hero-bento .tile-img img { animation: heroImageReveal 1.1s var(--ease) both; }
@keyframes heroImageReveal { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.hero-bento .tile-text {
  background: var(--ink); color: var(--ivory);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-7) var(--space-5);
}
.hero-bento .tile-text h1 { font-family: var(--font-display); font-weight: 600; color: var(--ivory); font-size: clamp(30px, 4vw, 44px); line-height: 1.04; letter-spacing: -0.01em; margin-bottom: var(--space-4); }
.hero-bento .tile-text p.lead { color: rgba(250,248,245,0.72); max-width: 40ch; margin-bottom: var(--space-5); }
.hero-bento .tile-text .hero-ctas { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-bento .tile-text .btn-outline { border-color: var(--ivory); color: var(--ivory); }
.hero-bento .tile-text .btn-outline:hover { background: var(--ivory); color: var(--ink); }
.hero-bento .tile-text .btn-primary { background: var(--ivory); color: var(--ink); }
.hero-bento .tile-text .btn-primary:hover { background: var(--paper); }
.hero-bento .tile-img { aspect-ratio: 4/5; }
.hero-bento .badge-corner {
  position: absolute; bottom: var(--space-4); left: var(--space-4);
  display: flex; align-items: center; gap: 8px;
  background: rgba(250,248,245,0.94); color: var(--ink);
  padding: 8px 16px 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.hero-bento .badge-corner img { width: 20px; height: 20px; flex-shrink: 0; }
.hero-bento .placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--font-display); font-size: 15px; text-align: center; padding: var(--space-5); background: var(--tint); }

@media (min-width: 900px) {
  .hero-bento.count-3 {
    grid-template-columns: 1.15fr 0.85fr; grid-template-rows: 1fr 1fr;
    min-height: min(86vh, 780px);
  }
  .hero-bento.count-3 .tile-a { grid-column: 1; grid-row: 1 / 3; aspect-ratio: auto; }
  .hero-bento.count-3 .tile-text { grid-column: 2; grid-row: 1; padding: var(--space-6); }
  .hero-bento.count-3 .tile-b { grid-column: 2; grid-row: 2; aspect-ratio: auto; }

  .hero-bento.count-2 {
    grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr;
    min-height: min(78vh, 640px);
  }
  .hero-bento.count-2 .tile-a { grid-column: 1; aspect-ratio: auto; }
  .hero-bento.count-2 .tile-text { grid-column: 2; padding: var(--space-7); }

  .hero-bento.count-0 {
    grid-template-columns: 1fr; min-height: min(56vh, 460px);
  }
  .hero-bento.count-0 .tile-text { align-items: center; text-align: center; padding: var(--space-8); }
  .hero-bento.count-0 .tile-text p.lead { max-width: 48ch; margin-left: auto; margin-right: auto; }
  .hero-bento.count-0 .tile-text .hero-ctas { justify-content: center; }
}

/* ---------- 11. Sections (editorial + values + final CTA) ---------- */
.editorial { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; background: var(--tint); }
.editorial-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--line); }
.editorial-media img { width: 100%; height: 100%; object-fit: cover; }
.editorial-copy { display: flex; flex-direction: column; justify-content: center; padding: var(--space-8) clamp(24px, 6vw, 88px); }
.editorial-copy p.lead { margin: var(--space-4) 0 var(--space-6); }

.value-list { display: grid; grid-template-columns: repeat(4, 1fr); }
.value-item { padding: var(--space-6) var(--space-5) 0; border-top: 1px solid var(--line); }
.value-item svg { color: var(--ink); margin-bottom: var(--space-4); }
.value-item h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin-bottom: var(--space-2); }
.value-item p { font-size: 13.5px; }

.final-cta { background: var(--ink); color: var(--ivory); text-align: center; padding: var(--space-9) 0; }
.final-cta .eyebrow { color: rgba(250,248,245,0.55); justify-content: center; }
.final-cta h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 40px); color: var(--ivory); margin-bottom: var(--space-3); }
.final-cta p { color: rgba(250,248,245,0.68); max-width: 48ch; margin: 0 auto var(--space-6); }
.final-cta .btn-outline { border-color: var(--ivory); color: var(--ivory); }
.final-cta .btn-outline:hover { background: var(--ivory); color: var(--ink); }

/* ---------- 12. Categories ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.category-card { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--tint); display: block; border: 1px solid transparent; }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.category-card:hover img { transform: scale(1.035); }
.category-card .label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-4);
  background: linear-gradient(to top, rgba(19,17,16,0.75) 0%, rgba(19,17,16,0.12) 65%, transparent 100%);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.03em;
}
.category-card .label span { display: inline-block; margin-left: 6px; transition: margin-left var(--dur) var(--ease); }
.category-card:hover .label span { margin-left: 10px; }
.category-card--plain { background: var(--paper); border-color: var(--line); display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-4); transition: border-color var(--dur) var(--ease); }
.category-card--plain:hover { border-color: var(--ink); }
.category-card--plain span { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); }

/* ---------- 13. Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6) var(--space-4); align-items: start; }

/* ---------- listing / filters ---------- */
.listing-head { margin-bottom: var(--space-6); }
.listing-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 36px); }
.listing-head p { margin-top: var(--space-1); }
.listing-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-7); align-items: start; }
.filters { border-top: 2px solid var(--ink); padding-top: var(--space-4); position: sticky; top: calc(var(--header-h) + 24px); }
.filters h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin: var(--space-5) 0 var(--space-2); color: var(--ink-soft); }
.filters h4:first-child { margin-top: 0; }
.filters a, .filters label { display: block; font-size: 14px; color: var(--ink-soft); padding: 5px 0; transition: color var(--dur) var(--ease); }
.filters a.active, .filters a:hover { color: var(--ink); font-weight: 600; }
.sort-row { display: flex; justify-content: flex-end; margin-bottom: var(--space-5); }
.sort-row select { border: 1px solid var(--line-strong); border-radius: var(--radius-xs); padding: 8px 10px; background: var(--paper); font-size: 13px; }

.pagination { display: flex; justify-content: center; gap: var(--space-1); margin-top: var(--space-8); }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); font-size: 13px; transition: border-color var(--dur) var(--ease); }
.pagination a:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 14. Product card ---------- */
.product-card { position: relative; }
.product-card .thumb { position: relative; aspect-ratio: 4/5; background: var(--tint); overflow: hidden; margin-bottom: var(--space-3); transition: box-shadow var(--dur) var(--ease); }
.product-card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.product-card .thumb img.img-b { opacity: 0; }
@media (hover: hover) {
  .product-card:hover .thumb { box-shadow: var(--shadow-sm); }
  .product-card:hover .thumb img.img-a { transform: scale(1.03); }
  .product-card:hover .thumb img.img-b { opacity: 1; transform: scale(1.03); }
}
.badge { position: absolute; top: var(--space-2); left: var(--space-2); z-index: 2; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px; background: var(--ink); color: #fff; }
.badge-sale { background: var(--sale); }
.badge-out { position: absolute; inset: 0; z-index: 2; background: rgba(250,248,245,0.85); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
.quick-add-btn {
  position: absolute; right: var(--space-2); bottom: var(--space-2); z-index: 2; width: 36px; height: 36px;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.quick-add-btn:hover { background: var(--ink); color: var(--paper); }
.quick-add-btn button { all: unset; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: pointer; color: inherit; }
@media (hover: hover) { .product-card:hover .quick-add-btn, .product-card:focus-within .quick-add-btn { opacity: 1; transform: translateY(0); } }
@media (hover: none) { .quick-add-btn { opacity: 1; transform: none; } }
.product-card h3 { font-size: 13.5px; font-weight: 500; margin: 0 0 4px; color: var(--ink); }
.product-card .price { font-size: 14.5px; font-weight: 700; }
.price .compare { font-weight: 400; color: var(--ink-faint); text-decoration: line-through; margin-left: 6px; font-size: 12.5px; }
.price .save { font-weight: 700; color: var(--sale); font-size: 10.5px; margin-left: 6px; text-transform: uppercase; }
.stock-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; margin-top: 4px; color: var(--warn); }
.stock-tag .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--warn); flex-shrink: 0; }

/* ---------- 15. Product page ---------- */
.product-detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--space-8); padding: var(--space-7) 0; }
.gallery-main { aspect-ratio: 4/5; background: var(--tint); overflow: hidden; margin-bottom: var(--space-3); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--dur) var(--ease); }
.gallery-main img.is-swapping { opacity: 0; }
.gallery-thumbs { display: flex; gap: var(--space-2); }
.gallery-thumbs img { width: 64px; height: 80px; object-fit: cover; border: 1px solid transparent; cursor: pointer; opacity: 0.6; transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.gallery-thumbs img.active, .gallery-thumbs img:hover { opacity: 1; border-color: var(--ink); }
.pd-category { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 700; margin-bottom: var(--space-3); }
.pd-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3vw, 34px); margin-bottom: var(--space-3); line-height: 1.1; }
.pd-price { font-size: 22px; font-weight: 700; margin-bottom: var(--space-5); display: flex; align-items: center; gap: var(--space-2); }
.pd-price .badge { position: static; }
.pd-desc { font-size: 15px; margin-bottom: var(--space-6); line-height: 1.65; }
.option-group { margin-bottom: var(--space-5); }
.option-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-3); color: var(--ink-soft); }
.swatches { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.size-option { min-width: 44px; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; background: var(--paper); transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option.disabled { color: var(--ink-faint); text-decoration: line-through; background: var(--ivory); cursor: not-allowed; }
.size-option:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); }
.qty-stepper button { width: 42px; height: 46px; border: 0; background: transparent; font-size: 17px; transition: color var(--dur) var(--ease); }
.qty-stepper button:hover { color: var(--ink-soft); }
.qty-stepper input { width: 46px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 46px; background: transparent; }
.pd-actions { display: flex; gap: var(--space-3); margin: var(--space-6) 0; }
.pd-actions .btn { flex: 1; }
.stock-note { font-size: 13px; color: var(--success); font-weight: 600; }
.stock-note.low { color: var(--warn); }
.stock-note.out { color: var(--sale); }

/* ---------- 16. Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: var(--space-7); padding: var(--space-7) 0; align-items: start; }
.cart-line { display: grid; grid-template-columns: 90px 1fr auto; gap: var(--space-4); padding: var(--space-5) 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line:first-child { border-top: 1px solid var(--ink); }
.cart-line img { width: 90px; height: 112px; object-fit: cover; background: var(--tint); }
.cart-line-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.cart-line-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.cart-line-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.summary-box { background: var(--tint); padding: var(--space-6); }
.summary-box h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: var(--space-4); }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: var(--space-2); color: var(--ink-soft); }
.summary-row.total { font-size: 18px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line-strong); padding-top: var(--space-4); margin-top: var(--space-2); }
.empty-cart { text-align: center; padding: var(--space-10) var(--space-4); }

/* ---------- 17. Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 400px; gap: var(--space-7); padding: var(--space-7) 0; align-items: start; }
.checkout-panel { border: 1px solid var(--line); padding: var(--space-6); background: var(--paper); }
.checkout-panel h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: var(--space-5); }
.checkout-summary { background: var(--tint); padding: var(--space-6); }
.checkout-summary h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: var(--space-4); }
.checkout-item { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 13.5px; padding: var(--space-2) 0; border-bottom: 1px solid var(--line-strong); }
.checkout-item .name { color: var(--ink); }
.checkout-item .meta { color: var(--ink-faint); }
.checkout-trust { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--ink-soft); margin-top: var(--space-4); }
.checkout-trust svg { color: var(--success); flex-shrink: 0; }

/* ---------- order status ---------- */
.order-summary-card { border: 1px solid var(--line); padding: var(--space-7); max-width: 640px; margin: var(--space-8) auto; background: var(--paper); }
.status-pill { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 5px 12px; border-radius: var(--radius-pill); }
.status-paid { background: var(--success-tint); color: var(--success); }
.status-pending { background: var(--warn-tint); color: var(--warn); }
.status-failed, .status-cancelled { background: var(--sale-tint); color: var(--sale); }
.status-processing, .status-shipped { background: #e4ecf5; color: #2a4d7c; }
.status-completed { background: var(--success-tint); color: var(--success); }

.page-narrow { max-width: 720px; margin: 0 auto; padding: var(--space-8) var(--space-5); }

/* ---------- 18. Footer ---------- */
.site-footer { background: var(--ink); color: var(--ivory); margin-top: var(--space-8); }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--space-6); padding: var(--space-8) 0 var(--space-6); }
.footer-wordmark { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ivory); margin-bottom: var(--space-3); }
.footer-brand p { color: rgba(250,248,245,0.62); font-size: 13.5px; max-width: 38ch; }
.footer-col h3 { color: var(--ivory); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--space-4); font-weight: 700; }
.footer-col a, .footer-col span { display: block; color: rgba(250,248,245,0.66); font-size: 14px; margin-bottom: var(--space-3); transition: color var(--dur) var(--ease); }
.footer-col a:hover { color: var(--ivory); }
.footer-socials { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.footer-socials a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(250,248,245,0.25); display: flex; align-items: center; justify-content: center; color: var(--ivory); transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.footer-socials a:hover { background: rgba(250,248,245,0.12); border-color: rgba(250,248,245,0.5); }
.footer-bottom { border-top: 1px solid rgba(250,248,245,0.14); padding: var(--space-4) 0; font-size: 12px; color: rgba(250,248,245,0.48); }

/* ---------- 19. Utilities ---------- */
.text-center { text-align: center; }
.floating-whatsapp {
  position: fixed; right: 18px; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 35; width: 52px; height: 52px; border-radius: 50%;
  background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--lift); transition: transform var(--dur) var(--ease);
}
.floating-whatsapp:hover { transform: scale(1.06); }
@media (min-width: 769px) { .floating-whatsapp { right: 28px; bottom: 28px; } }

/* ---------- Bottom mobile nav (app-style tab bar) ---------- */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 43;
  background: rgba(255,255,255,0.98); border-top: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--bottom-nav-h); border: 0; background: transparent; color: var(--ink-faint);
  font-family: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  position: relative; transition: color var(--dur) var(--ease);
}
.bottom-nav-item.active { color: var(--ink); }
.bottom-nav-item .cart-count { position: absolute; top: 2px; left: 50%; right: auto; margin-left: 3px; }
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
}

/* ---------- admin (functional, inherits tokens; not part of the storefront redesign) ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; align-items: start; }
.admin-sidebar { background: var(--ink); color: var(--ivory); padding: var(--space-5) 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand { color: var(--ivory); font-weight: 700; padding: 0 var(--space-5) var(--space-5); font-size: 16px; }
.admin-sidebar a { display: block; padding: 11px var(--space-5); font-size: 14px; color: rgba(250,248,245,0.68); }
.admin-sidebar a:hover, .admin-sidebar a.active { color: var(--ivory); background: rgba(250,248,245,0.08); }
.admin-main { padding: var(--space-6); max-width: 1200px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-5); }
.admin-topbar h1 { font-size: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat-card { border: 1px solid var(--line); padding: var(--space-4); background: var(--paper); }
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: var(--space-1); }
.stat-card .value { font-size: 24px; font-weight: 700; }
table.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); }
table.admin-table th, table.admin-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
table.admin-table img { width: 40px; height: 50px; object-fit: cover; }
.admin-card { border: 1px solid var(--line); background: var(--paper); padding: var(--space-5); margin-bottom: var(--space-5); }
.pill { display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.image-manager { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.image-manager .img-slot { width: 88px; }
.image-manager .img-slot img { width: 88px; height: 108px; object-fit: cover; border: 1px solid var(--line); }
.image-manager label { font-size: 11px; display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.auth-card { background: var(--paper); padding: var(--space-7); width: 360px; }
.auth-card h1 { font-family: var(--font-display); font-size: 21px; text-align: center; margin-bottom: var(--space-5); }

/* ---------- 20. Responsive ---------- */
@media (max-width: 1240px) {
  .header-inner { gap: var(--space-3); }
  .main-nav { gap: var(--space-4); }
  .header-search input { width: 110px; }
}

@media (max-width: 1024px) {
  .product-grid, .category-grid { grid-template-columns: repeat(3, 1fr); }
  .listing-layout { grid-template-columns: 1fr; }
  .filters { position: static; border-top: 0; padding-top: 0; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .value-list { grid-template-columns: repeat(2, 1fr); }
  .editorial { grid-template-columns: 1fr; }
  .editorial-media { aspect-ratio: 16/9; }
  .hero-bento.count-3, .hero-bento.count-2 { grid-template-columns: 1fr; grid-template-rows: none; min-height: auto; }
  .hero-bento.count-3 .tile-a, .hero-bento.count-3 .tile-b, .hero-bento.count-2 .tile-a { grid-column: 1; grid-row: auto; aspect-ratio: 4/5; }
  .hero-bento .tile-text { order: -1; }
}

@media (max-width: 768px) {
  .header-search { display: none; }
  .header-inner { gap: var(--space-3); }
  .wordmark { font-size: 18px; }
  .brand-lockup img { width: 28px; height: 28px; }

  /* Touch targets: 44px is the practical minimum for a thumb, not 38px. */
  .icon-btn, .cart-link, .nav-toggle, .search-toggle { width: 44px; height: 44px; }
  .quick-add-btn { width: 42px; height: 42px; }
  .cat-strip a { padding: 9px 16px; font-size: 12.5px; }

  /* iOS Safari zooms the page on any input/select under 16px - kills the
     premium feel instantly. Force 16px on every form control on mobile. */
  .field input, .field select, .field textarea,
  .sort-row select, .qty-stepper input { font-size: 16px; }

  /* One strong hero image on mobile, not a stack of three - gets people to
     the products faster and reads as a deliberate choice, not a fallback. */
  .hero-bento .tile-b { display: none; }
  .hero-bento.count-3 .tile-a, .hero-bento.count-2 .tile-a { aspect-ratio: 4/4.6; max-height: 78vh; }
  .hero-bento .tile-text { padding: var(--space-6) var(--space-5); text-align: left; }
  .hero-bento .tile-text h1 { line-height: 1.08; }

  .product-grid, .category-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; overflow-x: auto; padding: var(--space-3) 0; position: static; height: auto; }
  .admin-sidebar .brand { display: none; }
  .admin-sidebar a { white-space: nowrap; padding: 10px var(--space-4); }
  .field-row { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .section { padding: var(--space-7) 0; }
}

@media (max-width: 480px) {
  .product-grid, .category-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .value-list { grid-template-columns: 1fr; }
  .value-item { padding-top: var(--space-5); }
  .hero-bento .tile-text h1 { font-size: 30px; }
  .section { padding: var(--space-6) 0; }
  .category-card .label { padding: var(--space-3); font-size: 12.5px; letter-spacing: 0.02em; }
  .category-card--plain span { font-size: 16px; }
  .pd-actions { flex-direction: column; }
  .cart-line { grid-template-columns: 68px 1fr; }
  .cart-line-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .editorial-copy { padding: var(--space-6) var(--space-5); }
}
