/* ==========================================================================
   Design tokens
   Subject: EDC + bags + leather goods -> a "field ledger" aesthetic:
   ink-navy + brass on warm paper, index-card product tiles, mono utility type.
   ========================================================================== */
:root {
  --paper: #efece2;
  --paper-raised: #f8f6ee;
  --ink: #20293b;
  --ink-soft: #4a5670;
  --ink-faint: #8791a6;
  --brass: #a97c34;
  --brass-dark: #8a6427;
  --brass-tint: #e9d5a8;
  --line: #d9d4c3;
  --sage: #5f7d5b;
  --rust: #a84a2c;
  --white: #fffdf8;
  --field: #fffdf8;              /* input / card-face surfaces */
  --on-brass: #ffffff;           /* text on the primary color (set by theme) */
  --accent-text: var(--brass-dark);
  --sage-text: var(--sage);
  --surface-dark: #20293b;       /* top bar, footer (set by theme) */
  --on-dark: #ffffff;
  --on-dark-soft: color-mix(in srgb, var(--on-dark) 75%, transparent);
  --on-dark-faint: color-mix(in srgb, var(--on-dark) 50%, transparent);
  --on-dark-line: color-mix(in srgb, var(--on-dark) 14%, transparent);
  color-scheme: light;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-title: "Nurkholis", var(--font-display);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius-s: 4px;
  --radius-m: 8px;
  --shadow-card: 0 1px 2px rgba(32,41,59,0.06), 0 6px 16px rgba(32,41,59,0.06);
  --shadow-pop: 0 12px 32px rgba(32,41,59,0.18);
  --container: 1240px;
  --gutter: 24px;
  --tabbar-h: 0px;
}

/* ------------------------------------------------------------ dark mode --- */
:root[data-theme="dark"] {
  --paper: #12161f; --paper-raised: #1a2030; --field: #0f131b;
  --ink: #ebe8de; --ink-soft: #b9c0ce; --ink-faint: #7f8aa0; --line: #2b3345;
  --brass-tint: color-mix(in srgb, var(--brass) 55%, white);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 6px 16px rgba(0,0,0,0.3);
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.55);
  color-scheme: dark;
}
:root[data-theme="dark"] .card-product .fav-btn { background: color-mix(in srgb, var(--paper-raised) 90%, transparent); }
:root[data-theme="dark"] .cat-tile img { opacity: 0.5; }
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }

@font-face {
  font-family: "Nurkholis";
  src: url("/assets/fonts/Nurkholis.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* Pushes the footer to the bottom of the viewport on short pages (404, empty states, etc.)
   instead of it floating right under sparse content. */
#main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.wrap { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-s); border: 1px solid transparent;
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0.01em; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brass); color: var(--on-brass); }
.btn-primary:hover { background: var(--brass-dark); }
.btn-brass { background: var(--brass); color: var(--on-brass); }
.btn-brass:hover { background: var(--brass-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: var(--rust); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------- top utility bar --- */
.topbar { background: var(--surface-dark); color: var(--on-dark); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.03em; }
.topbar .wrap { display: flex; justify-content: center; align-items: center; text-align: center; padding-top: 8px; padding-bottom: 8px; }
.topbar a { text-decoration: underline; text-underline-offset: 3px; }
.topbar a:hover { opacity: .85; }

/* -------------------------------------------------------------- header - */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--paper-raised); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 28px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; color: var(--ink); white-space: nowrap; min-width: 0; }
.brand .brand-name { overflow: hidden; text-overflow: ellipsis; }
.brand .mark { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-dark); color: var(--on-dark); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.95rem; }
.main-nav { display: flex; gap: 22px; flex: 1; }
.main-nav a { font-weight: 600; font-size: 0.94rem; color: var(--ink-soft); padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--ink); border-color: var(--brass); }

.search-form { flex: 1; max-width: 380px; display: flex; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--field); overflow: visible; position: relative; }
.search-form input { flex: 1; border: 0; padding: 10px 14px; background: transparent; color: var(--ink); }
.search-form input:focus { outline: none; }
.search-form button { border: 0; background: transparent; padding: 0 14px; color: var(--ink-soft); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink-soft); font-size: 0.68rem; font-weight: 600; }
.icon-btn:hover { color: var(--ink); background: var(--paper); }
.icon-btn svg { width: 21px; height: 21px; }
.badge { position: absolute; top: 2px; right: 3px; background: var(--rust); color: #fff; font-family: var(--font-mono); font-size: 0.62rem; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content:""; display:block; width:20px; height:2px; background:var(--ink); position:relative; }
.nav-toggle span::before { position:absolute; top:-6px; }
.nav-toggle span::after { position:absolute; top:6px; }

/* --------------------------------------------------------- category tab strip - */
.cat-strip { background: var(--paper); border-bottom: 1px solid var(--line); overflow-x: auto; }
.cat-strip .wrap { display: flex; gap: 6px; padding-block: 10px; }
.cat-strip a { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); background: var(--paper-raised); white-space: nowrap; }
.cat-strip a:hover, .cat-strip a.active { color: var(--on-brass); background: var(--brass); border-color: var(--brass); }

/* ------------------------------------------------------------------ hero - */
.hero { padding-block: 72px 56px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 14px; display: inline-block; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); margin-bottom: 18px; }
.hero p.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 14px; }
.hero-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; box-shadow: var(--shadow-card); }
.hero-card .stamp { display: inline-flex; align-items:center; justify-content:center; width:52px; height:52px; border-radius:50%; border:2px dashed var(--brass); color: var(--accent-text); font-family: var(--font-mono); font-size:0.7rem; margin-bottom: 14px; text-align:center; }
.hero-card ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; font-size: 0.92rem; color: var(--ink-soft); }
.hero-card li { display: flex; gap: 10px; align-items: baseline; }
.hero-card li::before { content: "—"; color: var(--brass); font-family: var(--font-mono); }

/* ------------------------------------------------------------ sections -- */
.trust-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.trust-strip .item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
.trust-strip .item .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-raised); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent-text); }
.trust-strip .item .ico svg { width: 19px; height: 19px; }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.why-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; box-shadow: var(--shadow-card); }
.why-card .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-dark); color: var(--on-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.why-card .ico svg { width: 20px; height: 20px; }
.why-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.why-card p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }

.video-btn { display: inline-flex; align-items: center; gap: 8px; background: #ff0000; color: #fff; padding: 10px 16px; border-radius: var(--radius-s); font-weight: 600; font-size: 0.88rem; }
.video-btn:hover { background: #cc0000; color: #fff; }
.video-btn svg { width: 16px; height: 16px; }
.card-product .video-flag { position: absolute; bottom: 8px; right: 8px; background: #ff0000; color: #fff; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.card-product .video-flag svg { width: 12px; height: 12px; }

.section { padding-block: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.9rem; }
.section-head .tag { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.1em; }
.section-head a.view-all { font-weight: 600; font-size: 0.88rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.section-head a.view-all:hover { color: var(--ink); border-color: var(--ink); }
.section-alt { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-tile { position: relative; border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 4/3; background: var(--surface-dark); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; transition: transform .4s ease, opacity .3s ease; }
.cat-tile:hover img { transform: scale(1.06); opacity: 0.7; }
.cat-tile .label { position: absolute; inset: auto 0 0 0; padding: 16px; color: #fff; }
.cat-tile .label .name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.cat-tile .label .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--brass-tint); }

/* ------------------------------------------------------------- product grid & card ---- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card-product { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; position: relative; }
.card-product:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.card-product .thumb { position: relative; aspect-ratio: 1/1; background: var(--field); overflow: hidden; border-bottom: 1px dashed var(--line); }
.card-product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-product .grommet { position: absolute; top: 10px; left: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.card-product .fav-btn { z-index: 2; position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,253,248,0.92); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.card-product .fav-btn:hover, .card-product .fav-btn.active { color: var(--rust); border-color: var(--rust); }
.card-product .fav-btn.active svg { fill: var(--rust); }
.js-fav-toggle.active { color: var(--rust); border-color: var(--rust); }
.js-fav-toggle.active svg { fill: var(--rust); }
.js-fav-toggle svg { flex-shrink: 0; }
.card-product .sale-flag { position: absolute; bottom: 8px; left: 8px; background: var(--rust); color: #fff; font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 8px; border-radius: 3px; }
.card-product .out-flag { position: absolute; inset:0; background: rgba(32,41,59,0.55); color:#fff; display:flex; align-items:center; justify-content:center; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; }
.card-product .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-product .cat-label { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.card-product .name { font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.card-product .name a::after { content: ""; position: absolute; inset: 0; }
.card-product .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.card-product .price { font-family: var(--font-mono); font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.card-product .compare { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-faint); text-decoration: line-through; }
.card-product .add-form { padding: 0 16px 16px; position: relative; z-index: 2; } /* sit above the card-wide link overlay */

/* --------------------------------------------------------------- badges/labels --- */
.eyebrow { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono); }
.pill-sage { background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage-text); }
.pill-rust { background: rgba(168,74,44,0.13); color: var(--rust); }
.pill-ink { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-soft); }
.pill-brass { background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--accent-text); }

/* ----------------------------------------------------------------- breadcrumb --- */
.breadcrumb { font-size: 0.82rem; color: var(--ink-faint); padding: 18px 0; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--ink); }

/* -------------------------------------------------------------- product page --- */
.product-view { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 20px 60px; }
.gallery-main { aspect-ratio: 1/1; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 12px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--brass); border-width: 2px; }

.product-info .sku { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-faint); }
.product-info h1 { font-size: 2rem; margin: 8px 0 12px; }
.product-info .price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.product-info .price { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; }
.product-info .compare { font-family: var(--font-mono); color: var(--ink-faint); text-decoration: line-through; }
.product-info .desc { color: var(--ink-soft); margin-bottom: 22px; }
.stock-line { font-size: 0.88rem; margin-bottom: 20px; display:flex; align-items:center; gap:8px;}

.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.qty-stepper button { width: 38px; height: 42px; background: var(--paper-raised); border: 0; font-size: 1.1rem; color: var(--ink); }
.qty-stepper input { width: 50px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 42px; font-family: var(--font-mono); }
.product-actions { display: flex; gap: 12px; margin-bottom: 26px; }
.meta-list { border-top: 1px solid var(--line); padding-top: 16px; font-size: 0.86rem; color: var(--ink-soft); display: grid; gap: 8px; }
.meta-list b { color: var(--ink); }

/* ----------------------------------------------------------------- forms --- */
.form-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 36px; box-shadow: var(--shadow-card); }
.checkout-section-title { font-size: 1.05rem; margin: 0 0 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.checkout-section-title:first-of-type { padding-top: 0; border-top: none; }
.form-narrow { max-width: 440px; margin: 44px auto; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--field); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brass); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink-soft); }
/* A clickable radio-choice row (delivery area, payment method, ...). The whole row is the
   label, so tap targets are generous and the radio stays aligned with the first line of text
   even when the label wraps — the plain checkbox-row above only worked reliably for one-liners. */
.radio-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.radio-option:last-child { margin-bottom: 0; }
.radio-option:hover { border-color: var(--ink-faint); }
.radio-option:has(input:checked) { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 7%, transparent); }
.radio-option input[type="radio"] { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--brass); }
.radio-option .radio-option-label { margin: 0; font-weight: 400; font-size: 0.92rem; line-height: 1.4; }
.radio-option.is-disabled { cursor: not-allowed; opacity: .55; }
.radio-option.is-disabled:hover { border-color: var(--line); }

.timeline { list-style:none; margin:0; padding:0; }
.timeline li { position:relative; padding:0 0 18px 22px; border-left:2px solid var(--line); font-size:0.92rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom:0; }
.timeline li::before { content:''; position:absolute; left:-6px; top:2px; width:10px; height:10px; border-radius:50%; background:var(--brass); border:2px solid var(--paper); }
.form-foot { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--ink-soft); }
.form-foot a { color: var(--accent-text); font-weight: 600; }

.alert { padding: 12px 16px; border-radius: var(--radius-s); font-size: 0.88rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error { background: rgba(168,74,44,0.1); color: var(--rust); border-color: rgba(168,74,44,0.3); }
.alert-success { background: color-mix(in srgb, var(--sage) 14%, transparent); color: var(--sage-text); border-color: color-mix(in srgb, var(--sage) 35%, transparent); }
.alert-info { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-soft); border-color: var(--line); }

/* ------------------------------------------------------------------- cart --- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding-block: 30px 60px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 84px 1fr auto auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); }
.cart-line .name { font-weight: 600; }
.cart-line .unit { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-faint); }
.cart-line .line-total { font-family: var(--font-mono); font-weight: 700; }
.cart-line .remove-btn { color: var(--ink-faint); font-size: 0.78rem; margin-top: 4px; }
.cart-line .remove-btn:hover { color: var(--rust); }
.summary-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; position: sticky; top: 100px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.92rem; padding: 8px 0; color: var(--ink-soft); }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.summary-row .val { font-family: var(--font-mono); }
.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-soft); }
.empty-state .icon { margin-bottom: 14px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.empty-state .icon svg { width: 44px; height: 44px; }

/* ------------------------------------------------------------- account/orders --- */
.account-layout { display: grid; grid-template-columns: 230px 1fr; gap: 36px; padding-block: 30px 60px; }
.account-nav { display: flex; flex-direction: column; gap: 4px; }
.account-nav a { padding: 10px 14px; border-radius: var(--radius-s); font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); }
.account-nav a:hover { background: var(--paper-raised); }
.account-nav a.active { background: var(--brass); color: var(--on-brass); }
.data-table { width: 100%; border-collapse: collapse; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.data-table th { font-family: var(--font-mono); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink-faint); background: var(--paper); }
.data-table tr:last-child td { border-bottom: 0; }
.status-pill { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.status-pending { background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--accent-text); }
.status-processing { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-soft); }
.status-shipped { background: color-mix(in srgb, var(--sage) 14%, transparent); color: var(--sage-text); }
.status-completed { background: color-mix(in srgb, var(--sage) 24%, transparent); color: var(--sage-text); }
.status-cancelled { background: rgba(168,74,44,0.13); color: var(--rust); }

/* --------------------------------------------------------------------- footer --- */
.site-footer { position: relative; background: var(--surface-dark); color: var(--on-dark-soft); padding-block: 56px 24px; margin-top: 60px; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--brass) 50%, transparent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-bottom: 36px; }
.footer-grid h4 { color: var(--on-dark); font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--on-dark-line); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; font-size: 0.9rem; }
.footer-grid a { transition: color .15s ease; }
.footer-grid a:hover { color: var(--brass-tint); }
.footer-brand p { max-width: 32ch; font-size: 0.88rem; line-height: 1.6; margin-top: 10px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact-links a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--on-dark-line); display: flex; align-items: center; justify-content: center; color: var(--on-dark-soft); transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.contact-links a:hover { background: var(--brass); border-color: var(--brass); color: var(--on-brass); transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid var(--on-dark-line); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; font-family: var(--font-mono); color: var(--on-dark-faint); flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: var(--on-dark-soft); transition: color .15s ease; }
.footer-bottom a:hover { color: var(--brass-tint); }

/* ----------------------------------------------------------------- toast ------- */
#toast { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast-item { background: var(--surface-dark); color: var(--on-dark); padding: 12px 18px; border-radius: var(--radius-s); font-size: 0.88rem; box-shadow: var(--shadow-pop); animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity:0; transform: translateY(8px);} to {opacity:1; transform:none;} }

/* ------------------------------------------------------------------ misc pages -- */
.page-header { padding-block: 44px 8px; }
.page-header h1 { font-size: 2.2rem; }
.prose { max-width: 72ch; color: var(--ink-soft); }
.prose h2 { color: var(--ink); margin-top: 1.4em; }
.pagination { display: flex; gap: 8px; justify-content: center; padding: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.85rem; }
.pagination a:hover { border-color: var(--brass); }
.pagination .current { background: var(--brass); color: var(--on-brass); border-color: var(--brass); }

.filter-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.filter-bar .count { font-size: 0.88rem; color: var(--ink-soft); }
.filter-bar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--field); color: var(--ink); }

/* ==========================================================================
   Header tools: day/night switch + animation switch
   ========================================================================== */
.tool-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: color .15s, border-color .15s, background-color .15s, transform .15s; }
.tool-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.tool-btn:active { transform: scale(.94); }
.tool-btn svg { width: 19px; height: 19px; position: absolute; inset: 0; margin: auto; transition: transform .35s ease, opacity .25s ease; }
/* theme: moon in light mode (click => dark), sun in dark mode (click => light) */
#themeToggle .ico-sun { opacity: 0; transform: rotate(-70deg) scale(.5); }
:root[data-theme="dark"] #themeToggle .ico-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] #themeToggle .ico-moon { opacity: 0; transform: rotate(70deg) scale(.5); }
/* animation switch: lit when effects are running, struck through when paused */
#fxToggle .fx-slash { opacity: 0; transition: opacity .2s; }
#fxToggle[aria-pressed="false"] { color: var(--ink-faint); }
#fxToggle[aria-pressed="false"] .fx-slash { opacity: 1; }
#fxToggle[aria-pressed="true"] { color: var(--accent-text); border-color: var(--brass); }
.tool-btn[hidden] { display: none; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--line); }
@media (max-width: 620px) { .header-tools { margin-right: 0; padding-right: 6px; gap: 6px; } .tool-btn { width: 34px; height: 34px; } }
.mobile-tools { display: flex; gap: 10px; margin: 6px 0 12px; }

/* ==========================================================================
   Search suggestions
   ========================================================================== */
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-pop); overflow: hidden; }
.suggest[hidden] { display: none; }
.suggest a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.suggest a:last-child { border-bottom: 0; }
.suggest a:hover, .suggest a.is-active { background: var(--paper); }
.suggest img { width: 38px; height: 38px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); flex-shrink: 0; }
.suggest .s-name { font-size: 0.88rem; font-weight: 600; line-height: 1.25; }
.suggest .s-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.suggest .s-all { justify-content: center; font-size: 0.82rem; font-weight: 600; color: var(--accent-text); }
.suggest mark { background: color-mix(in srgb, var(--brass) 28%, transparent); color: inherit; border-radius: 2px; }

/* ==========================================================================
   Product page: separate color + size pickers
   ========================================================================== */
.option-group { margin-bottom: 20px; }
.option-label { display: flex; align-items: baseline; gap: 8px; font-size: 0.86rem; font-weight: 700; margin-bottom: 9px; }
.option-label .chosen { font-weight: 500; color: var(--ink-soft); }
.option-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); padding: 3px; background: transparent; }
.swatch .dot { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--dot, var(--ink-faint)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); overflow: hidden; }
.swatch .dot img { width: 100%; height: 100%; object-fit: cover; }
.swatch:hover { border-color: var(--ink-faint); }
.swatch.is-selected { border-color: var(--brass); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brass) 25%, transparent); }
.chip { min-width: 46px; padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--field); color: var(--ink); font-weight: 600; font-size: 0.88rem; }
.chip:hover { border-color: var(--ink-faint); }
.chip.is-selected { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--field)); color: var(--accent-text); box-shadow: 0 0 0 1px var(--brass) inset; }
.swatch.is-unavailable, .chip.is-unavailable { opacity: .45; }
.chip.is-unavailable { text-decoration: line-through; }
.swatch.is-unavailable::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: var(--ink-soft); transform: rotate(-45deg); }
.gallery-main img { transition: opacity .18s ease; }
.gallery-main img.is-swapping { opacity: .25; }
.meta-list .is-updated { animation: meta-flash .7s ease; }
@keyframes meta-flash { from { background: color-mix(in srgb, var(--brass) 26%, transparent); } to { background: transparent; } }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tag-list a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.78rem; color: var(--ink-soft); background: var(--paper-raised); }
.tag-list a:hover { border-color: var(--brass); color: var(--accent-text); }
.card-product .options-flag { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); }


/* ==========================================================================
   Shared bits: icons, logo, skip link, panels, table scroller
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
a, button { -webkit-tap-highlight-color: transparent; }
button, .btn, .tab, .chip, .swatch { touch-action: manipulation; }
.i { display: block; flex-shrink: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--brass); color: var(--on-brass); padding: 10px 16px; border-radius: var(--radius-s); font-weight: 600; }
.skip-link:focus { top: 10px; }
.flash-wrap { padding-top: 20px; }
.verify-alert { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.verify-alert form { margin: 0; }
.panel { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-m); }
.badge[hidden] { display: none !important; }

/* Uploaded logo (Admin → Branding). Day/night variants swap in the header. */
.brand-logo { display: block; height: 40px; width: auto; max-width: 220px; object-fit: contain; }
.brand-logo.on-plate { background: #fff; padding: 5px 10px; border-radius: 8px; box-sizing: content-box; height: 30px; }
.site-header .brand .logo-d { display: none; }
:root[data-theme="dark"] .site-header .brand .logo-d { display: block; }
:root[data-theme="dark"] .site-header .brand .logo-l:not(.plate-in-dark) { display: none; }
:root[data-theme="dark"] .site-header .brand .plate-in-dark { background: #fff; padding: 4px 8px; border-radius: 8px; box-sizing: content-box; height: 32px; }
.brand-logo + .brand-name { font-size: 2rem; font-weight: 700; margin-left: 2px; }

/* footer contact details */
.footer-brand .brand { color: var(--on-dark); margin-bottom: 12px; }
.footer-contact { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 0.88rem; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .i { margin-top: 3px; opacity: .75; }
.footer-contact a:hover { color: var(--on-dark); }
.contact-links a .i { display: block; }

/* header on desktop: search-toggle and mobile-only chrome stay hidden */
.search-toggle, .nav-toggle { display: none; }
.mobile-nav, .tabbar, .buy-bar, .checkout-bar { display: none; }
.icon-btn { background: transparent; border: 0; font-family: inherit; cursor: pointer; }
.badge { pointer-events: none; }

/* ==========================================================================
   Mobile drawer
   ========================================================================== */
.mobile-nav { position: fixed; inset: 0; z-index: 80; visibility: hidden; pointer-events: none; transition: visibility 0s linear .3s; }
.mobile-nav.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.mnav-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 22, .55); opacity: 0; transition: opacity .3s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.mobile-nav.open .mnav-backdrop { opacity: 1; }
.mnav-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 360px); background: var(--paper); display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-pop); overscroll-behavior: contain; }
.mobile-nav.open .mnav-panel { transform: none; }
.mnav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 14px 14px 18px; background: var(--surface-dark); color: var(--on-dark); flex-shrink: 0; }
.mnav-head .brand { color: var(--on-dark); font-size: 1.3rem; }
.mnav-head .brand .mark { background: color-mix(in srgb, var(--on-dark) 16%, transparent); }
.mnav-head .brand-logo { height: 34px; }
.mnav-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--on-dark-line); background: transparent; color: var(--on-dark); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mnav-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.mnav-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink-faint); margin-bottom: 14px; }
.mnav-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 0; color: var(--ink); }
.mnav-search input:focus { outline: none; }
.mnav-search:focus-within { border-color: var(--brass); }
.mnav-links, .mnav-cats { display: flex; flex-direction: column; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.mnav-links a, .mnav-cats a { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.mnav-links a:last-child, .mnav-cats a:last-child { border-bottom: 0; }
.mnav-links a .i:first-child { color: var(--accent-text); }
.mnav-links a .i:last-child, .mnav-cats a .i { margin-left: auto; color: var(--ink-faint); }
.mnav-cats a span { flex: 1; }
.mnav-links a:active, .mnav-cats a:active { background: var(--paper); }
.mnav-links a.active, .mnav-cats a.active { background: color-mix(in srgb, var(--brass) 12%, var(--paper-raised)); color: var(--accent-text); }
.mnav-title { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin: 20px 4px 8px; }
.mnav-account { margin-top: 18px; padding: 16px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); }
.mnav-account p { margin: 0 0 12px; font-size: .88rem; color: var(--ink-soft); }
.mnav-account .who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-width: 0; }
.mnav-account .who > div { min-width: 0; }
.mnav-account .who strong { display: block; font-size: .95rem; }
.mnav-account .who small { display: block; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mnav-account .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brass); color: var(--on-brass); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.mnav-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mnav-btns .btn { flex: 1 1 auto; min-height: 42px; }
.mnav-contact { display: grid; gap: 4px; }
.mnav-contact .mnav-title { margin-bottom: 4px; }
.mnav-contact > a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; color: var(--ink-soft); font-size: .92rem; overflow-wrap: anywhere; }
.mnav-contact > a .i { color: var(--accent-text); }
.mnav-social { margin-top: 8px; }
.mnav-social a { border-color: var(--line); color: var(--ink-soft); }
.mnav-prefs { margin-top: 18px; display: grid; gap: 8px; }
.mnav-pref { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-raised); color: var(--ink); font-weight: 600; font-size: .92rem; text-align: left; }
.mnav-pref .txt { flex: 1; }
.mnav-pref .i { color: var(--accent-text); }
.mnav-pref .switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line); transition: background .2s; flex-shrink: 0; }
.mnav-pref .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.mnav-pref[aria-pressed="true"] .switch { background: var(--brass); }
.mnav-pref[aria-pressed="true"] .switch::after { transform: translateX(16px); }
.mnav-pref .ico-d { display: none; }
:root[data-theme="dark"] .mnav-pref .ico-l { display: none; }
:root[data-theme="dark"] .mnav-pref .ico-d { display: inline-flex; }
html.nav-locked { overflow: hidden; }

/* ==========================================================================
   Sticky bars (phones only)
   ========================================================================== */
.tabbar { }
.buy-bar, .checkout-bar { gap: 14px; align-items: center; padding: 10px var(--gutter); background: var(--paper-raised); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .1); }
.buy-bar .bb-price, .checkout-bar .bb-price { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.bb-price small { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.bb-price strong { font-family: var(--font-mono); font-size: 1.15rem; }
.buy-bar .btn, .checkout-bar .btn { flex: 1; min-height: 48px; font-size: 1rem; }

/* cart lines (all sizes) */
.cart-line { grid-template-columns: 84px 1fr auto; }
.cart-line .cl-buy { display: flex; align-items: center; gap: 22px; }
.cart-line .cl-warn { font-size: .78rem; color: var(--rust); margin-top: 4px; }
.cart-line .line-total { min-width: 90px; text-align: right; }

/* product page gallery counter + swipe */
.gallery-main { position: relative; touch-action: pan-y; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; background: rgba(20, 24, 33, .72); color: #fff; font-family: var(--font-mono); font-size: .72rem; padding: 3px 9px; border-radius: 999px; pointer-events: none; }

/* ==========================================================================
   Tablet & phone
   ========================================================================== */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}

@media (max-width: 860px) {
  :root { --gutter: 18px; --tabbar-h: 62px; --bar-h: 68px; }
  /* The tab bar stays on every page. Pages with a sticky action bar (cart, checkout, product) stack it right above the tab bar. */
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  body.has-action-bar { padding-bottom: calc(var(--tabbar-h) + var(--bar-h) + env(safe-area-inset-bottom) + 8px); }

  /* --- header: one slim sticky row --- */
  .site-header { position: sticky; top: 0; }
  .header-row { flex-wrap: wrap; gap: 4px; padding-block: 8px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -8px; padding: 0; border: 0; background: transparent; border-radius: 50%; }
  .nav-toggle:active { background: var(--paper); }
  .brand { flex: 1; font-size: 1.3rem; gap: 9px; }
  .brand-logo { height: 34px; max-width: 160px; }
  .brand-name { position: relative; top: 10px; }
  .main-nav, .header-tools, .hide-sm { display: none; }
  .header-actions { gap: 0; }
  .icon-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; color: var(--ink); }
  .icon-btn .lbl { display: none; }
  .search-toggle { display: inline-flex; align-items: center; }
  .badge { top: 4px; right: 2px; }
  .search-form { display: none; order: 10; flex: 1 1 100%; max-width: none; margin-bottom: 4px; border-radius: 999px; padding-left: 4px; }
  .search-form input { padding: 12px 14px; }
  .site-header.search-open .search-form { display: flex; }
  .mobile-nav { display: block; }

  /* --- category chips scroll edge to edge --- */
  .cat-strip { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .cat-strip::-webkit-scrollbar { display: none; }
  .cat-strip .wrap { padding-block: 8px; }
  .cat-strip a { padding: 8px 15px; }

  /* --- bottom tab bar --- */
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--paper-raised) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--tabbar-h); padding: 6px 0; border: 0; background: none; font-family: inherit; font-size: .68rem; line-height: 1.2; font-weight: 600; color: var(--ink-faint); }
  .tab span:not(.badge) { display: block; line-height: 1.2; }
  .tab.active { color: var(--accent-text); }
  .tab.active::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--brass); }
  .tab .badge { position: absolute; top: 5px; left: calc(50% + 4px); right: auto; }

  /* --- sticky action bars: sit directly above the tab bar; z-index just below it so a hidden bar slides out from behind it --- */
  .buy-bar, .checkout-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 49; display: flex; min-height: var(--bar-h); }
  .buy-bar { transform: translateY(120%); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .25s ease, opacity .2s ease, visibility 0s linear .25s; }
  .buy-bar.show { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .buy-bar[hidden] { display: none; }

  /* --- layout --- */
  .hero { padding-block: 34px 30px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 26px; }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .hero p.lead { font-size: 1rem; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; min-height: 48px; }
  .hero-card { padding: 22px; }
  .product-view { grid-template-columns: 1fr; gap: 22px; padding-block: 4px 40px; }
  .account-layout { grid-template-columns: 1fr; gap: 18px; padding-block: 14px 40px; }
  .section { padding-block: 34px; }
  .section-head h2 { font-size: 1.5rem; }
  .page-header { padding-block: 26px 4px; }
  .page-header h1 { font-size: 1.8rem; }
  .breadcrumb { padding: 12px 0 6px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .cart-layout { gap: 22px; padding-block: 14px 30px; }

  .trust-strip { display: flex; overflow-x: auto; gap: 10px; padding-block: 16px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-snap-type: x proximity; scrollbar-width: none; }
  .trust-strip::-webkit-scrollbar { display: none; }
  .trust-strip .item { flex: 0 0 auto; flex-direction: row; gap: 10px; padding: 6px 16px 6px 6px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: 999px; scroll-snap-align: start; white-space: nowrap; }
  .trust-strip .item .ico { width: 32px; height: 32px; border: 0; background: color-mix(in srgb, var(--brass) 14%, transparent); }
  .why-grid { grid-template-columns: 1fr; gap: 14px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-tile .label { padding: 12px; }
  .cat-tile .label .name { font-size: 1rem; }

  /* --- cards & grids --- */
  .product-grid, .product-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-product:hover { transform: none; }
  .card-product .grommet { display: none; }
  .card-product .body { padding: 10px 12px 12px; gap: 4px; }
  .card-product .name { font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card-product .price { font-size: .95rem; }
  .card-product .compare { font-size: .74rem; }
  .card-product .add-form { padding: 0 12px 12px; }
  .card-product .add-form .btn-sm { min-height: 42px; font-size: .84rem; padding-inline: 8px; }
  .card-product .fav-btn { width: 38px; height: 38px; }
  .filter-bar { padding: 12px 0; margin-bottom: 16px; }
  .filter-bar select { min-height: 42px; }

  /* --- product page --- */
  .product-info h1 { font-size: 1.6rem; }
  .product-info .price { font-size: 1.5rem; }
  .gallery-thumbs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .gallery-thumbs img { flex-shrink: 0; width: 64px; height: 64px; }
  .product-actions { flex-wrap: wrap; }
  .product-actions .btn { flex: 1 1 100%; min-height: 48px; }
  .qty-stepper button { width: 46px; height: 46px; }
  .qty-stepper input { height: 46px; }
  .swatch { width: 44px; height: 44px; }
  .chip { min-height: 44px; }

  /* --- cart --- */
  .cart-line { grid-template-columns: 72px 1fr; gap: 10px 14px; align-items: start; }
  .cart-line img { width: 72px; height: 72px; }
  .cart-line .cl-buy { grid-column: 1 / -1; justify-content: space-between; }
  .summary-card { padding: 20px; }

  /* --- forms & tables --- */
  .form-card { padding: 20px; }
  .form-narrow { margin: 20px auto; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field input, .field select, .field textarea { padding: 13px; min-height: 48px; }
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; }
  .account-nav { position: relative; flex-direction: row; overflow-x: auto; gap: 8px; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav a:last-child { margin-right: 22px; }
  .account-nav a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; white-space: nowrap; }
  .data-table th, .data-table td { padding: 10px 12px; }

  /* Order list: one card per order instead of a wide table. */
  .data-table.stack { display: block; min-width: 0; background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .data-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table.stack tbody { display: grid; gap: 10px; }
  .data-table.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); }
  .data-table.stack td { display: block; padding: 0; border: 0; }
  .data-table.stack .cell-order { grid-column: 1; grid-row: 1; font-weight: 700; font-size: .95rem; }
  .data-table.stack .cell-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .data-table.stack .cell-date { grid-column: 1; grid-row: 2; color: var(--ink-faint); font-size: .82rem; }
  .data-table.stack .cell-total { grid-column: 2; grid-row: 2; justify-self: end; font-weight: 700; }
  .data-table.stack .cell-action { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; }
  .data-table.stack .cell-action .btn { width: 100%; }

  /* Order items: compact so four columns fit a phone without side-scrolling. */
  .data-table.items-table { min-width: 0; }
  .data-table.items-table th, .data-table.items-table td { padding: 9px 8px; font-size: .84rem; }
  .data-table.items-table td.mono { white-space: nowrap; }
  .pagination { flex-wrap: wrap; padding: 22px 0; }

  /* --- footer --- */
  .site-footer { margin-top: 36px; padding-block: 34px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; gap: 4px; }

  /* --- toast rides above the bars --- */
  #toast { left: 14px; right: 14px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); align-items: center; }
  body.has-action-bar #toast { bottom: calc(var(--tabbar-h) + var(--bar-h) + 14px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  :root { --gutter: 14px; }
  .brand { font-size: 1.15rem; }
  .product-grid, .product-grid.cols-3 { gap: 10px; }
  .card-product .add-form .btn-sm { font-size: .78rem; }
}

@media (min-width: 861px) {
  .mobile-nav, .tabbar, .buy-bar, .checkout-bar { display: none !important; }
}

/* contact page */
.contact-layout { grid-template-columns: 1fr 1fr; padding-block: 8px 40px; }
.contact-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list li > .i { margin-top: 2px; color: var(--accent-text); }
.contact-list small { display: block; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.contact-list a { font-weight: 600; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent-text); }
.contact-social { margin-top: 22px; }
.contact-social a { border-color: var(--line); color: var(--ink-soft); }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; padding-block: 4px 20px; } }

/* checkout: the sticky bar replaces the in-form button on phones */
@media (max-width: 860px) { .place-order-desktop { display: none; } }

.cart-line .remove-btn { background: none; border: 0; padding: 8px 0 4px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) { .cart-checkout-desktop { display: none; } }

/* ==========================================================================
   Phase 5: containment, utilities, coupons, reviews, wishlist count
   ========================================================================== */

/* Nothing may make the page wider than the screen: a wide child inside a grid or flex column used to
   stretch the whole layout, which made phones zoom out and pushed the fixed tab bar out of view. */
html, body { max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.account-layout > *, .cart-layout > *, .product-view > *, .contact-layout > *, .reviews-layout > *, .footer-grid > * { min-width: 0; }
.table-scroll { max-width: 100%; }
img, video, svg { max-width: 100%; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:disabled { opacity: .5; }
.footer-contact .sep { opacity: .5; }

/* ---- coupon box (checkout) ---- */
.summary-row.discount-row { color: var(--sage-text); }
.summary-row.discount-row[hidden] { display: none; }
.coupon-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage-text); font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }
.coupon-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.coupon-form[hidden], .coupon-applied[hidden] { display: none; }
.coupon-label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--field); color: var(--ink); font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.coupon-row input::placeholder { font-family: var(--font-body); letter-spacing: 0; text-transform: none; }
.coupon-row input:focus { border-color: var(--brass); outline: none; }
.coupon-applied { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--sage) 12%, transparent); border: 1px solid color-mix(in srgb, var(--sage) 35%, transparent); }
.coupon-ok { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sage); color: #fff; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.coupon-applied-text { flex: 1; min-width: 0; font-size: .88rem; color: var(--ink); }
.coupon-applied-text strong { font-family: var(--font-mono); letter-spacing: .04em; }
.coupon-applied-text small { display: block; color: var(--ink-soft); font-size: .78rem; }
.coupon-msg { min-height: 0; margin-top: 8px; font-size: .82rem; }
.coupon-msg:empty { display: none; }
.coupon-msg.err { color: var(--rust); }
.coupon-msg.ok { color: var(--sage-text); }

/* ---- stars ---- */
.stars { display: inline-block; font-size: 15px; line-height: 1; white-space: nowrap; vertical-align: -2px; }
.stars::before {
  content: "\2605\2605\2605\2605\2605";
  background: linear-gradient(90deg, #e0a526 calc(var(--rating, 0) / 5 * 100%), color-mix(in srgb, var(--ink) 20%, transparent) calc(var(--rating, 0) / 5 * 100%));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.stars-lg { font-size: 22px; }
.rating-line { display: inline-flex; align-items: center; gap: 8px; margin: -2px 0 10px; font-size: .88rem; color: var(--ink-soft); }
.rating-line:hover .rating-count { color: var(--ink); text-decoration: underline; }
.rating-num { font-weight: 700; color: var(--ink); font-family: var(--font-mono); }
.wish-line { display: flex; align-items: center; gap: 7px; margin: -8px 0 18px; font-size: .84rem; color: var(--ink-soft); }
.wish-line[hidden], .rs-wish[hidden] { display: none; }
.wish-line svg { color: var(--rust); flex-shrink: 0; }
.wish-line strong { color: var(--ink); }

/* small rating + wishlist line on product cards */
.card-social { display: flex; align-items: center; gap: 10px; font-size: .74rem; color: var(--ink-faint); min-height: 16px; }
.card-social .cs-rating { display: inline-flex; align-items: center; gap: 4px; }
.card-social .stars { font-size: 12px; vertical-align: 0; }
.card-social .cs-wish { display: inline-flex; align-items: center; gap: 4px; }
.card-social .cs-wish svg { color: var(--rust); }

/* ---- reviews ---- */
.reviews-layout { display: grid; grid-template-columns: 280px 1fr; gap: 44px; align-items: start; }
.review-summary { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; position: sticky; top: 100px; }
.section.reviews { padding-block: 44px 20px; }
.rs-score { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.rs-avg { font-family: var(--font-display); font-size: 2.8rem; font-weight: 700; line-height: 1; }
.rs-of { color: var(--ink-faint); font-size: .84rem; }
.rs-count { margin: 8px 0 16px; color: var(--ink-soft); font-size: .86rem; }
.rs-empty { color: var(--ink-soft); font-weight: 600; padding: 6px 0 4px; }
.rs-bars { display: grid; gap: 6px; }
.rs-bar { display: grid; grid-template-columns: 26px 1fr 24px; gap: 8px; align-items: center; font-size: .78rem; color: var(--ink-soft); }
.rs-star { display: inline-flex; align-items: center; gap: 2px; }
.rs-star svg { color: var(--gold, #c9a227); flex-shrink: 0; }
.rs-track { height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.rs-track span { display: block; height: 100%; background: #e0a526; border-radius: 99px; }
.rs-n { text-align: right; font-family: var(--font-mono); }
.rs-wish { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--ink-soft); }
.rs-wish [data-wish-num] { font-weight: 700; color: var(--ink); }

.review-note { padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius-m); background: var(--paper-raised); color: var(--ink-soft); font-size: .92rem; margin-bottom: 22px; }
.review-form { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; margin-bottom: 26px; }
.review-form h3 { margin-bottom: 12px; }
.review-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.star-input { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 2px; }
.star-input legend { float: left; font-size: .86rem; font-weight: 600; margin: 0 12px 0 0; padding: 0; line-height: 34px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.star-input label { cursor: pointer; font-size: 30px; line-height: 1; padding: 2px 3px; color: color-mix(in srgb, var(--ink) 22%, transparent); transition: color .12s ease, transform .12s ease; }
.star-input label::before { content: "\2605"; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #e0a526; }
.star-input label:hover { transform: scale(1.12); }
.star-input input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.review { padding: 20px 0; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: 4px; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-title { font-weight: 700; }
.review-body { margin: 0 0 8px; color: var(--ink-soft); overflow-wrap: anywhere; }
.review-meta { font-size: .8rem; color: var(--ink-faint); }
.review-meta .verified { color: var(--sage-text); font-weight: 600; }
.review-empty { color: var(--ink-faint); }
.review-link { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--accent-text); }
.review-link svg { flex-shrink: 0; }

@media (max-width: 860px) {
  .reviews-layout { grid-template-columns: 1fr; gap: 22px; }
  .review-summary { position: static; padding: 18px; }
  .section.reviews { padding-block: 30px 10px; }
  .review-form { padding: 18px; }
  .star-input label { font-size: 34px; padding: 2px 4px; }
  .coupon-row input { min-height: 46px; }
  .review-actions .btn { flex: 1 1 auto; }
}

/* ------------------------------------------- sign-in: Google button, divider, toggle --- */
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 16px; border-radius: var(--radius, 8px); border: 1px solid #dadce0; background: #fff; color: #3c4043; font-weight: 600; font-size: 0.93rem; text-decoration: none; transition: background-color .15s ease, box-shadow .15s ease; }
.btn-google:hover { background: #f7f8f8; box-shadow: 0 1px 3px rgba(60,64,67,.25); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-faint); font-size: 0.8rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
label.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
label.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
label.switch .track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line); transition: background .18s; flex-shrink: 0; }
label.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s; }
label.switch input:checked + .track { background: var(--brass); }
label.switch input:checked + .track::after { transform: translateX(18px); }
label.switch input:focus-visible + .track { outline: 2px solid var(--brass); outline-offset: 2px; }
