/* Design tokens: change colors here only. Light is the default; dark via the toggle or system setting. */
:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --text: #1c2420;
  --muted: #5d6a63;
  --border: #e2e0d6;
  --primary: #1f6f4a;
  --primary-hover: #185c3d;
  --primary-ink: #ffffff;
  --primary-soft: #e3f1e9;
  --accent: #b7862b;
  --danger: #b4332f;
  --danger-soft: #fbe9e8;
  --warn: #a8670b;
  --warn-soft: #fdf2dc;
  --ok: #1f7a46;
  --info-soft: #e8f0fb;
  --info: #2a5ca8;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --indica: #5b3f9e;
  --sativa: #b25b12;
  --hybrid: #1f6f4a;
  --cbd: #2a6b9e;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101512; --surface: #171e1a; --surface-2: #1e2722; --text: #e8eee9; --muted: #9aa8a0;
    --border: #2a352f; --primary: #47b57c; --primary-hover: #5cc78e; --primary-ink: #0b1a12;
    --primary-soft: #1b3326; --accent: #d9a84a; --danger: #ef6b62; --danger-soft: #3a1f1d;
    --warn: #e6a53c; --warn-soft: #3a2c14; --ok: #5cc78e; --info-soft: #1a2638; --info: #8ab4f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    --indica: #b39af0; --sativa: #f0a35c; --hybrid: #5cc78e; --cbd: #7fb8ea;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101512; --surface: #171e1a; --surface-2: #1e2722; --text: #e8eee9; --muted: #9aa8a0;
  --border: #2a352f; --primary: #47b57c; --primary-hover: #5cc78e; --primary-ink: #0b1a12;
  --primary-soft: #1b3326; --accent: #d9a84a; --danger: #ef6b62; --danger-soft: #3a1f1d;
  --warn: #e6a53c; --warn-soft: #3a2c14; --ok: #5cc78e; --info-soft: #1a2638; --info: #8ab4f0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
  --indica: #b39af0; --sativa: #f0a35c; --hybrid: #5cc78e; --cbd: #7fb8ea;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .small-text { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error-text { color: var(--danger); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plain-list { margin: 0; padding-left: 1.1em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 24px; padding-bottom: 56px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section { margin: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 6px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.form-card h2 { margin-bottom: 14px; }
.empty { text-align: center; padding: 48px 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 650; padding: 10px 18px;
  border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: .7; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-lg { padding: 13px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label > small, label > .ref { display: block; margin-top: 4px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent); }
input[disabled] { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 2px 0 0; }
label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
label.check > input { margin-top: 2px; }
.big-check { font-size: 1.05rem; font-weight: 650 !important; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-card > label, .form-card > .grid-2, .form-card > .grid-3, .form-card > .grid-4 { margin-bottom: 14px; }
fieldset.checks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
fieldset.checks legend { font-weight: 650; padding: 0 6px; font-size: .92rem; }
.ref { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; line-height: 1.35; }
.check .ref { margin-top: 2px; }

/* Flash messages */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .95rem; }
.flash-success { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.flash-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); margin-bottom: 16px; }

/* Banners */
.test-banner { background: #f2c94c; color: #2b2100; text-align: center; font-weight: 700; font-size: .85rem; padding: 6px 16px; }
.announcement { background: var(--primary); color: var(--primary-ink); text-align: center; font-size: .9rem; padding: 7px 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo.center { justify-content: center; margin-bottom: 18px; }
.logo.small { font-size: 1rem; margin-bottom: 8px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary) url("/placeholder/flower.svg") center / cover; flex: none; }
.search { flex: 1; max-width: 480px; }
.search input { border-radius: 999px; background: var(--surface-2); border-color: transparent; padding: 9px 16px; }
.header-links { display: flex; align-items: center; gap: 16px; margin-left: auto; font-weight: 600; }
.header-links a { color: var(--text); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.cart-count { background: var(--primary); color: var(--primary-ink); border-radius: 999px; font-size: .75rem; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.theme-toggle { background: var(--surface-2); border: 0; color: var(--text); border-radius: 999px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid a { display: block; color: var(--muted); margin-bottom: 6px; }
.footer-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; }

/* Age gate & simple centered pages */
.gate-body { background: radial-gradient(circle at 20% 0%, var(--primary-soft), var(--bg) 60%); }
.gate { display: flex; align-items: center; justify-content: center; padding: 40px 16px; min-height: 100vh; }
.gate-card { max-width: 440px; width: 100%; text-align: center; padding: 36px 28px; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 12px; }
.pay-amount { font-size: 2.4rem; font-weight: 800; margin: 12px 0 4px; }

/* Hero */
.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, var(--bg)), var(--bg) 70%); border-bottom: 1px solid var(--border); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 56px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.03em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-steps li { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.hero-steps li > span { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.hero-steps strong { display: block; }
.hero-steps small { color: var(--muted); }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.category-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); font-weight: 650; transition: transform .15s, box-shadow .15s; }
.category-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.category-tile img { width: 72px; height: 72px; border-radius: 16px; }
.category-tile small { color: var(--muted); font-weight: 400; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.chip { white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .9rem; }
.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.filters label { min-width: 160px; }
.filters label.check { min-width: 0; align-items: center; padding-bottom: 10px; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-media { position: relative; display: block; aspect-ratio: 1; background: var(--surface-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.media-badge { position: absolute; top: 10px; left: 10px; }
.product-body { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; }
.product-name { font-size: 1rem; margin: 2px 0 0; }
.product-name a { color: var(--text); }
.product-sub { color: var(--muted); font-size: .86rem; margin: 0; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; }
.price { font-weight: 800; font-size: 1.08rem; }
.price.big { font-size: 1.8rem; margin: 10px 0 16px; }
.was { color: var(--muted); font-weight: 400; font-size: .85em; margin-left: 6px; }
.strain { font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: .75rem; background: color-mix(in srgb, currentColor 12%, transparent); }
.strain-indica { color: var(--indica); }
.strain-sativa { color: var(--sativa); }
.strain-hybrid { color: var(--hybrid); }
.strain-cbd { color: var(--cbd); }
.potency { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.badge-dark { background: rgba(0, 0, 0, .72); color: #fff; }
.badge-sale { background: var(--accent); color: #fff; }
.badge-warn { background: #f2c94c; color: #2b2100; }

.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.product-photo { padding: 0; overflow: hidden; aspect-ratio: 1; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { margin: 8px 0 4px; }
.brand { color: var(--muted); margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 0 0 18px; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.facts dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 750; }
.buy-box { display: flex; gap: 12px; align-items: flex-end; }
.qty-label { width: 110px; }
.stock-note { color: var(--ok); font-weight: 600; font-size: .9rem; margin-top: 10px; }
.stock-note.low { color: var(--warn); }
.description { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }

/* Cart & checkout */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.two-col.wide-left { grid-template-columns: minmax(0, 1fr) 340px; }
.summary { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.summary h2 { margin: 0; }
.cart-lines { padding: 6px 20px; }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) 80px 90px 36px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { border-radius: 10px; width: 72px; height: 72px; object-fit: cover; }
.cart-line.unavailable img { opacity: .4; }
.cart-line-name { font-weight: 700; color: var(--text); }
.cart-line-total { font-weight: 750; text-align: right; }
.qty-form input { text-align: center; padding: 8px; }
.totals { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; font-size: 1.15rem; font-weight: 800; }
.totals .grand dt { color: var(--text); }
.limits { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.limits h3 { font-size: .9rem; margin-bottom: 8px; }
.limit-row + .limit-row { margin-top: 10px; }
.limit-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; }
.limit-row.over .limit-label { color: var(--danger); }
progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 99px; background: var(--border); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--border); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 99px; }
.limit-row.over progress::-webkit-progress-value { background: var(--danger); }
.limit-row.over progress::-moz-progress-bar { background: var(--danger); }
.mini-lines { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: .93rem; }
.radio-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.radio-card { display: flex; flex-direction: row; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; font-weight: 500; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card span { display: flex; flex-direction: column; flex: 1; }
.id-note { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; margin: 0; }

/* Order tracking */
.tracker { list-style: none; margin: 0; padding: 24px; display: flex; flex-direction: column; }
.step { display: flex; gap: 16px; position: relative; padding-bottom: 22px; color: var(--muted); }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.step.done::before { background: var(--primary); }
.step.current + .step::before, .step.current::before { background: var(--border); }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); flex: none; position: relative; z-index: 1; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--primary); border-color: var(--primary); }
.step.done .dot::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--primary-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.step.current .dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 20%, transparent); }
.step.current strong { color: var(--primary); }
.step small { display: block; }
.track-card.cancelled { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.live-note { margin-top: -6px; }
.kv { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kv div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Account */
.auth { max-width: 460px; margin: 20px auto; padding: 28px; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.order-row:hover { text-decoration: none; background: var(--surface-2); }
.order-row small { display: block; }
.order-row-end { display: flex; align-items: center; gap: 12px; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 24px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* Status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.pill-pending_payment { background: var(--warn-soft); color: var(--warn); }
.pill-placed { background: var(--info-soft); color: var(--info); }
.pill-packing { background: var(--warn-soft); color: var(--warn); }
.pill-ready { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.pill-on_the_way { background: var(--primary-soft); color: var(--primary); }
.pill-delivered { background: var(--primary); color: var(--primary-ink); }
.pill-cancelled { background: var(--danger-soft); color: var(--danger); }
.pay-paid { background: var(--primary-soft); color: var(--primary); }
.pay-unpaid { background: var(--info-soft); color: var(--info); }
.pay-pending, .pay-refund_due { background: var(--warn-soft); color: var(--warn); }

/* Admin */
.admin-body { background: var(--bg); }
.admin-nav { display: flex; gap: 4px; align-items: center; overflow-x: auto; margin: -8px 0 24px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; scrollbar-width: none; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text); font-weight: 600; white-space: nowrap; font-size: .92rem; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.active { background: var(--primary); color: var(--primary-ink); }
.admin-role { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; padding: 0 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-off td { opacity: .55; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.thumb-lg { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; flex: none; }
.photo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }
.inline-search input { border-radius: 999px; min-width: 220px; }
.adjust-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.adjust-form input, .adjust-form select { width: auto; padding: 6px 8px; font-size: .88rem; }
.adjust-form input[name="amount"] { width: 76px; }
.adjust-form input[name="note"] { width: 130px; }
.category-head, .category-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 64px 56px 48px 70px; gap: 8px; align-items: center; }
.category-head { padding: 0 34px 8px 0; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 4px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.category-form input, .category-form select { padding: 7px 9px; }
.category-form label.check { justify-content: center; }
.row-menu summary { cursor: pointer; font-weight: 600; list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary::after { content: " ▾"; color: var(--muted); }
.row-menu-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; min-width: 190px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.action-card { border: 2px solid var(--primary); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.history li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .86rem; }
.bar-val { font-variant-numeric: tabular-nums; text-align: right; }

/* Order board */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.board-col h2 { font-size: .95rem; display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 4px; }
.count { background: var(--surface); border-radius: 999px; padding: 1px 9px; font-size: .8rem; }
.order-card { padding: 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: none; }
.order-card p { margin: 0; }
.order-card-head { display: flex; justify-content: space-between; color: var(--text); }
.order-card-name { font-weight: 600; }
.order-card form, .order-card .btn { margin-top: 8px; }
.board-empty { text-align: center; padding: 20px 0; }

/* Packing slip */
.slip-body { background: #fff; color: #000; }
.slip { max-width: 760px; margin: 0 auto; padding: 32px 24px; }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
.slip-store { font-size: 1.3rem; }
.slip-number { font-size: 1.8rem; font-weight: 800; }
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.slip-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 4px; }
.slip-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.slip-table th, .slip-table td { border-bottom: 1px solid #999; padding: 8px 6px; text-align: left; }
.slip-total { font-size: 1.2rem; font-weight: 800; text-align: right; }
.slip-id { margin-top: 28px; }
@media print { .no-print { display: none; } .slip { padding: 0; } }

/* Responsive */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 36px; }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .summary { position: static; }
  .product-page { grid-template-columns: 1fr; gap: 20px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(4, minmax(240px, 80vw)); }
}
@media (max-width: 640px) {
  .header-row { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .header-links { gap: 12px; font-size: .92rem; }
  .hide-sm { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-body { padding: 10px; }
  .product-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .product-foot .btn { width: 100%; }
  .cart-line { grid-template-columns: 56px minmax(0, 1fr) 64px 30px; grid-template-areas: "img info qty rm" "img total total total"; gap: 8px 10px; }
  .cart-line img { grid-area: img; width: 56px; height: 56px; }
  .cart-line-info { grid-area: info; }
  .qty-form { grid-area: qty; }
  .cart-line > form:last-child { grid-area: rm; }
  .cart-line-total { grid-area: total; text-align: left; }
  .filters label { min-width: 0; flex: 1 1 140px; }
  .buy-box { flex-wrap: wrap; }
  .kv div { grid-template-columns: 1fr; gap: 2px; }
  .history li { grid-template-columns: 1fr; gap: 0; }
  .category-head { display: none; }
  .category-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-role { display: none; }
  .slip-grid { grid-template-columns: 1fr; }
}

/* Sales, codes, bundles */
.price.on-sale { color: var(--danger); }
.price.on-sale .was { color: var(--muted); }
.badge-bundle { background: var(--primary); color: var(--primary-ink); }
.sale-note { color: var(--danger); font-weight: 650; font-size: .82rem; display: inline-block; }
.big-note { font-size: .95rem; margin: -6px 0 14px; }
.savings { color: var(--ok); font-weight: 700; margin: 0; text-align: right; }
.discount-line dt, .discount-line dd { color: var(--ok) !important; }
.code-form { display: flex; gap: 8px; }
.code-form input { padding: 8px 12px; text-transform: uppercase; }
.code-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: var(--radius-sm); padding: 10px 12px; border: 1px dashed var(--border); }
.code-box div { display: flex; flex-direction: column; }
.code-box strong { letter-spacing: .06em; }
.code-box small { font-size: .82rem; }
.code-box.ok { background: var(--primary-soft); border-color: var(--primary); }
.code-box.bad { background: var(--danger-soft); border-color: var(--danger); }
.code-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; }
.bundle-parts { display: block; }
.bundle-box { padding: 14px 16px; margin-bottom: 16px; }
.bundle-box h2 { font-size: 1rem; }
.bundle-box .mini-lines { margin: 0; }
.chip-deal { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }
.chip-deal.active { background: var(--danger); border-color: var(--danger); color: #fff; }
.picker-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.picker-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.picker-item[hidden] { display: none; }
.picker input[type="search"] { margin-bottom: 4px; }
[data-kind][hidden], [data-scope][hidden] { display: none; }
.radio-cards.horizontal { flex-direction: row; flex-wrap: wrap; }
.radio-cards.horizontal .radio-card { flex: 1 1 160px; }
.bundle-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bundle-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; }
.parts { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; }
.slip-bundle td { background: #f2f2f2; }
.danger-row { margin-top: 20px; }
.promo-live { background: var(--primary-soft); color: var(--primary); }
.promo-scheduled { background: var(--info-soft); color: var(--info); }
.promo-ended, .promo-off { background: var(--surface-2); color: var(--muted); }
.stat small { font-size: .8rem; }

.card dl + h3, .card form + h3, .card ul + h3 { margin-top: 16px; }
.filters label.check { display: flex; }
.qty-label select { margin-top: 6px; }
