/* Wisecheck storefront — светлая витрина магазина одного продавца.
   Шрифт: Golos Text (OFL, @fontsource-variable/golos-text). Иконки: Lucide (ISC). */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/golos-text-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/golos-text-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("../fonts/golos-text-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --surface-3: #e9e6df;
  --line: #e5e2dc;
  --line-strong: #d3cfc6;
  --ink: #15171c;
  --ink-2: #3a3e47;
  --muted: #6b707b;
  --faint: #9a9ea7;
  --brand: #1f46d1;
  --brand-hover: #1838ad;
  --brand-press: #142f92;
  --brand-soft: #ebf0ff;
  --brand-soft-2: #dde6ff;
  --brand-ink: #1736a3;
  --ok: #1d7a4c;
  --ok-soft: #e7f5ee;
  --warn: #9a5b00;
  --danger: #c2341d;
  --danger-soft: #fdeeea;
  --focus: 0 0 0 3px rgba(31, 70, 209, .28);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(21, 23, 28, .05);
  --shadow-2: 0 8px 24px -8px rgba(21, 23, 28, .16), 0 2px 6px rgba(21, 23, 28, .05);
  --shadow-3: 0 24px 64px -16px rgba(21, 23, 28, .28);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1360px;
  --gutter: clamp(12px, 3vw, 28px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 140px; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.has-cartbar { padding-bottom: 84px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { background: var(--brand-soft-2); }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--brand-ink); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; min-height: 32px;
}
.link-btn:hover { color: var(--brand); }
.spinner { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Top strip & header ---------- */
.topbar { background: var(--ink); color: #d9dbe0; font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.topbar p { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .i { width: 15px; height: 15px; color: #9fb4ff; }
.topbar-domain { color: #fff; font-weight: 600; }

.header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.header.is-scrolled { box-shadow: 0 6px 18px -12px rgba(21, 23, 28, .25); }
.header-row {
  display: grid; align-items: center; gap: 12px 16px; min-height: var(--header-h);
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "brand catalog search cart";
}
.wordmark {
  grid-area: brand; justify-self: start; display: inline-flex; align-items: baseline; text-decoration: none;
  font-size: 26px; font-weight: 750; letter-spacing: -.035em; line-height: 1; color: var(--ink);
  padding: 6px 2px; border-radius: 6px;
}
.wordmark span { color: var(--brand); }
.wordmark small { margin-left: 2px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--faint); }
.catalog-btn { grid-area: catalog; padding: 0 16px 0 14px; }

.search { grid-area: search; position: relative; display: flex; align-items: center; min-width: 0; }
.search-field {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center;
  height: 46px; border: 2px solid var(--brand); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface);
}
.search-field > .i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 100%; min-width: 0; border: 0; background: transparent; outline: none;
  padding: 0 44px 0 42px; font-size: 16px; border-radius: 10px 0 0 10px;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search-field:focus-within { box-shadow: var(--focus); }
.search-clear { position: absolute; right: 2px; width: 40px; height: 40px; }
.search-submit { height: 46px; min-height: 46px; border-radius: 0 10px 10px 0; padding: 0 20px; }
.recent {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
  padding: 6px;
}
.recent-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px 10px; font-size: 13px; color: var(--muted); }
.recent-head .link-btn { font-size: 13px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--r-sm); background: none; text-align: left;
}
.recent-item:hover, .recent-item:focus-visible { background: var(--surface-2); }
.recent-item .i { color: var(--faint); width: 18px; height: 18px; }

.cart-btn {
  grid-area: cart; position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 14px 0 12px; border-radius: 10px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, background-color .15s;
}
.cart-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.cart-btn-text { display: grid; line-height: 1.15; }
.cart-btn-label { font-weight: 600; font-size: 14px; }
.cart-btn-sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-badge {
  position: absolute; top: 4px; left: 24px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface); font-variant-numeric: tabular-nums;
}
.cart-badge.bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* Category strip */
.cats { border-top: 1px solid var(--line); background: var(--surface); }
.cats-scroller { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; scroll-padding: 0 var(--gutter); }
.cats-scroller::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-2); white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip .i { width: 17px; height: 17px; color: var(--muted); }
.chip:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-current="page"] .i { color: #fff; }
.chip-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chip[aria-current="page"] .chip-count { color: #b9bcc5; }
.chip-skel { width: 110px; border-color: transparent; background: var(--surface-2); }

/* ---------- Intro ---------- */
.intro { margin-top: 20px; }
.intro-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 236px;
}
.intro-text { padding: clamp(20px, 3vw, 34px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--brand-ink); letter-spacing: .02em; }
.intro h1 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.12; letter-spacing: -.025em; font-weight: 750; max-width: 22ch; text-wrap: balance; }
.intro-lead { color: var(--ink-2); max-width: 54ch; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.steps li { display: flex; align-items: center; gap: 8px; }
.step-n {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 700;
}
.intro-media { position: relative; background: #eceeef; min-height: 200px; }
.intro-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% 45%; }

/* ---------- Catalog ---------- */
.catalog { padding-top: 22px; padding-bottom: 48px; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.toolbar h2 { font-size: 22px; letter-spacing: -.02em; font-weight: 700; overflow-wrap: anywhere; }
.count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 6px 0 12px; max-width: 260px;
  border-radius: 999px; border: 1px solid var(--brand-soft-2); background: var(--brand-soft); color: var(--brand-ink);
  font-size: 14px; font-weight: 500;
}
.filter-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-pill .icon-btn { width: 30px; height: 30px; color: var(--brand-ink); border-radius: 50%; }
.filter-pill .icon-btn:hover { background: var(--brand-soft-2); }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 36px 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500;
}
.select-wrap .i { position: absolute; right: 10px; top: 50%; translate: 0 -50%; pointer-events: none; width: 16px; height: 16px; color: var(--muted); }
.select-wrap select:focus-visible { box-shadow: var(--focus); outline: none; }

.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); border-color: transparent; }
.card-media {
  text-decoration: none;
  position: relative; display: block; aspect-ratio: 1 / 1; margin: 6px 6px 0; border-radius: 9px;
  background: #fff; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform .35s var(--ease); }
.card:hover .card-media img { transform: scale(1.03); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; background: var(--surface-2); color: var(--faint); font-size: 12px; }
.noimg .i { width: 32px; height: 32px; stroke-width: 1.5; }
.card-flag {
  position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 6px;
  background: rgba(21, 23, 28, .78); color: #fff; font-size: 12px; font-weight: 600;
}
.card.is-out .card-media img { opacity: .55; filter: grayscale(.5); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.price { font-size: 19px; font-weight: 750; letter-spacing: -.015em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.price-none { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.card-title {
  font-size: 14px; line-height: 1.35; color: var(--ink); text-decoration: none; font-weight: 450;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
  overflow-wrap: anywhere;
}
.card-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.card-title:focus-visible { box-shadow: none; }
.card:has(.card-title:focus-visible) { box-shadow: var(--focus); }
.card-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stock-ok { color: var(--ok); }
.stock-low { color: var(--warn); }
.stock-out { color: var(--muted); }
.card-actions { position: relative; z-index: 1; margin-top: auto; padding-top: 8px; }
.card-actions .btn { width: 100%; min-height: 40px; font-size: 14px; }
.card-note { min-height: 40px; display: flex; align-items: center; font-size: 13px; color: var(--muted); }

.stepper {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 2px;
  border-radius: var(--r-sm); background: var(--brand-soft); min-height: 40px; padding: 2px;
}
.card-actions .stepper { width: 100%; }
.stepper button {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 7px;
  background: transparent; color: var(--brand-ink);
}
.stepper button:hover:not([disabled]) { background: var(--brand-soft-2); }
.stepper button[disabled] { color: var(--faint); cursor: not-allowed; }
.stepper button[aria-disabled="true"] { cursor: progress; }
.stepper output, .stepper input {
  min-width: 36px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-ink);
}
.stepper-val { display: grid; line-height: 1.1; text-align: center; font-size: 15px; }
.stepper-val small { font-size: 11px; font-weight: 500; color: var(--brand-ink); opacity: .8; }
.stepper.is-busy { opacity: .7; }
.stepper-outline { background: var(--surface); border: 1px solid var(--line-strong); }
.stepper-outline button, .stepper-outline .stepper-val { color: var(--ink); }
.stepper-outline button:hover:not([disabled]) { background: var(--surface-2); }

/* skeleton */
.skel { pointer-events: none; }
.skel .card-media, .skel-line { background: linear-gradient(90deg, var(--surface-2) 0%, #f7f5f1 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel-line { height: 12px; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* states */
.state {
  display: grid; justify-items: center; text-align: center; gap: 12px;
  padding: clamp(28px, 6vw, 56px) 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.state h2, .state h3 { font-size: 20px; letter-spacing: -.015em; font-weight: 700; max-width: 30ch; text-wrap: balance; }
.state p { color: var(--ink-2); max-width: 52ch; }
.state-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); color: var(--ink-2); }
.state-icon .i { width: 30px; height: 30px; stroke-width: 1.6; }
.state-icon.is-error { background: var(--danger-soft); color: var(--danger); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }

/* Empty store — главный экран, пока товаров нет */
.empty-store {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.empty-copy { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.empty-copy h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.03em; font-weight: 780; max-width: 16ch; text-wrap: balance; }
.empty-copy > p { color: var(--ink-2); max-width: 48ch; font-size: 16px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; align-items: center; }
.empty-checked { font-size: 13px; color: var(--muted); }
.empty-visual {
  position: relative; min-height: 300px; background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    #fbfaf8;
  border-left: 1px solid var(--line); display: grid; place-items: center; overflow: hidden;
}
.empty-visual::after { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, rgba(251, 250, 248, 0) 40%, #fbfaf8 100%); pointer-events: none; }
.shelf { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 92px); gap: 12px; }
.shelf-slot {
  height: 116px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, .7);
  display: grid; place-items: center; color: var(--faint);
}
.shelf-slot .i { width: 26px; height: 26px; stroke-width: 1.5; }
.shelf-slot.is-main { grid-column: 2; grid-row: 1 / span 2; height: auto; border-style: solid; border-color: var(--brand-soft-2); background: var(--surface); color: var(--brand); box-shadow: var(--shadow-2); }
.shelf-slot.is-main .i { width: 40px; height: 40px; }
.empty-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.empty-cats .chip { min-height: 34px; font-size: 13px; cursor: default; }
.empty-cats .chip:hover { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.owner-note {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px;
  border-radius: var(--r); background: var(--surface); border: 1px dashed var(--line-strong); color: var(--ink-2); font-size: 14px;
}
.owner-note .i { color: var(--brand); margin-top: 1px; }
.owner-note a { color: var(--brand-ink); font-weight: 600; text-underline-offset: 3px; }

/* pager */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.page-btn {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums;
}
.page-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.page-btn[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.page-gap { display: grid; place-items: center; min-width: 24px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 36px 0 24px; }
.footer .wordmark { font-size: 22px; padding: 0; }
.footer p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 42ch; }
.footer h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: .02em; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; text-decoration: none; color: var(--ink-2); font-size: 15px; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.footer-links .i { width: 17px; height: 17px; color: var(--muted); }
.footer-bottom { display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 16px 0 22px; font-size: 13px; color: var(--muted); }
.footer-bottom a { color: inherit; }

/* ---------- Mobile cart bar ---------- */
.cartbar {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: none; align-items: center; gap: 12px; animation: rise .25s var(--ease);
}
.cartbar-info { display: grid; line-height: 1.2; min-width: 0; }
.cartbar-info strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.cartbar-info span { font-size: 13px; color: var(--muted); }
.cartbar .btn { margin-left: auto; }
@keyframes rise { from { transform: translateY(100%); } }

/* ---------- Dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--surface); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(17, 19, 24, .48); }
dialog[open] { animation: fade .2s var(--ease); }
dialog[open]::backdrop { animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.dlg-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; min-height: 60px;
  padding: 8px 10px 8px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.dlg-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; flex: 1; min-width: 0; }
.dlg-head .count { margin-left: 6px; font-weight: 500; }

/* Drawer (cart, catalog) */
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; width: min(480px, 100vw);
  display: flex; flex-direction: column; box-shadow: var(--shadow-3);
}
.drawer:not([open]) { display: none; }
.drawer[open] { animation: slide-in .28s var(--ease); }
.drawer-left { inset: 0 auto 0 0; width: min(420px, 100vw); }
.drawer-left[open] { animation: slide-in-left .28s var(--ease); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-in-left { from { transform: translateX(-40px); opacity: 0; } }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); display: grid; gap: 10px; }

.cat-list { padding: 8px; display: grid; gap: 2px; }
.cat-link {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink);
}
.cat-link:hover { background: var(--surface-2); }
.cat-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.cat-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.cat-link[aria-current="page"] .cat-ico { background: #fff; color: var(--brand); }
.cat-link .chip-count { margin-left: auto; font-size: 13px; }
.cat-empty { padding: 24px 20px; color: var(--muted); }

/* Cart */
.steps-bar { display: flex; gap: 6px; align-items: center; padding: 12px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fcfbf9; }
.steps-bar li { display: flex; align-items: center; gap: 6px; }
.steps-bar li + li::before { content: ""; width: 18px; height: 1px; background: var(--line-strong); margin-right: 2px; }
.steps-bar .on { color: var(--ink); font-weight: 600; }
.steps-bar .on .step-n { background: var(--brand); color: #fff; }
.steps-bar .done .step-n { background: var(--ok-soft); color: var(--ok); }
.steps-bar .step-n { width: 22px; height: 22px; font-size: 11px; background: var(--surface-2); color: var(--muted); }

.lines { padding: 4px 20px; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line-media { width: 72px; height: 72px; border-radius: 10px; border: 1px solid var(--line); background: #fff; overflow: hidden; display: block; }
.line-media img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.line-media .noimg .i { width: 22px; height: 22px; }
.line-main { display: grid; gap: 4px; min-width: 0; }
.line-title { font-size: 14px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-title:hover { color: var(--brand); }
.line-unit { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.line-row .stepper { min-height: 36px; }
.line-row .stepper button { width: 36px; height: 36px; }
.line-total { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }
.line-remove { width: 36px; height: 36px; color: var(--muted); }
.line-remove:hover { color: var(--danger); background: var(--danger-soft); }
.line-warn { font-size: 12.5px; color: var(--danger); }
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.total-row span { color: var(--ink-2); }
.total-row strong { font-size: 22px; font-weight: 750; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.pay-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.pay-note .i { width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }

/* Checkout form */
.form { padding: 18px 20px 8px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--muted); }
.input, .textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:hover, .textarea:hover { border-color: #bdb8ae; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 12.5px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.err .i { width: 15px; height: 15px; margin-top: 2px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.check a { color: var(--brand-ink); text-underline-offset: 3px; }
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--danger-soft); color: #8e2412; font-size: 14px;
}
.alert .i { color: var(--danger); margin-top: 1px; }
.summary { margin: 4px 20px 0; border: 1px solid var(--line); border-radius: var(--r); background: #fcfbf9; }
.summary summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; font-size: 14px; }
.summary summary::-webkit-details-marker { display: none; }
.summary summary strong { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 15px; }
.summary summary .i { transition: transform .2s; color: var(--muted); width: 18px; height: 18px; }
.summary[open] summary .i { transform: rotate(180deg); }
.summary ul { padding: 0 14px 10px; display: grid; gap: 6px; font-size: 13px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.summary li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.summary li span:last-child { font-variant-numeric: tabular-nums; flex: none; }

.success { padding: 36px 24px; display: grid; justify-items: center; text-align: center; gap: 12px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.success-icon .i { width: 36px; height: 36px; }
.success h3 { font-size: 24px; letter-spacing: -.02em; font-weight: 750; }
.order-no { font-size: 15px; color: var(--ink-2); }
.order-no strong { white-space: nowrap; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.success p { color: var(--ink-2); max-width: 36ch; }

/* Product modal */
.pmodal {
  width: min(1080px, calc(100vw - 48px)); max-height: calc(100vh - 48px); margin: auto; border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-3);
}
.pmodal[open] { display: flex; flex-direction: column; animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.pmodal .dlg-head { border-bottom: 1px solid var(--line); }
.pmodal-body { overflow-y: auto; overscroll-behavior: contain; }
.pd { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; padding: 20px 24px 28px; }
.gallery { display: grid; gap: 10px; align-content: start; min-width: 0; }
.gallery-main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.gallery-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink); }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(21, 23, 28, .7); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 2px; }
.thumb { flex: none; width: 64px; height: 64px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.thumb[aria-current="true"] { border: 2px solid var(--brand); }
.pd-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brand-ink); text-decoration: none; font-weight: 500; min-height: 32px; width: fit-content; }
.crumb:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumb .i { width: 15px; height: 15px; }
.pd-title { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; overflow-wrap: anywhere; }
.pd-buy { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: #fcfbf9; }
.pd-price { font-size: 30px; font-weight: 780; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pd-price.price-none { font-size: 20px; }
.pd-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.pd-stock .i { width: 16px; height: 16px; }
.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pd-actions .stepper { min-height: 52px; }
.pd-actions .stepper button { width: 44px; height: 46px; }
.pd-actions .btn { flex: 1; min-width: 180px; }
.pd-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.pd-desc { white-space: pre-line; color: var(--ink-2); overflow-wrap: anywhere; }
.pd-desc.is-empty { color: var(--muted); }
.pd-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-tools .btn { min-height: 40px; font-size: 14px; }
.pd-skel { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 20px 24px 28px; }
.pd-skel .card-media { margin: 0; }

/* Toasts */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 20px; translate: -50% 0; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
body.has-cartbar .toasts { bottom: 92px; }
.toasts[popover] { inset: auto auto 20px 50%; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
body.has-cartbar .toasts[popover] { bottom: 92px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; min-height: 52px;
  border-radius: var(--r); background: var(--ink); color: #fff; box-shadow: var(--shadow-3); font-size: 14px; animation: toast-in .25s var(--ease);
}
.toast .i { color: #8fe3b6; }
.toast.is-error .i { color: #ff9f8a; }
.toast span { flex: 1; min-width: 0; }
.toast a, .toast button { color: #fff; font-weight: 600; background: rgba(255, 255, 255, .12); border: 0; border-radius: 7px; padding: 0 12px; min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.toast a:hover, .toast button:hover { background: rgba(255, 255, 255, .2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Responsive ---------- */
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .cart-btn-text { display: none; }
  .cart-btn { padding: 0 12px; }
}
@media (max-width: 980px) {
  .pd, .pd-skel { grid-template-columns: 1fr; gap: 18px; }
  .gallery { max-width: 560px; width: 100%; justify-self: center; }
}
@media (max-width: 860px) {
  :root { --header-h: auto; }
  .header-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    grid-template-areas: "brand brand cart" "catalog search search";
    padding-top: 8px; padding-bottom: 10px; gap: 8px 8px;
  }
  .wordmark { font-size: 24px; }
  .catalog-btn { padding: 0; width: 46px; height: 46px; min-height: 46px; }
  .catalog-btn span { display: none; }
  .cart-btn { min-height: 44px; border-color: transparent; }
  .search-submit { padding: 0 14px; }
  .topbar .topbar-left { display: none; }
  .topbar .container { justify-content: center; }
  .intro-card { grid-template-columns: 1fr; }
  .intro-media { min-height: 0; height: 150px; order: -1; }
  .empty-store { grid-template-columns: 1fr; }
  .empty-visual { min-height: 200px; border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .shelf { grid-template-columns: repeat(3, 70px); gap: 10px; }
  .shelf-slot { height: 80px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .cartbar { display: flex; }
  body:not(.has-cartbar) .cartbar { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-media { margin: 4px 4px 0; }
  .card-body { padding: 8px 10px 10px; }
  .price { font-size: 17px; }
  .card-title { font-size: 13.5px; }
  .card-actions .btn { padding: 0 8px; }
  .card-actions .btn .i { display: none; }
  .stepper button { width: 36px; }
  .intro { margin-top: 12px; }
  .intro-media { height: 120px; }
  .steps { display: grid; gap: 8px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { justify-content: space-between; }
  .sort > span { display: none; }
  .search-submit { display: none; }
  .search-field { border-right: 2px solid var(--brand); border-radius: 10px; }
  .search input { border-radius: 10px; }
  .pmodal { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
  .pmodal[open] { animation: slide-up .25s var(--ease); }
  .pd { padding: 14px 16px 24px; }
  .pd-actions .btn { min-width: 0; white-space: normal; line-height: 1.2; padding: 0 12px; font-size: 15px; }
  .pd-buy { padding: 14px; }
  .drawer, .drawer-left { width: 100vw; }
  .lines { padding: 0 16px; }
  .form { padding: 16px 16px 8px; }
  .summary { margin: 4px 16px 0; }
  .drawer-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .empty-copy h2 { font-size: 26px; }
}
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } }
@media (max-width: 380px) {
  .chip { padding: 0 12px; }
  .wordmark small { display: none; }
}

@media (hover: none) {
  .card:hover { box-shadow: none; border-color: var(--line); }
  .card:hover .card-media img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .skel .card-media, .skel-line { animation: none; }
}

@media print {
  .topbar, .header, .cartbar, .footer, .toasts { display: none !important; }
}

/* Public document pages reuse the storefront's card/gallery design. */
.breadcrumbs { padding-top: 22px; padding-bottom: 4px; font-size: 13px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.product-page { padding-top: 12px; padding-bottom: 40px; }
.product-page .pd { padding-left: 0; padding-right: 0; }
.demo-note { font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-2); background: var(--surface-2, #f7f7f7); }
.toolbar-title h1 { font-size: clamp(22px, 2.5vw, 30px); line-height: 1.15; letter-spacing: -.025em; }
[hidden] { display: none !important; }

.category-description { max-width: 800px; margin: 0 0 22px; color: var(--ink-2); line-height: 1.65; }
