/* XSoft storefront. Concept: "spec plate" — calm cool-grey paper, cobalt for actions, amber for price signals,
   product facts set like a technical rating plate. Brand colours are overridden by /api/theme.css from the admin panel. */

:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eceef3;
  --surface-3: #e2e5ec;
  --ink: #161c2b;
  --ink-2: #4b5468;
  --ink-3: #6b7387;
  --line: #d9dde5;
  --line-strong: #c3c9d4;
  --brand: #2f45d8;
  --on-brand: #ffffff;
  --brand-soft: #e7eafb;
  --accent: #f2b705;
  --on-accent: #10131a;
  --ok: #1d7a4e;
  --ok-soft: #e2f3ea;
  --danger: #b8322a;
  --danger-soft: #fbe9e7;
  --shadow: 0 1px 2px rgba(22, 28, 43, 0.06), 0 8px 24px -12px rgba(22, 28, 43, 0.18);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e121b;
  --surface: #161b27;
  --surface-2: #1d2331;
  --surface-3: #262d3e;
  --ink: #e8ebf2;
  --ink-2: #b0b7c7;
  --ink-3: #8d95a8;
  --line: #2b3244;
  --line-strong: #3a4256;
  --ok: #5cc996;
  --ok-soft: #173326;
  --danger: #ff8a7f;
  --danger-soft: #3a1d1b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--header-h) + 56px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 0.75em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: var(--on-brand); }
.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; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 24px; } }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: var(--r); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- icons & buttons ---------- */
.i { flex: none; }
.icon-btn, .tool, .chip, .fav, .tree-toggle, .seg-item, .option, .check, .quick-row a, .tree-row a, .link-btn { touch-action: manipulation; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
  touch-action: manipulation; user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 86%, var(--ink)); }
.btn-quiet { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-strong); }
.btn-done { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-done:hover { background: color-mix(in srgb, var(--brand-soft) 80%, var(--brand)); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-soft) 75%, var(--danger)); }
.btn-lg { min-height: 52px; font-size: 16px; padding: 0 22px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-brand); border-right-color: transparent; animation: spin 0.7s linear infinite; }
.btn-quiet.is-busy::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-price { font-variant-numeric: tabular-nums; padding-left: 10px; margin-left: 2px; border-left: 1px solid color-mix(in srgb, var(--on-brand) 35%, transparent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 0; color: var(--brand); font-weight: 600; min-height: 44px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row {
  display: grid; align-items: center; gap: 8px 6px; padding-block: 10px;
  grid-template-columns: auto 1fr auto; grid-template-areas: "toggle logo tools" "search search search";
}
.catalog-toggle { grid-area: toggle; }
.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; min-height: 44px; }
.logo-mark { flex: none; width: 34px; height: 34px; }
.logo-bg { fill: var(--brand); }
.logo-x { stroke: var(--on-brand); stroke-width: 3.2; stroke-linecap: round; }
.logo-img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
@media (max-width: 359px) { .logo-word { display: none; } }
.logo-word { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.search { grid-area: search; position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 110px 0 44px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 16px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search-btn { position: absolute; right: 4px; height: 40px; min-height: 40px; border-radius: 9px; padding: 0 16px; }
.tools { grid-area: tools; display: flex; align-items: center; gap: 0; }
@media (min-width: 640px) { .header-row { column-gap: 12px; } .tools { gap: 2px; } }
.tool {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 42px; height: 48px; padding: 0 4px; border-radius: var(--r); border: 0; background: transparent;
  color: var(--ink-2); text-decoration: none; font-size: 11.5px; font-weight: 500; line-height: 1;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tool:hover { background: var(--surface-2); color: var(--ink); }
.tool-label { display: none; }
.count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.count.bump { animation: bump 0.35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
.quick { border-top: 1px solid var(--line); }
.quick-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.quick-row .i { color: var(--ink-3); }
.quick-row a[aria-current="page"] .i { color: var(--brand); }
.quick-row::-webkit-scrollbar { display: none; }
.quick-row a {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.quick-row a:hover { background: var(--surface-2); color: var(--ink); }
.quick-row a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
@media (min-width: 640px) { .tool-label { display: block; } .tool { min-width: 60px; } }
@media (min-width: 1024px) {
  .header-row { grid-template-columns: auto minmax(320px, 1fr) auto; grid-template-areas: "logo search tools"; gap: 24px; padding-block: 12px; }
  .catalog-toggle { display: none; }
}

/* ---------- search suggestions ---------- */
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px;
  overscroll-behavior: contain;
}
.suggest-group { padding: 8px 10px 4px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); min-height: 44px; }
.suggest-item img { width: 44px; height: 33px; object-fit: contain; background: var(--surface-2); border-radius: 6px; flex: none; }
.suggest-item .s-name { flex: 1; min-width: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item .s-price { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
.suggest-item[aria-selected="true"], .suggest-item:hover { background: var(--surface-2); }
.suggest-all { display: flex; justify-content: center; margin-top: 4px; padding: 12px; border-top: 1px solid var(--line); color: var(--brand); font-weight: 600; text-decoration: none; border-radius: 0 0 8px 8px; }
.suggest-all[aria-selected="true"], .suggest-all:hover { background: var(--brand-soft); }
.suggest-hint { padding: 10px 12px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- shell & sidebar ---------- */
.shell { flex: 1; padding-block: 16px 48px; }
.shell.has-sidebar { display: block; }
main { min-width: 0; outline: none; }
@media (min-width: 1024px) {
  .shell.has-sidebar { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
}
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(340px, 88vw); background: var(--surface);
  border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform 0.25s var(--ease);
  display: flex; flex-direction: column; overflow: hidden; visibility: hidden; overscroll-behavior: contain;
}
.sidebar.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { font-weight: 650; font-size: 17px; }
.shade { position: fixed; inset: 0; z-index: 55; border: 0; background: rgba(10, 12, 18, 0.45); opacity: 0; transition: opacity 0.2s; }
.shade.on { opacity: 1; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: calc(var(--header-h) + 64px); inset: auto; z-index: 1; width: auto; transform: none; visibility: visible; max-height: calc(100dvh - var(--header-h) - 84px); border: 1px solid var(--line); border-radius: var(--r-lg); transition: none; }
  .drawer-head { display: none; }
  .shade { display: none; }
}
.tree { overflow-y: auto; padding: 10px; flex: 1; scrollbar-width: thin; overscroll-behavior: contain; }
.tree-all { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; font-weight: 600; text-decoration: none; min-height: 44px; }
.tree-all:hover { background: var(--surface-2); }
.tree-all[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.tree-search { position: relative; margin: 4px 0 8px; color: var(--ink-3); }
.tree-search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }
.tree-search input { width: 100%; height: 40px; padding: 0 10px 0 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14.5px; }
.tree-search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-row a .i { color: var(--ink-3); margin-right: 10px; }
.tree-row a[aria-current="page"] .i { color: var(--brand); }
.tree-list .tree-list { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.tree-row { display: flex; align-items: center; border-radius: 8px; }
.tree-row:hover { background: var(--surface-2); }
.tree-row a { flex: 1; padding: 9px 10px; text-decoration: none; font-size: 14.5px; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; }
.tree-row a:hover { color: var(--ink); }
.tree-row a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tree-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-3); border-radius: 8px; }
.tree-toggle:hover { color: var(--ink); background: var(--surface-3); }
.tree-toggle .i { transition: transform 0.2s var(--ease); }
.tree-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
.tree-empty { padding: 8px 10px; font-size: 14px; }

/* ---------- page parts ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; font-size: 13.5px; color: var(--ink-3); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; padding: 0 2px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; }
.page-head h1 { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.8rem); letter-spacing: -0.03em; }
.lead { color: var(--ink-2); max-width: 70ch; margin-bottom: 16px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: border-color 0.15s, background-color 0.15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip img { width: 24px; height: 24px; object-fit: contain; }
.chips-lg .chip { min-height: 46px; padding: 8px 18px; font-size: 15.5px; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13.5px; font-weight: 600; }
.understood { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 14px; }
.note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink-2); font-size: 14.5px; margin-bottom: 12px; }
.note .i { margin-top: 2px; color: var(--brand); }
.note-ok { background: var(--ok-soft); color: var(--ink); }
.note-ok .i { color: var(--ok); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-2); }
.empty .i { color: var(--ink-3); }
.empty h1, .empty h2 { font-size: 1.3rem; color: var(--ink); }
.empty p { max-width: 46ch; }

/* ---------- toolbar & filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 16px; }
.filters { flex: 1 1 100%; order: 2; }
.filters summary { list-style: none; width: fit-content; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary .count { position: static; margin-left: 2px; }
.filters-panel { margin-top: 10px; display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
@media (min-width: 768px) { .filters-panel { grid-template-columns: 2fr 1fr; } .filters-panel > .check, .filters-actions { grid-column: 1 / -1; } }
.filters fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.filters legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.range { display: flex; align-items: center; gap: 8px; }
.range input { width: 100%; }
.filters-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar > .filters { order: 0; flex: 0 1 auto; }
.toolbar > .filters[open] { flex-basis: 100%; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); margin-left: auto; }
select, input[type="text"], input[type="search"]:not(#q):not(#tree-filter), input[type="number"], input[type="email"], input[type="tel"], input[type="password"], input[type="url"], textarea {
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: 16px; color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
select { padding-right: 34px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.5; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; min-height: 32px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.consent { font-size: 14px; color: var(--ink-2); margin: 4px 0 14px; }
.consent a { color: var(--brand); }

/* ---------- product grid & card ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; } }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
/* Product photos sit on a quiet "bench": a fine engineering dot grid, the store's second signature. */
.card-media, .pg-stage {
  position: relative; z-index: 1; background-color: var(--surface-2);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px);
  background-size: 14px 14px; background-position: 7px 7px;
}
.card-media { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); }
.g-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.g-track::-webkit-scrollbar { display: none; }
.g-track > img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; padding: 11%; scroll-snap-align: center; scroll-snap-stop: always; user-select: none; -webkit-user-drag: none; }
.g-nav {
  position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px;
  border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink);
  opacity: 0; transform: scale(0.9); transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), background-color 0.15s;
  box-shadow: 0 1px 3px rgba(22, 28, 43, 0.12); touch-action: manipulation;
}
.g-nav:hover { background: var(--surface); border-color: var(--line-strong); }
.g-prev { left: 8px; } .g-next { right: 8px; }
.card:hover .g-nav, .card-media:focus-within .g-nav, .pg .g-nav { opacity: 1; transform: none; }
.g-dots { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.g-dots i { width: 6px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 25%, transparent); transition: width 0.2s var(--ease), background-color 0.2s; }
.g-dots i.on { width: 16px; background: var(--brand); }
@media (hover: none) { .card .g-nav { display: none; } }
.card-fav { position: absolute; top: 8px; right: 8px; z-index: 2; }
.fav {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3); transition: color 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.fav:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.fav[aria-pressed="true"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.fav.pop .i { animation: pop 0.4s var(--ease); }
@keyframes pop { 30% { transform: scale(1.35); } 60% { transform: scale(0.92); } }
.fav-lg { width: 52px; height: 52px; border-radius: var(--r); }
.card-flags { position: absolute; z-index: 2; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 64px); }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.flag-digital { color: var(--brand); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
@media (min-width: 640px) { .card-body { padding: 14px 16px 16px; } }
.card-brand { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-title a:hover { color: var(--brand); }
.card .fav, .card .btn { position: relative; z-index: 1; }
.card .card-fav { position: absolute; }
/* The spec plate: the store's signature. */
.plate { margin: 2px 0 0; padding: 0; font-size: 12.5px; display: grid; }
/* Spec rows read like a printed spec sheet: label, dotted leader, value. */
.plate > div { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; min-width: 0; }
.plate > div::after { content: ""; order: 2; flex: 1 1 8px; min-width: 8px; border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.plate dt { order: 1; color: var(--ink-3); flex: none; }
.plate dd { order: 3; margin: 0; text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 62%; }
.plate-lg { font-size: 15px; padding: 10px 16px; margin: 14px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.plate-lg dd { max-width: 70%; }
.plate-lg > div { padding: 7px 0; }
.plate-lg dd { white-space: normal; }
@media (max-width: 479px) { .card .plate > div:nth-child(n+3) { display: none; } .card .plate { font-size: 12px; } .card .plate dd { max-width: 58%; } }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.price-now { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.old { color: var(--ink-3); font-size: 14px; }
.off { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.card-add { width: 100%; }
.card-add.btn-primary { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.card-add.btn-primary:hover:not(:disabled) { background: var(--brand); color: var(--on-brand); }
.card-add.btn-done { background: transparent; }
.l-short { display: none; }
@media (max-width: 479px) { .card-add { padding: 0 8px; gap: 6px; } .card-add .l-full { display: none; } .card-add .l-short { display: inline; } }
.banner { grid-column: 1 / -1; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.banner img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; }
.pager { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 24px; }
.pager-note { text-align: center; margin-top: 20px; font-size: 14px; }
.skeleton .ghost { min-height: 320px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 900px) { .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; } }
.pg { min-width: 0; outline: none; }
@media (min-width: 900px) { .pg { position: sticky; top: calc(var(--header-h) + 72px); } }
.pg-stage { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pg-stage .g-track > img { padding: 9%; }
.pg .g-nav { width: 44px; height: 44px; margin-top: -22px; }
.pg-count { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pg:focus-visible .pg-stage { outline: 3px solid var(--brand); outline-offset: 2px; }
.pg-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pg-thumb { flex: none; width: 76px; height: 57px; padding: 0; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); overflow: hidden; touch-action: manipulation; }
.pg-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pg-thumb:hover { border-color: var(--line-strong); }
.pg-thumb[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.product-main h1 { font-family: var(--font); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 10px; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14.5px; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.stock.ok { color: var(--ok); }
.stock.no { color: var(--ink-3); }
.stars { display: inline-flex; gap: 1px; color: var(--accent); }
.stars-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); }
.config { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 6px; margin: 16px 0; background: var(--surface); }
.config legend { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; padding: 0 6px; margin-left: -6px; }
.config > p { font-size: 14px; margin-bottom: 10px; }
.config-group { margin-bottom: 14px; }
.config-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item span {
  display: flex; flex-direction: column; gap: 2px; min-height: 52px; justify-content: center; padding: 8px 14px; border-radius: var(--r);
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.seg-item small { font-weight: 500; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg-item:hover span { border-color: var(--ink-3); }
.seg-item input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg-item input:checked + span small { color: var(--brand); }
.seg-item input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.buy { margin-top: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.price-lg .price-now { font-size: 30px; }
.price-lg .old { font-size: 16px; }
.price-lg.flash .price-now { animation: flash 0.5s var(--ease); }
@keyframes flash { 30% { color: var(--brand); } }
.saving { color: var(--ok); font-weight: 600; font-size: 14px; margin: 4px 0 0; }
.buy-actions { display: flex; gap: 10px; margin-top: 14px; }
.buy-actions .btn { flex: 1; }
.product-details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 36px; }
@media (min-width: 900px) { .product-details { grid-template-columns: 1.1fr 1fr; } }
.prose { max-width: 72ch; color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.prose p, .prose li { margin-bottom: 0.6em; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 0; }
.spec-table th { font-weight: 500; color: var(--ink-3); width: 42%; }
.spec-table td { font-variant-numeric: tabular-nums; }
.reviews { max-width: 820px; }
.review-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.review-list li { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-form summary { list-style: none; width: fit-content; }
.review-form summary::-webkit-details-marker { display: none; }
.review-form form { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); max-width: 560px; }
.rate { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { cursor: pointer; color: var(--line-strong); padding: 6px; border-radius: 6px; }
.rate label:hover, .rate label:hover ~ label, .rate input:checked ~ label { color: var(--accent); }
.rate input:checked ~ label .i, .rate label:hover .i, .rate label:hover ~ label .i { fill: currentColor; }
.rate input:focus-visible + label { outline: 3px solid var(--brand); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; border: 0; padding: 0; }
.field > label, .field > legend { font-size: 14.5px; font-weight: 600; padding: 0; }
.field-row { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 13px; color: var(--ink-3); }
.field-error { color: var(--danger); font-size: 13.5px; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent) !important; }
.form-msg { margin: 10px 0 0; font-size: 14.5px; font-weight: 500; }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin-top: 4px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px; }
.ac-list [role="option"] { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.ac-list [role="option"]:hover, .ac-list [aria-selected="true"] { background: var(--surface-2); }

/* ---------- cart & checkout ---------- */
.cart-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 960px) { .cart-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; } }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; grid-template-areas: "img info del" "img qty sum"; gap: 8px 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.line img { grid-area: img; width: 72px; height: 54px; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.line-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.line-info a { font-weight: 600; font-size: 15px; text-decoration: none; }
.line-info a:hover { color: var(--brand); }
.line .stepper { grid-area: qty; }
.line-sum { grid-area: sum; font-variant-numeric: tabular-nums; text-align: right; }
.line > .icon-btn { grid-area: del; justify-self: end; }
@media (min-width: 720px) {
  .line { grid-template-columns: 96px 1fr auto 120px 44px; grid-template-areas: "img info qty sum del"; }
  .line img { width: 96px; height: 72px; }
}
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.stepper .icon-btn { width: 44px; height: 44px; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; gap: 14px; }
@media (min-width: 960px) { .summary { position: sticky; top: calc(var(--header-h) + 72px); } }
.summary h2 { font-size: 1.1rem; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.summary-row strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.mini-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.mini-lines li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mini-lines li > span:first-child { display: flex; flex-direction: column; }
.mini-lines li > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout { display: grid; gap: 16px; }
.step { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 16px 18px 6px; margin: 0; min-width: 0; }
.step legend { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; padding: 0 6px; margin-left: -6px; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 700; }
.options { display: grid; gap: 8px; margin-bottom: 14px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option-body { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); transition: border-color 0.15s var(--ease), background-color 0.15s; }
.option-body > span { display: flex; flex-direction: column; gap: 2px; }
.option-body small { color: var(--ink-3); font-size: 13.5px; }
.option-body .i { margin-top: 1px; color: var(--ink-3); }
.option:hover .option-body { border-color: var(--ink-3); }
.option input:checked + .option-body { border-color: var(--brand); background: var(--brand-soft); }
.option input:checked + .option-body .i { color: var(--brand); }
.option input:focus-visible + .option-body { outline: 3px solid var(--brand); outline-offset: 2px; }
.callback { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); max-width: 640px; }
.callback h2 { margin-bottom: 4px; }

/* ---------- order page ---------- */
.order-body { display: grid; gap: 16px; align-content: start; }
.status-line { font-size: 17px; margin: 0; }
.keys, .pay-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.keys h2, .pay-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.keys ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.keys li { display: grid; gap: 6px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; background: var(--surface-2); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.upload { position: relative; cursor: pointer; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- info pages ---------- */
.info { font-size: 16.5px; }
.contact-grid { display: grid; gap: 10px; margin-bottom: 20px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); }
a.contact:hover { border-color: var(--brand); }
.contact .i { color: var(--brand); margin-top: 2px; }
.contact span { display: flex; flex-direction: column; }
.contact small { color: var(--ink-3); font-size: 13px; }

.faq { margin-top: 28px; }
.faq h2 { margin-bottom: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--ink); min-height: 48px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 16px 6px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 32px 20px; margin-top: auto; }
.footer-facts { display: grid; gap: 14px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .footer-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.footer-facts div { display: flex; align-items: flex-start; gap: 12px; }
.footer-facts .i { color: var(--brand); margin-top: 2px; }
.footer-facts strong { display: block; font-size: 15px; }
.footer-facts span { color: var(--ink-3); font-size: 14px; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: 15px; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer li a, .footer-contacts li { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.site-footer li a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .logo { margin-bottom: 8px; }
.footer-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; }

/* ---------- toasts & dialogs ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--r-lg); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 15px; pointer-events: auto; animation: toast-in 0.25s var(--ease); }
.toast .i { flex: none; }
.icon-btn, .tool, .chip, .fav, .tree-toggle, .seg-item, .option, .check, .quick-row a, .tree-row a, .link-btn { touch-action: manipulation; }
.toast.ok .i { color: #6ee7a8; }
.toast.err .i { color: #ff9b91; }
[data-theme="dark"] .toast.ok .i { color: var(--ok); }
.toast span { flex: 1; }
.toast a, .toast button { color: inherit; font-weight: 650; background: none; border: 0; padding: 8px; margin: -8px -4px -8px 0; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.toast.out { animation: toast-out 0.18s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
dialog { overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 12, 18, 0.5); }
.dialog-body { padding: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-body .callback { margin: 0; padding: 0; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (hover: none) { .card:hover { box-shadow: none; } }
@media print { .site-header, .site-footer, .sidebar, .toasts { display: none; } }
