/* ============================================================================
   RCL · дизайн-система v3
   Источники правил: ui-ux-pro-max (паттерн Marketplace, стиль Vibrant & Block-based, Rubik/Nunito Sans),
   jakubkrehel better-* (концентрические радиусы, тени вместо рамок, scale .96, рампы по ролям, шкала по ролям),
   Astryx (радиусы 8/12/16/32, четыре уровня высоты, 175/410/975 мс, cubic-bezier(.24,1,.4,1), данные строками),
   typeui fundamentals (4-pt сетка, три яруса отступов, заголовок→абзац 32px, контракт состояний кнопок,
   кнопка и поле в ряду одной высоты, липкая шапка + 96px до hero, ширина 1280, h1/h2 магазина ≤ 28px).
   Цвета: рампа от тела логотипа #9c2424, шаг 9 = заливка, интерполяция в OKLab (tools/ramps.py).
   ========================================================================== */

/* ---------- 1. Примитивы ---------- */
:root {
  --red-1:#fef9f8; --red-2:#fbf1f0; --red-3:#f7e5e2; --red-4:#f4d6d2; --red-5:#f2c5bf; --red-6:#edafa8;
  --red-7:#e2928a; --red-8:#d47169; --red-9:#9c2424; --red-10:#95312d; --red-11:#7a2825; --red-12:#3c0002;
  --gray-1:#fafafa; --gray-2:#f4f3f3; --gray-3:#eae9e9; --gray-4:#e0dddd; --gray-5:#d3d0cf; --gray-6:#c4bfbf;
  --gray-7:#afa9a8; --gray-8:#98908f; --gray-9:#706665; --gray-10:#5e5655; --gray-11:#4c4645; --gray-12:#1e1919;
  --green-9:#1f8a4c; --green-3:#dff3e6; --green-11:#176b3b;
  --amber-9:#c07a12; --amber-3:#fbeed3; --amber-11:#8a5709;
  --blue-9:#2b6cb0; --blue-3:#e3edf9; --blue-11:#1f4f82;

  /* ---------- 2. Семантические роли ---------- */
  --bg-page:#ffffff; --bg-surface:var(--gray-2); --bg-card:#ffffff; --bg-hover:var(--gray-3); --bg-active:var(--gray-4);
  --bg-inverse:var(--gray-12); --bg-accent:var(--red-9); --bg-accent-hover:var(--red-10); --bg-accent-active:var(--red-11);
  --bg-accent-soft:var(--red-2); --bg-accent-soft-hover:var(--red-3);
  --text:var(--gray-12); --text-2:var(--gray-11); --text-3:var(--gray-9); --text-disabled:var(--gray-7);
  --text-on-accent:#ffffff; --text-on-inverse:#ffffff; --text-accent:var(--red-11); --text-link:var(--red-11);
  --border:var(--gray-5); --border-strong:var(--gray-7); --border-accent:var(--red-8); --ring:var(--red-8);
  --status-ok:var(--green-9); --status-ok-bg:var(--green-3); --status-ok-text:var(--green-11);
  --status-low:var(--amber-9); --status-low-bg:var(--amber-3); --status-low-text:var(--amber-11);
  --status-info:var(--blue-9); --status-info-bg:var(--blue-3); --status-info-text:var(--blue-11);
  --status-none:var(--gray-8);

  /* ---------- 3. Шрифт: геометрическая шкала 16 × 1.2 ---------- */
  --font-heading:"Rubik", system-ui, sans-serif;
  --font-body:"Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:"JetBrains Mono", ui-monospace, Menlo, monospace;
  --fs-caption:13px; --fs-label:14px; --fs-body:16px; --fs-heading:19px; --fs-title:23px; --fs-h2:28px; --fs-section:33px; --fs-large:40px; --fs-h1:48px; --fs-display:58px;

  /* ---------- 4. Отступы: 4-pt сетка, ярусы ---------- */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px; --sp-12:48px; --sp-16:64px; --sp-24:96px;
  --container:1280px; --gutter:24px;

  /* ---------- 5. Форма (Astryx) ---------- */
  --r-inner:8px; --r-element:12px; --r-container:16px; --r-page:32px; --r-full:9999px;

  /* ---------- 6. Высота (Astryx уровни + тени better-ui) ---------- */
  --shadow-low:0 0 0 1px oklch(0 0 0 / .06), 0 1px 2px -1px oklch(0 0 0 / .06), 0 2px 4px 0 oklch(0 0 0 / .04);
  --shadow-low-hover:0 0 0 1px oklch(0 0 0 / .08), 0 1px 2px -1px oklch(0 0 0 / .08), 0 2px 4px 0 oklch(0 0 0 / .06);
  --shadow-med:0 0 0 1px oklch(0 0 0 / .05), 0 8px 16px -8px oklch(0 0 0 / .18), 0 4px 8px -4px oklch(0 0 0 / .08);
  --shadow-high:0 0 0 1px oklch(0 0 0 / .05), 0 24px 48px -16px oklch(0 0 0 / .28), 0 8px 16px -8px oklch(0 0 0 / .12);
  --shadow-accent:0 8px 20px -8px oklch(0.45 0.16 26 / .55);
  --img-outline:1px solid oklch(0 0 0 / .1);

  /* ---------- 7. Движение (Astryx + better-ui + typeui) ---------- */
  --ease:cubic-bezier(.24, 1, .4, 1); --ease-out:cubic-bezier(.2, 0, 0, 1); --ease-back:cubic-bezier(.34, 1.4, .64, 1);
  --d-hover:120ms; --d-press:100ms; --d-fast:175ms; --d-medium:410ms; --d-slow:975ms;
  --nav-h:112px;
}

/* ---------- Базовые ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body { margin: 0; background: var(--bg-page); color: var(--text); font: 400 var(--fs-body)/1.5 var(--font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-h2); line-height: 1.2; }             /* магазин: h1 ≤ 28px вне hero */
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3 { font-size: var(--fs-title); line-height: 1.25; }
h4 { font-size: var(--fs-heading); line-height: 1.3; }
.display { font-size: var(--fs-display); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }   /* только hero главной */
.section-title { font-size: var(--fs-large); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; } /* витрина главной */
h1 + p, h2 + p, h3 + p, h4 + p, .display + p, .section-title + p { margin-top: var(--sp-8); }  /* заголовок → абзац 32px */
p { margin: 0; max-width: 68ch; text-wrap: pretty; }
p + p { margin-top: var(--sp-4); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; transition: none; }
::selection { background: var(--red-4); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--sp-16); }
.section-lg { padding-block: var(--sp-24); }
.section-surface { background: var(--bg-surface); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-8); }
.section-head p { margin-top: var(--sp-2); color: var(--text-3); }
.muted { color: var(--text-3); } .text-2 { color: var(--text-2); }
.caption { font-size: var(--fs-caption); line-height: 1.4; } .label { font-size: var(--fs-label); line-height: 1.4; font-weight: 600; }
.row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.grid { display: grid; gap: var(--sp-6); }
.cols-2 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); }
@container (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.link { color: var(--text-link); font-weight: 600; text-underline-offset: 3px; text-decoration-thickness: from-font; }
.link:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Иконки: контур 1.5 у обычного текста, 2 у полужирного ---------- */
.i { width: 20px; height: 20px; flex: none; }
.i-s { width: 16px; height: 16px; flex: none; }

/* ---------- Кнопки: базовая высота 44, контракт состояний ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: 44px; padding-inline: var(--sp-4); border-radius: var(--r-element); border: 1px solid transparent; font-family: var(--font-heading); font-weight: 500; font-size: 15px; line-height: 1; white-space: nowrap; flex-shrink: 0; min-width: max-content; transition: background-color var(--d-hover) ease-out, color var(--d-hover) ease-out, border-color var(--d-hover) ease-out, box-shadow var(--d-hover) ease-out, translate var(--d-hover) ease-out, scale var(--d-press) ease-out; }
.btn:has(svg:first-child:not(:last-child)) { padding-inline-start: 14px; }   /* оптическое выравнивание с иконкой */
.btn:has(svg:last-child:not(:first-child)) { padding-inline-end: 14px; }
.btn svg { width: 18px; height: 18px; }
.btn:active { scale: .96; }
.btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; scale: 1 !important; translate: 0 !important; box-shadow: none !important; }
/* Primary: H1 затемнение + H2 подъём; A1 глубже + A4 сброс тени + scale */
.btn-primary { background: var(--bg-accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--bg-accent-hover); box-shadow: var(--shadow-accent); translate: 0 -1px; }
.btn-primary:active { background: var(--bg-accent-active); box-shadow: none; translate: 0; }
/* Secondary: H3 рамка → бренд + H4 подкраска; A6 подкраска гуще */
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--border-accent); background: var(--bg-accent-soft); color: var(--text-accent); }
.btn-secondary:active { background: var(--bg-accent-soft-hover); }
/* Ghost: H4 подкраска; A6 */
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-ghost:active { background: var(--bg-active); }
/* Inverse (на красном или тёмном блоке): белая заливка */
.btn-inverse { background: #fff; color: var(--text-accent); }
.btn-inverse:hover { background: var(--red-2); box-shadow: var(--shadow-med); translate: 0 -1px; }
.btn-inverse:active { background: var(--red-3); box-shadow: none; translate: 0; }
.btn-dark { background: var(--bg-inverse); color: var(--text-on-inverse); }
.btn-dark:hover { background: var(--gray-11); }
.btn-lg { height: 56px; padding-inline: var(--sp-6); font-size: 17px; border-radius: var(--r-element); }
.btn-sm { height: 36px; padding-inline: var(--sp-3); font-size: 14px; border-radius: var(--r-inner); }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }

/* ---------- Поля: высота 44 = кнопка, иконки с равным отступом ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field > label { font-size: var(--fs-label); font-weight: 600; }
.field .hint { font-size: var(--fs-caption); color: var(--text-3); }
.input, .select, .textarea { height: 44px; width: 100%; padding-inline: var(--sp-4); border: 1px solid var(--border-strong); border-radius: var(--r-element); background: var(--bg-card); color: var(--text); transition: border-color var(--d-hover) ease-out, box-shadow var(--d-hover) ease-out; }
.input::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-8); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red-9); box-shadow: 0 0 0 3px var(--red-4); }
.textarea { height: auto; min-height: 120px; padding-block: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-label); }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c4645' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-inline-start: 44px; }  /* 12 + 20 + 12 */
.input-row { display: flex; gap: var(--sp-3); }
.input-row .input { flex: 1; }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-label); cursor: pointer; min-height: 28px; }
.check input { width: 18px; height: 18px; accent-color: var(--red-9); margin: 0; }

/* ---------- Поиск: капсула 56, поле и кнопка одной высоты, концентрика 28 − 4 = 24 ---------- */
.search { position: relative; }
.search-box { display: flex; align-items: center; height: 56px; padding: 4px 4px 4px 20px; border-radius: 28px; background: var(--bg-card); box-shadow: var(--shadow-low); transition: box-shadow var(--d-hover) ease-out; }
.search-box:hover { box-shadow: var(--shadow-low-hover); }
.search-box:focus-within { box-shadow: 0 0 0 1px var(--red-9), 0 0 0 4px var(--red-4); }
.search-box > svg { width: 20px; height: 20px; color: var(--text-3); margin-inline-end: 12px; flex: none; }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 17px; outline: none; }
.search-box input::placeholder { color: var(--text-3); }
.search-box .tool { width: 48px; height: 48px; border: 0; background: transparent; border-radius: 24px; color: var(--text-2); display: grid; place-items: center; flex: none; transition: background-color var(--d-hover) ease-out, color var(--d-hover) ease-out; }
.search-box .tool:hover { background: var(--bg-hover); color: var(--text-accent); }
.search-box .tool:active { background: var(--bg-active); }
.search-box .tool svg { width: 20px; height: 20px; }
.search-box .btn { height: 48px; border-radius: 24px; padding-inline: 22px; }
.search-lg .search-box { height: 64px; border-radius: 32px; padding: 4px 4px 4px 24px; }
.search-lg .search-box .btn { height: 56px; border-radius: 28px; }
.search-lg .search-box .tool { width: 56px; height: 56px; border-radius: 28px; }
.search-lg .search-box input { font-size: 18px; }
.search-sm .search-box { height: 44px; border-radius: 22px; padding: 2px 2px 2px 16px; box-shadow: none; border: 1px solid var(--border-strong); }
.search-sm .search-box .btn { height: 38px; border-radius: 19px; padding-inline: 16px; }
.search-sm .search-box .tool { width: 38px; height: 38px; }
.suggest { position: absolute; inset-inline: 0; top: calc(100% + 8px); background: var(--bg-card); border-radius: var(--r-container); box-shadow: var(--shadow-high); z-index: 60; display: none; overflow: hidden; color: var(--text); }
.suggest[data-open] { display: block; }
.suggest-group { padding: var(--sp-2) 0; }
.suggest-group + .suggest-group { border-top: 1px solid var(--border); }
.suggest-item { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-4); transition: background-color 100ms ease-out; }
.suggest-item:hover, .suggest-item[aria-selected] { background: var(--bg-hover); }
.suggest-item img { width: 44px; height: 44px; object-fit: contain; border-radius: var(--r-inner); outline: var(--img-outline); outline-offset: -1px; background: #fff; }
.suggest-item .name { font-size: var(--fs-label); line-height: 1.35; }
.suggest-item .code { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--text-3); }
.suggest-chiprow { padding: var(--sp-3) var(--sp-4) var(--sp-1); display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; font-size: var(--fs-label); color: var(--text-3); }
.suggest-foot { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-label); background: var(--bg-surface); }

/* ---------- Чипы и бейджи (всегда по содержимому) ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--sp-2); height: 32px; padding-inline: 12px; border-radius: var(--r-full); background: var(--bg-surface); color: var(--text); font-size: var(--fs-label); font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip-param { background: var(--bg-card); border-color: var(--border); }
.chip-param b { font-family: var(--font-mono); font-weight: 600; color: var(--text-accent); }
.chip-accent { background: var(--bg-accent-soft); color: var(--text-accent); }
.chip button { border: 0; background: transparent; padding: 0; line-height: 1; color: var(--text-3); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.chip button:hover { background: var(--bg-active); color: var(--text); }
.chip-btn { cursor: pointer; transition: background-color var(--d-hover) ease-out, border-color var(--d-hover) ease-out; }
.chip-btn:hover { border-color: var(--border-strong); background: var(--bg-card); }
.chip-btn[aria-pressed="true"] { background: var(--bg-inverse); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding-inline: 8px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; width: max-content; }
.badge-new { background: var(--status-info-bg); color: var(--status-info-text); }
.badge-sale { background: var(--bg-accent-soft); color: var(--text-accent); }
.badge-top { background: var(--bg-inverse); color: #fff; }
.badge-ok { background: var(--status-ok-bg); color: var(--status-ok-text); }
.badge-warn { background: var(--status-low-bg); color: var(--status-low-text); }

/* ---------- Наличие V·K·S: цвет + буква + число (не только цвет) ---------- */
.stock { display: inline-flex; gap: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stock i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.stock i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--status-none); }
.stock i[data-s="ok"]::before { background: var(--status-ok); }
.stock i[data-s="low"]::before { background: var(--status-low); }
.stock i[data-s="order"]::before { background: var(--status-info); }
.stock-rows { display: flex; flex-direction: column; }
.stock-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block: 10px; border-top: 1px solid var(--border); font-size: var(--fs-label); }
.stock-row:first-child { border-top: 0; }
.stock-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--status-none); margin-inline-end: 10px; flex: none; }
.stock-row .dot[data-s="ok"] { background: var(--status-ok); } .stock-row .dot[data-s="low"] { background: var(--status-low); } .stock-row .dot[data-s="order"] { background: var(--status-info); }
.stock-row .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Цена и лестница ---------- */
.price { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-heading); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price small { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-caption); color: var(--text-3); }
.price-old { font-family: var(--font-mono); color: var(--text-3); text-decoration: line-through; font-size: var(--fs-caption); }
.ladder { display: flex; gap: 4px; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.ladder span { flex: 1; padding: 6px 8px; background: var(--bg-surface); text-align: center; line-height: 1.25; border-radius: var(--r-inner); color: var(--text-3); }
.ladder span b { display: block; font-weight: 600; color: var(--text); font-size: 13px; margin-top: 2px; }
.ladder span[data-active] { background: var(--bg-inverse); color: var(--gray-6); }
.ladder span[data-active] b { color: #fff; }
.ladder-hint { font-size: var(--fs-caption); color: var(--status-ok-text); margin-top: var(--sp-2); }

/* ---------- Карточка товара: контейнер 16, внутри 8 (16 − 8 паддинг) ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--sp-6); container-type: inline-size; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--bg-card); border-radius: var(--r-container); padding: var(--sp-2); box-shadow: var(--shadow-low); transition: box-shadow var(--d-hover) ease-out; }
.pcard:hover { box-shadow: var(--shadow-low-hover); }
.pcard-img { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-inner); background: #fff; overflow: hidden; position: relative; }
.pcard-img img { width: 84%; height: 84%; object-fit: contain; transition: scale var(--d-fast) var(--ease); }
.pcard:hover .pcard-img img { scale: 1.03; }
.pcard-img .badge { position: absolute; left: 10px; top: 10px; }
.pcard .cmp { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); box-shadow: var(--shadow-low); display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity var(--d-hover) ease-out, background-color var(--d-hover) ease-out; }
.pcard:hover .cmp, .pcard .cmp:focus-visible, .pcard .cmp[data-on] { opacity: 1; }
.pcard .cmp[data-on] { background: var(--bg-inverse); color: #fff; }
.pcard .cmp svg { width: 16px; height: 16px; }
.pcard-body { padding: var(--sp-3) var(--sp-2) var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.pcard .code { display: flex; justify-content: space-between; gap: var(--sp-2); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.pcard .code .brand { font-family: var(--font-body); font-weight: 600; color: var(--text-2); }
.pcard .name { font-size: var(--fs-label); font-weight: 600; line-height: 1.4; height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .name:hover { color: var(--text-accent); }
.pcard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding-top: var(--sp-1); }
.qty { display: inline-flex; align-items: center; height: 36px; border-radius: var(--r-inner); border: 1px solid var(--border-strong); background: var(--bg-card); }
.qty button { width: 32px; height: 100%; border: 0; background: transparent; color: var(--text-2); font-size: 16px; }
.qty button:hover { background: var(--bg-hover); }
.qty input { width: 36px; height: 100%; border: 0; background: transparent; text-align: center; font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.qty-lg { height: 44px; border-radius: var(--r-element); } .qty-lg button { width: 40px; font-size: 18px; } .qty-lg input { width: 48px; font-size: 16px; }
.pcard .btn-sm { height: 36px; }

/* ---------- Поверхности: страница → секция → карточка → всплывающее ---------- */
.card { background: var(--bg-card); border-radius: var(--r-container); box-shadow: var(--shadow-low); padding: var(--sp-6); }
.card-p16 { padding: var(--sp-4); }
.card-flat { box-shadow: none; background: var(--bg-surface); }
.card-inverse { background: var(--bg-inverse); color: #fff; box-shadow: none; }
.card-accent { background: var(--bg-accent); color: #fff; box-shadow: none; }
.block { border-radius: var(--r-page); padding: var(--sp-8); }
.popover { background: var(--bg-card); border-radius: var(--r-container); box-shadow: var(--shadow-high); }

/* ---------- Данные строками: таблицы с разделителями от края до края ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-label); }
.table th { text-align: start; font-weight: 700; font-size: 12px; color: var(--text-3); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-strong); letter-spacing: .02em; }
.table td { padding: var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--gray-1); transition: background-color 100ms ease-out; }
.table .num { text-align: end; font-family: var(--font-mono); }
.table img { width: 40px; height: 40px; object-fit: contain; border-radius: var(--r-inner); outline: var(--img-outline); outline-offset: -1px; }
.spec td:first-child { color: var(--text-3); width: 40%; }
.spec td:last-child { font-family: var(--font-mono); font-size: 13px; }
.list { display: flex; flex-direction: column; }
.list-row { display: grid; align-items: center; gap: var(--sp-4); padding-block: var(--sp-4); border-bottom: 1px solid var(--border); }
.list-row img { width: 56px; height: 56px; object-fit: contain; border-radius: var(--r-inner); outline: var(--img-outline); outline-offset: -1px; background: #fff; }

/* ---------- Вкладки и сегменты ---------- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); }
.tabs button { height: 44px; padding-inline: var(--sp-4); border: 0; background: transparent; font-family: var(--font-heading); font-weight: 500; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--d-hover) ease-out, border-color var(--d-hover) ease-out; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--red-9); }
.tabpanel[hidden] { display: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-surface); border-radius: var(--r-element); }
.seg button, .seg a { height: 36px; padding-inline: 14px; border: 0; border-radius: 9px; background: transparent; font-family: var(--font-heading); font-weight: 500; font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: background-color var(--d-hover) ease-out, color var(--d-hover) ease-out, box-shadow var(--d-hover) ease-out; }
.seg button svg, .seg a svg { width: 16px; height: 16px; }
.seg [aria-pressed="true"], .seg [aria-current] { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-low); }

/* ---------- Раскрывающиеся группы фильтров ---------- */
.fgroup { border-top: 1px solid var(--border); padding-block: var(--sp-3); }
.fgroup summary { list-style: none; cursor: pointer; font-weight: 700; font-size: var(--fs-label); display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after { content: ""; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23706665' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; transition: rotate var(--d-fast) var(--ease); }
.fgroup[open] summary::after { rotate: 180deg; }
.fgroup .fbody { padding-top: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-1); }
.fcheck { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; font-size: var(--fs-label); cursor: pointer; border-radius: var(--r-inner); padding-inline: 4px; }
.fcheck:hover { background: var(--bg-surface); }
.fcheck input { width: 16px; height: 16px; accent-color: var(--red-9); margin: 0; }
.fcheck .n { margin-inline-start: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

/* ---------- Ящики, фон, тост ---------- */
.drawer { position: fixed; top: 0; inset-inline-end: 0; bottom: 0; width: min(480px, 100%); background: var(--bg-card); box-shadow: var(--shadow-high); z-index: 80; translate: 100% 0; transition: translate var(--d-medium) var(--ease); display: flex; flex-direction: column; }
.drawer[data-open] { translate: 0 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow: auto; padding: var(--sp-4) var(--sp-6); }
.drawer-foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); background: var(--bg-surface); }
.backdrop { position: fixed; inset: 0; background: rgba(30,25,25,.4); z-index: 70; opacity: 0; pointer-events: none; transition: opacity var(--d-fast) ease-out; }
.backdrop[data-open] { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 12px; background: var(--bg-inverse); color: #fff; padding: var(--sp-3) var(--sp-5); border-radius: var(--r-element); box-shadow: var(--shadow-high); font-size: var(--fs-label); z-index: 90; opacity: 0; transition: opacity var(--d-fast) ease-out, translate var(--d-fast) var(--ease); display: flex; gap: var(--sp-4); align-items: center; }
.toast[data-open] { opacity: 1; translate: -50% 0; }
.toast a { color: var(--red-6); font-weight: 700; }
.x { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.x:hover { background: var(--bg-hover); color: var(--text); }
.x svg { width: 18px; height: 18px; }

/* ---------- Чат ассистента ---------- */
.chat { display: flex; flex-direction: column; gap: var(--sp-3); }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: var(--fs-label); line-height: 1.45; }
.msg-bot { background: var(--bg-surface); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--bg-inverse); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.msg .opts button { height: 32px; padding-inline: 12px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: #fff; font-size: 13px; font-weight: 600; }
.msg .opts button:hover { border-color: var(--border-accent); background: var(--bg-accent-soft); }
.msg-prod { display: grid; grid-template-columns: 48px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2); background: #fff; border-radius: var(--r-element); box-shadow: var(--shadow-low); margin-top: var(--sp-2); }
.msg-prod img { width: 48px; height: 48px; object-fit: contain; border-radius: var(--r-inner); }
.msg-prod .why { font-size: 12px; color: var(--text-3); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

/* ---------- Движение: появление каскадом (100 мс шаг, blur 4 → 0, y 12 → 0) ---------- */
.reveal { opacity: 0; translate: 0 12px; filter: blur(4px); transition: opacity var(--d-medium) var(--ease), translate var(--d-medium) var(--ease), filter var(--d-medium) var(--ease); }
.reveal.in { opacity: 1; translate: 0 0; filter: blur(0); }
.stagger > * { opacity: 0; translate: 0 12px; filter: blur(4px); animation: rise var(--d-medium) var(--ease) forwards; }
.stagger > :nth-child(1) { animation-delay: 0ms; } .stagger > :nth-child(2) { animation-delay: 100ms; } .stagger > :nth-child(3) { animation-delay: 200ms; } .stagger > :nth-child(4) { animation-delay: 300ms; } .stagger > :nth-child(5) { animation-delay: 400ms; } .stagger > :nth-child(6) { animation-delay: 500ms; }
@keyframes rise { to { opacity: 1; translate: 0 0; filter: blur(0); } }
.grid-in > * { opacity: 0; scale: .96; translate: 0 8px; }
.grid-in.in > * { animation: gridin 400ms var(--ease-back) forwards; }
@keyframes gridin { to { opacity: 1; scale: 1; translate: 0 0; } }
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee > div { display: inline-flex; gap: 48px; padding-inline-end: 48px; animation: marquee 40s linear infinite; }
.marquee:hover > div { animation-play-state: paused; }
@keyframes marquee { to { translate: -50% 0; } }
