/* ==========================================================================
   Общая вёрстка магазинов. Цвета, шрифты и форма — токены ниже;
   каждый сайт переопределяет их в /site/theme.css (см. DESIGN_SYSTEM.md).
   ========================================================================== */

:root {
  /* цвет */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --ink: #1c1c1c;
  --ink-2: #5f5f5f;
  --ink-3: #8c8c8c;
  --line: #e7e7e4;
  --primary: #1c1c1c;
  --primary-ink: #ffffff;
  --primary-hover: #000000;
  --secondary: #2563eb;
  --accent: #ffd400;
  --accent-ink: #1c1c1c;
  --success: #16834a;
  --danger: #c62828;
  --price: var(--ink);
  --sale: #e5262d;
  --topbar-bg: var(--surface-2);
  --topbar-ink: var(--ink-2);
  --header-bg: var(--surface);
  --header-ink: var(--ink);
  --field-bg: var(--surface-2);
  --footer-bg: #1c1c1c;
  --footer-ink: #f2f2f2;
  --footer-muted: #a3a3a3;
  /* шрифт */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: var(--font-body);
  --head-weight: 800;
  --head-transform: none;
  --head-tracking: -0.01em;
  /* форма */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --border-w: 1px;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .06), 0 2px 8px rgb(0 0 0 / .05);
  --shadow-2: 0 10px 30px rgb(0 0 0 / .12);
  --shadow-pop: var(--shadow-2);
  --card-ratio: 3 / 4;
  /* движение */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .18s;
  /* сетка */
  --container: 1320px;
  --gutter: 20px;
  --header-h: 72px;
}

/* --- база ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; } /* height:auto: атрибуты width/height только резервируют место (без CLS), не растягивают */
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-head); font-weight: var(--head-weight);
  text-transform: var(--head-transform); letter-spacing: var(--head-tracking);
  line-height: 1.12; margin: 0 0 .5em; text-wrap: balance;
}
h1 { font-size: clamp(28px, 3.2vw, 44px); }
h2 { font-size: clamp(24px, 2.4vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* --- кнопки -------------------------------------------------------------- */
.btn {
  --b-bg: var(--surface-2); --b-ink: var(--ink); --b-line: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: var(--border-w) solid var(--b-line);
  border-radius: var(--btn-radius, var(--r-pill)); background: var(--b-bg); color: var(--b-ink);
  font-weight: 700; font-size: 16px; line-height: 1; white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn--primary { --b-bg: var(--primary); --b-ink: var(--primary-ink); }
.btn--primary:hover { --b-bg: var(--primary-hover); }
.btn--accent { --b-bg: var(--accent); --b-ink: var(--accent-ink); }
.btn--ghost { --b-bg: transparent; --b-line: currentColor; }
.btn--light { --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 17px; }
.btn--block { width: 100%; }
.btn .icon { width: 20px; height: 20px; }
.btn.is-loading { pointer-events: none; opacity: .7; }
.link { color: var(--secondary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* --- поля ---------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.field small { color: var(--ink-2); font-size: 13px; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 25%, transparent); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 13px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check a { text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.choice { display: grid; gap: 10px; }
.choice label {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); cursor: pointer; background: var(--surface);
  transition: border-color var(--dur) var(--ease);
}
.choice label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.choice b { display: block; font-weight: 700; }
.choice small { color: var(--ink-2); }

/* --- шапка --------------------------------------------------------------- */
.topbar { background: var(--topbar-bg); color: var(--topbar-ink); font-size: 13px; }
.topbar__in { display: flex; align-items: center; gap: 24px; min-height: 36px; }
.topbar__note { font-weight: 600; }
.topbar__links { display: flex; gap: 20px; margin-left: auto; }
.topbar__links a:hover { text-decoration: underline; }
.header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); color: var(--header-ink); transition: box-shadow var(--dur) var(--ease); }
.header.is-stuck { box-shadow: 0 6px 20px rgb(0 0 0 / .08); }
.header__in { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.logo { display: flex; align-items: center; flex: none; }
.logo img { height: 48px; width: auto; }
.catalog-btn { gap: 10px; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input {
  width: 100%; height: 48px; padding: 0 52px 0 20px; border: 1.5px solid transparent;
  border-radius: var(--search-radius, var(--r-pill)); background: var(--field-bg); color: var(--ink); outline: none;
}
.search input:focus { border-color: var(--ink); background: var(--surface); }
.search button { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.header__phone { display: grid; line-height: 1.2; margin-left: auto; text-align: right; }
.header__phone b { font-size: 17px; white-space: nowrap; }
.header__phone small { font-size: 12px; color: var(--header-muted, var(--ink-2)); }
.header__cart { position: relative; display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 8px 4px; }
.header__cart .icon { width: 28px; height: 28px; }
.cart-count {
  position: absolute; left: 18px; top: 0; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--primary); color: var(--primary-ink);
  font-size: 12px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.cart-count:empty, .cart-count[data-n="0"] { display: none; }
.cart-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }
.burger, .icon-btn { display: none; width: 44px; height: 44px; border: 0; background: transparent; place-items: center; color: inherit; border-radius: var(--r-sm); }
.burger .icon, .icon-btn .icon { width: 26px; height: 26px; }

.mainnav { border-top: 1px solid var(--nav-line, var(--line)); }
.mainnav__in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.mainnav__in::-webkit-scrollbar { display: none; }
.mainnav a { padding: 14px 11px; font-size: 15px; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.mainnav__in.is-overflow { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.mainnav a:hover, .mainnav a.is-active { border-bottom-color: var(--primary); }

/* мега-меню каталога */
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border-top: 1px solid var(--line); }
.mega__in { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 32px; padding: 32px var(--gutter) 36px; max-height: calc(100vh - 140px); overflow: auto; }
.mega__col h3 { font-size: 17px; margin-bottom: 10px; }
.mega__col h3 a:hover { color: var(--secondary); }
.mega__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mega__col li a { color: var(--ink-2); }
.mega__col li a:hover { color: var(--ink); }
.mega__count { color: var(--ink-3); font-size: 13px; margin-left: 4px; }

/* мобильное меню */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__shade { position: absolute; inset: 0; background: rgb(0 0 0 / .45); animation: fade .2s; }
.drawer__panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(380px, 88vw); background: var(--surface);
  overflow-y: auto; padding: 16px 20px 32px; animation: slide-in .25s var(--ease);
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer__head .icon-btn { display: grid; }
.drawer nav { display: grid; }
.drawer details { border-bottom: 1px solid var(--line); }
.drawer summary, .drawer__link { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-weight: 700; list-style: none; cursor: pointer; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer details[open] summary .icon { transform: rotate(180deg); }
.drawer details ul { list-style: none; margin: 0 0 12px; padding: 0 0 0 12px; display: grid; gap: 10px; }
.drawer__link { border-bottom: 1px solid var(--line); }
.drawer__contacts { margin-top: 24px; display: grid; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(-100%); } }

/* --- общие блоки --------------------------------------------------------- */
.section { padding: 56px 0; }
.section--tint { background: var(--surface-2); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__head h2 { margin: 0; }
.section__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.section__more:hover { color: var(--secondary); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 20px 0 12px; font-size: 14px; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--ink-3); }
.page-head { padding-bottom: 12px; }
.page-head h1 { margin-bottom: 8px; }
.page-head p { color: var(--ink-2); max-width: 760px; }
.prose { max-width: 820px; font-size: 17px; line-height: 1.65; }
.prose h2 { font-size: 26px; margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose a { color: var(--secondary); text-decoration: underline; }
.empty { padding: 56px 24px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r-lg); color: var(--ink-2); }
.empty h3 { color: var(--ink); }

/* --- баннеры (слайдер) --------------------------------------------------- */
.hero { padding: 24px 0 8px; }
.slider { position: relative; }
.slider__track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--r-lg); }
.slider__track::-webkit-scrollbar { display: none; }
.slide { scroll-snap-align: start; position: relative; min-height: 420px; display: grid; overflow: hidden; border-radius: var(--r-lg); }
.slide--image img { width: 100%; height: 100%; object-fit: cover; }
.slider__dots { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 40px; margin-top: 10px; }
/* точка 10 px, но зона нажатия 24 px (WCAG 2.2): прозрачный padding + фон только по содержимому */
.slider__dots button { box-sizing: content-box; width: 10px; height: 10px; padding: 7px 4px; background-clip: content-box; border-radius: var(--r-pill); border: 0; background-color: var(--line); transition: width var(--dur) var(--ease), background var(--dur); }
.slider__dots button[aria-current="true"] { width: 28px; background-color: var(--ink); }
/* стрелки в одном ряду с точками под баннером: не перекрывают текст слайда */
.slider__arrow { position: absolute; bottom: 0; width: 40px; height: 40px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; z-index: 2; }
.slider__arrow--prev { right: 48px; } .slider__arrow--next { right: 0; }

/* --- плитки разделов ----------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.tile__img { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.tile__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s var(--ease); }
.tile:hover .tile__img img { transform: scale(1.04); }
.tile__body { padding: 14px 16px 16px; }
.tile__name { font-weight: 800; font-size: 17px; line-height: 1.2; }
.tile__count { color: var(--ink-2); font-size: 14px; margin-top: 4px; }

/* --- карточка товара ----------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .rail { grid-auto-columns: calc((100% - 80px) / 5); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: var(--card-border, 1px solid var(--line)); border-radius: var(--r-md); overflow: hidden; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); transition: transform .15s var(--ease), box-shadow var(--dur) var(--ease); }
.card:hover { --lift: -3px; box-shadow: var(--shadow-pop); }
.card__img { position: relative; aspect-ratio: var(--card-ratio); background: var(--img-bg, #fff); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s var(--ease); }
.card:hover .card__img img { transform: scale(1.03); }
/* мототехника: фото горизонтальные, карточка под них */
.card--wide .card__img { aspect-ratio: 4 / 3; }
.card--wide .card__img img { object-fit: cover; }
.card__badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; }
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--badge-radius, var(--r-pill)); font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; background: var(--ink); color: #fff; }
.badge--hit { background: var(--accent); color: var(--accent-ink); }
.badge--new { background: var(--secondary); color: #fff; }
.badge--sale { background: var(--sale); color: #fff; }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.card__name { font-size: 15px; line-height: 1.35; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__name::after { content: ""; position: absolute; inset: 0; } /* вся карточка кликабельна */
.card__avail { font-size: 13px; color: var(--success); font-weight: 600; }
.card__avail--preorder { color: var(--secondary); }
.card__avail--out { color: var(--ink-3); }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.price b { font-size: 20px; font-weight: 800; color: var(--price); white-space: nowrap; }
.price s { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.price--request b { font-size: 16px; }
.card__buy { position: relative; z-index: 2; width: 44px; height: 44px; padding: 0; min-height: 0; flex: none; }
.card__buy .icon { width: 22px; height: 22px; }
.card__buy.is-added { --b-bg: var(--success); --b-ink: #fff; }

/* --- каталог ------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 0 20px; }
.toolbar__count { color: var(--ink-2); font-weight: 600; margin-right: auto; }
.toolbar .select { width: auto; min-height: 44px; padding: 8px 40px 8px 14px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--primary); }
.subcats { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--chip-radius, var(--r-pill)); background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; transition: border-color var(--dur), background var(--dur); }
.chip:hover, .chip.is-active { border-color: var(--ink); }
.chip small { color: var(--ink-3); font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 36px 0 8px; }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 12px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1.5px solid var(--line); font-weight: 700; }
.pager a:hover { border-color: var(--ink); }
.pager .is-current { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* --- заявка (лид-форма) -------------------------------------------------- */
.lead { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 40px; border-radius: var(--r-lg); background: var(--lead-bg, var(--surface-2)); color: var(--lead-ink, var(--ink)); }
.lead h2 { margin-bottom: 12px; }
.lead p { color: inherit; opacity: .85; }
.lead form { display: grid; gap: 12px; }
.lead .check { color: inherit; opacity: .85; }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; counter-increment: s; font-weight: 600; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.form-ok { padding: 18px; border-radius: var(--r-md); background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); font-weight: 700; display: flex; gap: 10px; align-items: center; }

/* --- товар --------------------------------------------------------------- */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; padding-bottom: 24px; }
.gallery { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-self: start; position: sticky; top: calc(var(--header-h) + 64px); }
.gallery--single { grid-template-columns: 1fr; }
.gallery--wide .gallery__main img, .gallery--wide .gallery__thumbs button { aspect-ratio: 4 / 3; }
.gallery--wide .gallery__main img { object-fit: cover; }  /* одно фото — без колонки миниатюр */
.gallery__thumbs { display: grid; gap: 10px; align-content: start; max-height: 640px; overflow-y: auto; scrollbar-width: none; }
.gallery__thumbs button { padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--img-bg, #fff); aspect-ratio: var(--card-ratio); }
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--r-lg); background: var(--img-bg, #fff); border: 1px solid var(--line); }
.gallery__main::-webkit-scrollbar { display: none; }
.gallery__main img { scroll-snap-align: start; width: 100%; aspect-ratio: var(--card-ratio); object-fit: contain; }
.buybox h1 { font-size: clamp(24px, 2.4vw, 34px); }
.buybox__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }
.buybox__price { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0; }
.buybox__price b { font-size: 36px; font-weight: 800; line-height: 1; }
.buybox__price s { font-size: 18px; color: var(--ink-3); }
.buybox__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--btn-radius, var(--r-pill)); height: 48px; background: var(--surface); }
.qty button { width: 44px; height: 100%; border: 0; background: transparent; display: grid; place-items: center; }
.qty input { width: 44px; border: 0; text-align: center; font-weight: 700; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.perks { display: grid; gap: 12px; margin: 24px 0; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-2); }
.perks div { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.perks .icon { width: 22px; height: 22px; color: var(--perk-icon, var(--secondary)); margin-top: 1px; }
.perks b { display: block; }
.details { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; padding: 32px 0; border-top: 1px solid var(--line); }
.details h2 { font-size: 24px; }
/* характеристики: сетка «подпись над значением», без линии под каждой строкой */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.specs div { min-width: 0; }
.specs dt { color: var(--ink-2); font-size: 13px; margin-bottom: 2px; }
.specs dd { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.specs-more { margin-top: 18px; }
.specs-more summary { cursor: pointer; font-weight: 700; color: var(--secondary); margin-bottom: 16px; }
.descr { white-space: pre-line; color: var(--ink); font-size: 16px; line-height: 1.65; max-width: 70ch; }
.descr.is-clamped { max-height: 14em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.descr-more { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--secondary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* --- корзина и оформление ----------------------------------------------- */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; padding-bottom: 48px; }
.cart__list { display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto 44px; gap: 18px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.line img { width: 96px; aspect-ratio: var(--card-ratio); object-fit: contain; border-radius: var(--r-sm); background: var(--img-bg, #fff); }
.line__name { font-weight: 600; line-height: 1.35; }
.line__name:hover { color: var(--secondary); }
.line__unit { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.line__sum { font-weight: 800; font-size: 18px; min-width: 100px; text-align: right; white-space: nowrap; }
.line__del { width: 40px; height: 40px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); display: grid; place-items: center; }
.line__del:hover { color: var(--danger); background: var(--surface-2); }
.summary { position: sticky; top: calc(var(--header-h) + 64px); padding: 24px; border-radius: var(--r-lg); background: var(--surface-2); display: grid; gap: 14px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; }
.summary__total { font-size: 24px; font-weight: 800; padding-top: 14px; border-top: 1px solid var(--line); }
.summary__items { display: grid; gap: 10px; max-height: 300px; overflow: auto; font-size: 14px; }
.summary__items div { display: flex; justify-content: space-between; gap: 12px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; padding-bottom: 56px; }
.checkout form { display: grid; gap: 28px; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.fieldset legend { font-family: var(--font-head); font-weight: var(--head-weight); text-transform: var(--head-transform); font-size: 22px; margin-bottom: 14px; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.alert { padding: 14px 18px; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-weight: 600; }
.alert--info { background: var(--surface-2); color: var(--ink); font-weight: 400; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; background: var(--surface-2); }
.status--paid { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.status--pending { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.done-card { max-width: 760px; margin: 24px auto 64px; padding: 40px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.done-card__icon { width: 64px; height: 64px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--success); color: #fff; margin-bottom: 20px; }
.done-card__icon .icon { width: 34px; height: 34px; stroke-width: 3; }

/* --- контакты ------------------------------------------------------------ */
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 32px; }
.contact { padding: 20px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 6px; }
.contact .icon { width: 26px; height: 26px; color: var(--perk-icon, var(--secondary)); margin-bottom: 6px; }
.contact b { font-size: 18px; }
.contact small { color: var(--ink-2); }
.requisites { font-size: 14px; color: var(--ink-2); padding: 18px 20px; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* --- подвал -------------------------------------------------------------- */
.footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 64px; }
.footer__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding: 56px var(--gutter) 40px; }
.footer h3 { font-size: 15px; letter-spacing: .04em; margin-bottom: 14px; color: var(--footer-ink); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer a { color: var(--footer-muted); }
.footer a:hover { color: var(--footer-ink); }
.footer__about { color: var(--footer-muted); font-size: 15px; max-width: 340px; }
.footer__logo { display: inline-flex; margin-bottom: 18px; }  /* inline-flex: у строчной ссылки отступ снизу не работает */
.footer__logo img { height: 52px; width: auto; }
.footer__phone { font-size: 22px; font-weight: 800; color: var(--footer-ink) !important; }
.footer__bottom { border-top: 1px solid rgb(255 255 255 / .1); }
.footer__bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 22px; font-size: 13px; color: var(--footer-muted); }
.paylogos { display: flex; gap: 8px; flex-wrap: wrap; }
.paylogos span { padding: 4px 10px; border-radius: 6px; border: 1px solid rgb(255 255 255 / .2); font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--footer-ink); }
.socials { display: flex; gap: 10px; margin-top: 14px; }
.socials a { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; background: rgb(255 255 255 / .08); color: var(--footer-ink); font-weight: 800; font-size: 13px; }
.socials a:hover { background: rgb(255 255 255 / .16); }

/* --- всплывашки ---------------------------------------------------------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 200; display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--surface); box-shadow: var(--shadow-2); font-weight: 600; animation: toast-in .3s var(--ease); }
.toast--error { background: var(--danger); color: #fff; }
.toast a { margin-left: auto; text-decoration: underline; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.modal::backdrop { background: rgb(0 0 0 / .5); }
.modal__in { padding: 32px; display: grid; gap: 14px; }
.modal__close { position: absolute; right: 12px; top: 12px; display: grid; }
.modal h2 { font-size: 26px; margin: 0 40px 0 0; }

/* --- адаптив ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .header__phone { display: none; }
  .footer__in { grid-template-columns: 1fr 1fr; }
  .product { gap: 32px; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .topbar__links, .topbar__hours { display: none; }
  .topbar__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .burger { display: grid; margin-left: -10px; }
  .catalog-btn { display: none; }
  .header__in { gap: 10px; flex-wrap: wrap; padding-bottom: 12px; }
  .logo { margin-right: auto; }
  .logo img { height: 40px; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .header__cart span.label { display: none; }
  .mainnav { display: none; }
  .product, .details, .cart, .checkout, .lead { grid-template-columns: 1fr; }
  .gallery { position: static; grid-template-columns: 1fr; }
  .gallery__thumbs { display: flex; order: 2; overflow-x: auto; max-height: none; }
  .gallery__thumbs button { width: 64px; flex: none; }
  .summary { position: static; }
  .lead { padding: 28px 20px; gap: 24px; }
  .slide { min-height: 0; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .section { padding: 40px 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rail { grid-auto-columns: 46%; gap: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card__body { padding: 10px 12px 12px; gap: 6px; }
  .card__name { font-size: 14px; }
  .price b { font-size: 17px; }
  .card__buy { width: 40px; height: 40px; }
  .line { grid-template-columns: 72px minmax(0, 1fr) 36px; grid-template-areas: "img name del" "img qty sum"; gap: 8px 12px; }
  .line img { width: 72px; grid-area: img; }
  .line__info { grid-area: name; }
  .line .qty { grid-area: qty; height: 40px; justify-self: start; }
  .line__sum { grid-area: sum; min-width: 0; }
  .line__del { grid-area: del; }
  .row2 { grid-template-columns: 1fr; }
  .footer__in { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .done-card, .modal__in { padding: 24px 20px; }
  .buybox__price b { font-size: 30px; }
  .buybox__actions .btn--primary { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* отзывы с Wildberries */
.rail--reviews { grid-auto-columns: minmax(260px, 1fr); }
@media (min-width: 1100px) { .rail--reviews { grid-auto-columns: calc((100% - 60px) / 4); } }
.reviews__note { margin: -8px 0 18px; color: var(--ink-2); font-size: 15px; }
.reviews__sum { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; font-size: 15px; color: var(--ink-2); }
.reviews__sum b { font-size: 20px; color: var(--ink); }
.review { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.stars { display: inline-flex; gap: 2px; color: #f5a700; }
.stars .icon { width: 18px; height: 18px; }
.stars .is-off { opacity: .22; }
.review__text { margin: 0; flex: 1; font-size: 15px; line-height: 1.5; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.review figcaption { display: grid; gap: 2px; font-size: 13px; color: var(--ink-2); }
.review figcaption b { color: var(--ink); font-size: 14px; }
.review figcaption a { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* плавающая кнопка чата MAX (ссылка из настроек max_link) */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px; background: linear-gradient(135deg, #2b7bff, #8a3ffc); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 8px 24px rgba(43, 60, 140, .35); transition: transform var(--dur, .2s) var(--ease, ease); }
.chat-fab:hover { transform: translateY(-2px); color: #fff; }
.chat-fab .icon { width: 24px; height: 24px; }
@media (max-width: 640px) { .chat-fab { right: 14px; bottom: 14px; width: 56px; padding: 0; justify-content: center; } .chat-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media print { .chat-fab { display: none; } }

/* документ к товару (PDF) */
.doc-link { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.doc-link:hover { border-color: var(--primary); }
.doc-link .icon { width: 26px; height: 26px; color: var(--primary); }
.doc-link span { display: grid; font-size: 13px; color: var(--ink-2); }
.doc-link b { font-size: 15px; color: var(--ink); }

/* много миниатюр: колонка выше фото, главное фото не растягиваем до её высоты */
.gallery__main { align-self: start; }
