/*
  Стили витрины «ТвойДом» — один файл без сборки (ТЗ_4, п. 2.2).
  Токены, компоненты и правила — «Дизайн-система.md» в проекте.
  Порядок: шрифт → токены → основа → раскладка → компоненты скелета → совместимость с Oscar.
  Мобильные стили — по умолчанию, широкие экраны — в @media (min-width: 720px / 1100px).
*/

/* ---------- Шрифт ---------- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
/* Запасной шрифт с метриками Manrope: подмена не сдвигает текст (ТЗ_4, п. 2.2.4). */
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 105%;
  ascent-override: 101.5%;
  descent-override: 28.6%;
  line-gap-override: 0%;
}

/* ---------- Токены ---------- */
:root {
  --ink: #0f2440;
  --navy: #1e3a5f;
  --link: #2c5282;
  --signal: #e8590c;
  --action: #c94a09;
  --action-hover: #a83f08;
  --text: #172233;
  --muted: #556373;
  --line: #dbe2ea;
  --line-strong: #c3cdd8;
  --ground: #f2f4f7;
  --paper: #fff;
  --field: #f7f9fb;
  --ok: #1c7a48;
  --wait: #a35a00;
  --danger: #b42318;
  --on-ink: #c6d1dd;
  --on-ink-muted: #93a4b8;

  --font: "Manrope", "Manrope Fallback", Arial, sans-serif;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.3125rem;   /* 21 */
  --fs-2xl: 1.5rem;     /* 24 */
  --fs-3xl: 1.875rem;   /* 30 */

  --r-control: 6px;
  --r-card: 10px;
  --shadow-pop: 0 12px 32px rgba(15, 36, 64, 0.18), 0 2px 6px rgba(15, 36, 64, 0.08);
  --shadow-stuck: 0 6px 16px rgba(15, 36, 64, 0.08);

  --gutter: 16px;
  --container: 1280px;
  --topbar-h: 36px;
  --header-h: 64px;
  --bar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --cookie-reserve: 152px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--fs-md)/1.55 var(--font);
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; }
img { height: auto; }
svg { flex: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; color: var(--ink); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 700; }
h4 { font-size: var(--fs-md); font-weight: 700; }
p, ul, ol, dl, table { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--action); }
strong, b { font-weight: 700; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.num { font-variant-numeric: tabular-nums; }
/* Номер телефона не переносится посередине: «+7 (391)» и «285-82-97» на разных строках не читаются. */
a[href^="tel:"], .phone { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

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

.icon { width: 20px; height: 20px; }

/* Поля и кнопки — базовые стили элементов, их же берут страницы Oscar (ТЗ_4, п. 2.1.6). */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--paper);
  font-size: var(--fs-md);
  line-height: 1.3;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.2);
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--action); vertical-align: -3px; }
label { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1.5px solid transparent; border-radius: var(--r-control);
  background: var(--action); color: #fff;
  font-weight: 700; font-size: var(--fs-md); line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { background: var(--action-hover); color: #fff; }
.btn--secondary { background: var(--navy); }
.btn--secondary:hover { background: var(--ink); }
.btn--ghost { background: var(--paper); border-color: var(--line-strong); color: var(--navy); }
.btn--ghost:hover { background: var(--field); border-color: var(--navy); color: var(--navy); }

.count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--action); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---------- Раскладка ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-block: 16px 48px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* ---------- Тёмная полоса ---------- */
.topbar { display: none; }

/* ---------- Шапка ---------- */
.header { position: relative; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--line); }
.header__inner {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "logo" "search";
  gap: 10px;
  padding-block: 10px 12px;
}
.header__logo { grid-area: logo; }
.header__catalog, .header__phone, .header__smeta { display: none; }
.header__search { grid-area: search; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
a.logo:hover { color: var(--ink); }
.logo__mark { width: 36px; height: 36px; }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; }
.logo__sub { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }

.search { position: relative; margin: 0; }
.search__input {
  height: 44px;
  padding-right: 52px !important;
  background: var(--field) !important;
}
.search__input::placeholder { color: #7a8796; }
.search__btn {
  position: absolute; top: 4px; right: 4px;
  display: grid; place-items: center;
  width: 36px; height: 36px; min-height: 0; padding: 0;
  border: 0; border-radius: 5px; background: var(--navy); color: #fff;
}
.search__btn:hover { background: var(--ink); }
.search__btn .icon { width: 18px; height: 18px; }

.header-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px;
  border: 0; border-radius: var(--r-control);
  font-weight: 700; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s var(--ease);
}
.header-btn--catalog { background: var(--action); color: #fff; }
.header-btn--catalog:hover, .header-btn--catalog[aria-expanded="true"] { background: var(--action-hover); color: #fff; }
.header-btn--smeta { background: var(--navy); color: #fff; }
.header-btn--smeta:hover { background: var(--ink); color: #fff; }
.header-btn--phone { padding: 0 12px; background: transparent; color: var(--ink); }
.header-btn--phone:hover { color: var(--action); }
.header-btn__label { display: none; }

/* ---------- Мега-меню: телефон и планшет — панель во весь экран ---------- */
.mm {
  display: none;
  position: fixed; inset: 0; z-index: 80;
  flex-direction: column;
  background: var(--paper);
}
.mm.is-open { display: flex; }
.mm__head {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 8px 0 var(--gutter);
  border-bottom: 1px solid var(--line);
}
.mm__title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
.mm__close {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-control); background: none; color: var(--ink); cursor: pointer;
}
.mm__close .icon { width: 22px; height: 22px; }
.mm__sections { flex: 1; margin: 0; padding: 4px 0 24px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.mm__row { display: flex; align-items: stretch; border-bottom: 1px solid var(--ground); }
.mm__link {
  flex: 1; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px var(--gutter);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.mm__icon { width: 28px; height: 28px; color: var(--navy); }
.mm__toggle {
  display: grid; place-items: center; width: 52px;
  border: 0; border-left: 1px solid var(--ground); background: none; color: var(--muted); cursor: pointer;
}
.mm__toggle .icon { transition: transform 0.2s var(--ease); }
.mm__toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.mm__panel { display: none; padding: 8px var(--gutter) 16px 56px; background: var(--field); }
.mm__section.is-open .mm__panel { display: block; }
.mm__all { display: inline-block; margin: 4px 0 8px; font-weight: 700; }
.mm__panel-title { display: none; }
.mm__groups { margin: 0; padding: 0; list-style: none; }
.mm__group { padding: 6px 0; }
.mm__group-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.mm__items { margin: 4px 0 0; padding: 0; list-style: none; }
.mm__items a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; }
.mm__group-link:hover, .mm__items a:hover, .mm__link:hover { color: var(--action); }

/* ---------- Сообщения ---------- */
.messages { margin: 0 0 16px; padding: 0; list-style: none; }
.message {
  margin-bottom: 8px; padding: 12px 16px;
  border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r-control);
  background: var(--paper);
}
.message--success { border-left-color: var(--ok); }
.message--warning { border-left-color: var(--wait); }
.message--error, .message--danger { border-left-color: var(--danger); }

/* ---------- Хлебные крошки ---------- */
.crumbs {
  margin: 0 calc(-1 * var(--gutter)) 8px; padding: 0 var(--gutter); list-style: none;
  display: flex; flex-wrap: nowrap; gap: 4px 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  font-size: var(--fs-sm); color: var(--muted);
}
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; margin: 0 10px 0 6px; border: solid var(--line-strong); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--action); text-decoration: underline; }

/* ---------- Подвал ---------- */
.footer { background: var(--ink); color: var(--on-ink); font-size: var(--fs-sm); }
.footer a { color: #e6ecf2; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__grid { display: grid; gap: 32px; padding-block: 40px 32px; }
.footer__title { margin: 0 0 12px; color: #fff; font-size: var(--fs-md); font-weight: 700; letter-spacing: 0; }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer .logo__sub { color: var(--on-ink-muted); }
.footer__list { margin: 0; padding: 0; list-style: none; }
.footer__list li { padding: 6px 0; }
.footer__contacts { margin: 0; }
.footer__contacts dt { margin-top: 12px; color: var(--on-ink-muted); font-size: var(--fs-xs); }
.footer__contacts dt:first-child { margin-top: 0; }
.footer__contacts dd { margin: 2px 0 0; color: #fff; }
.footer__phone { font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; color: #fff !important; }
.footer__bottom { padding-block: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: var(--on-ink-muted); font-size: var(--fs-xs); }

/* ---------- Мобильный бар ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(15, 36, 64, 0.06);
}
.bar__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; padding: 4px 2px;
  border: 0; background: none; color: var(--navy);
  font-size: 12px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.bar__item .icon { width: 22px; height: 22px; }
.bar__item--call { margin: 6px 6px 6px 2px; border-radius: var(--r-control); background: var(--action); color: #fff; }
.bar__item--call:hover { background: var(--action-hover); color: #fff; }
.bar__item .count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
/* Место под бар — в подвале: бар не закрывает его, фон тёмный до низа экрана (ТЗ_4, п. 2.6.3). */
.footer { padding-bottom: calc(var(--bar-h) + var(--safe-bottom)); }

/* ---------- Плашка cookie ---------- */
.cookie {
  position: fixed; left: 8px; right: 8px; z-index: 70;
  bottom: calc(var(--bar-h) + var(--safe-bottom) + 8px);
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--paper); box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm); line-height: 1.45;
}
.cookie p { margin: 0; }
.cookie .btn { align-self: flex-start; min-height: 40px; padding: 8px 20px; font-size: var(--fs-sm); }
.cookie[hidden] { display: none; }
/* Без JS кнопки «Понятно» нет: плашка остаётся видна (ТЗ_1, п. 2.3.4.5). */
.cookie__ok { display: none !important; }
.js .cookie__ok { display: inline-flex !important; }
.has-cookie-banner .footer { padding-bottom: calc(var(--bar-h) + var(--safe-bottom) + var(--cookie-reserve)); }

/* ---------- Каталог: тексты, строки ссылок, плитки, пагинация (ТЗ_5, пп. 2.2–2.3) ---------- */
.text > :last-child { margin-bottom: 0; }
.text h2 { margin-top: 24px; font-size: var(--fs-xl); }
.text h3 { margin-top: 20px; }
.text ul, .text ol { padding-left: 22px; }
.text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.text th, .text td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.cat-intro { margin-bottom: 16px; }

.staff-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; font-size: var(--fs-sm); }
.staff-note__badge { padding: 2px 10px; border-radius: 999px; background: var(--danger); color: #fff; font-size: var(--fs-xs); font-weight: 700; }

.chips { margin: 0 0 12px; }
.chips__list {
  display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px;
  list-style: none; overflow-x: auto; scrollbar-width: thin;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s var(--ease);
}
a.chip:hover { border-color: var(--navy); color: var(--ink); }
.chip.is-selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip__count { color: var(--muted); font-weight: 700; }
.chip.is-selected .chip__count { color: var(--on-ink); }

.listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 12px; }
.listbar__found { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.sort { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; }
/* На телефоне подпись только для экранных дикторов: строка помещается в ширину экрана. */
.sort__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); }
.sort__select { flex: 1 1 auto; min-width: 0; }

.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.tiles__item { display: flex; min-width: 0; }
.tile {
  position: relative; flex: 1;
  display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper);
  transition: border-color 0.15s var(--ease);
}
.tile:hover { border-color: var(--line-strong); }
.tile__media { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-control); background: var(--field); }
.tile__img, .ph { width: 100%; height: 100%; object-fit: contain; }
.tile__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; height: 100%; }
.tile__title {
  margin: 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.35; letter-spacing: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.tile__link { color: var(--ink); text-decoration: none; }
.tile__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile__link:hover { color: var(--action); }
.tile__link:focus-visible { outline: none; }
.tile__link:focus-visible::after { outline: 2px solid var(--signal); outline-offset: 2px; }
.tile__price { margin: 0; color: var(--ink); font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; }
.tile__price--request { color: var(--navy); font-size: var(--fs-md); font-weight: 700; }
.tile__buy { position: relative; z-index: 1; margin: auto 0 0; }
.tile__btn { width: 100%; }
.tiles--strip {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 72%);
  margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.tiles--strip .tiles__item { scroll-snap-align: start; }
.tiles--strip .tile { grid-template-columns: minmax(0, 1fr); }

.stock { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock--ok { color: var(--ok); }

.pager__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 32px; padding: 0; list-style: none; }
.pager__item { display: flex; }
.pager__item--wide { display: none; }
.pager__link {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper);
  color: var(--navy); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums;
}
a.pager__link:hover { border-color: var(--navy); color: var(--navy); }
.pager__link.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager__link--prev .icon { transform: rotate(180deg); }
.pager__gap { display: inline-grid; place-items: center; min-width: 20px; height: 44px; color: var(--muted); }

.empty { margin: 0 0 24px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); background: var(--paper); }

.seo-text { margin: 32px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
/* С JS текст свёрнут до 8 строк сразу, ещё до скрипта: раскрытие не сдвигает то, что выше (ТЗ_5, п. 2.2.10). */
.js .seo-text:not(.is-open) { max-height: calc(8 * 1.55em + 40px); overflow: hidden; }
.text-toggle { margin: 8px 0 0; padding: 8px 0; border: 0; background: none; color: var(--link); font-weight: 700; cursor: pointer; }
.text-toggle:hover { color: var(--action); }

/* ---------- Каталог: страница разделов (ТЗ_5, п. 2.7) ---------- */
.sections { margin: 0; padding: 0; list-style: none; column-gap: 16px; }
.sections__item { margin: 0 0 16px; padding: 20px; break-inside: avoid; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.sections__title { margin: 0 0 12px; font-size: var(--fs-lg); }
.sections__title a { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.sections__title a:hover { color: var(--action); }
.sections__icon { width: 32px; height: 32px; color: var(--navy); }
.sections__groups { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sections__group { color: var(--ink); font-weight: 700; text-decoration: none; }
.sections__items { margin: 2px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.sections__items a { display: inline-block; padding: 2px 0; color: var(--muted); text-decoration: none; }
.sections__group:hover, .sections__items a:hover { color: var(--action); }

/* ---------- Карточка товара (ТЗ_5, п. 2.4) ---------- */
.product__head { margin-bottom: 16px; }
.product__title { margin: 0 0 8px; }
.product__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.product__main { display: grid; gap: 16px; margin-bottom: 32px; }
.product__section { margin: 0 0 32px; }

.gallery__main { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--field); }
a.gallery__main { cursor: zoom-in; }
.gallery__img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; overflow-x: auto; }
.gallery__thumb { display: block; flex: none; width: 96px; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid var(--line); border-radius: var(--r-control); background: var(--field); }
.gallery__thumb.is-active { border-color: var(--navy); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }

.buy { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.buy__price { margin: 0; color: var(--ink); font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; }
.buy__price--request { font-size: var(--fs-2xl); }
.buy__note { margin: -6px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.buy__status { margin: 0; color: var(--muted); font-weight: 700; }
.buy__form { display: grid; gap: 8px; }
.buy__label { font-size: var(--fs-sm); }
.buy__btn, .buy__call { width: 100%; }
.buy__info { display: grid; gap: 6px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.stepper { display: flex; max-width: 184px; }
.stepper__btn {
  display: none; flex: none; width: 44px; min-height: 44px;
  border: 1.5px solid var(--line-strong); background: var(--field); color: var(--ink);
  font-size: 1.25rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.stepper__btn:first-child { border-right: 0; border-radius: var(--r-control) 0 0 var(--r-control); }
.stepper__btn:last-child { border-left: 0; border-radius: 0 var(--r-control) var(--r-control) 0; }
.stepper__btn:hover { background: var(--ground); }
.js .stepper__btn { display: block; }
.js .stepper__input { border-radius: 0 !important; text-align: center; }
.stepper__input { -moz-appearance: textfield; appearance: textfield; }
.stepper__input::-webkit-inner-spin-button, .stepper__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.specs { width: 100%; border-collapse: collapse; background: var(--paper); }
.specs th, .specs td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { width: 40%; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }

/* Полоса покупки на телефоне — вместо мобильного бара (ТЗ_5, п. 2.4.6). */
.bar--buy { grid-template-columns: 1fr 1fr 2.4fr; }
.bar__item--buy {
  flex-direction: row; gap: 4px; margin: 6px 6px 6px 2px;
  border-radius: var(--r-control); background: var(--action); color: #fff; font-size: var(--fs-sm);
}
.bar__item--buy:hover { background: var(--action-hover); color: #fff; }

/* Просмотр фото (ТЗ_5, п. 2.4.3) и уведомление (п. 2.5.4) — создаёт site.js. */
.viewer { width: min(94vw, 1100px); max-height: 94vh; padding: 0; border: 0; border-radius: var(--r-card); background: var(--paper); }
.viewer::backdrop { background: rgba(15, 36, 64, 0.88); }
.viewer__img { display: block; width: 100%; height: auto; max-height: calc(94vh - 60px); object-fit: contain; background: var(--field); }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; }
.viewer__btn { min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); color: var(--navy); font-weight: 700; cursor: pointer; }
.toast {
  position: fixed; left: 8px; right: 8px; z-index: 75;
  bottom: calc(var(--bar-h) + var(--safe-bottom) + 8px);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--r-card); background: var(--ink); color: #fff; box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm); line-height: 1.45;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.toast--error { background: var(--danger); }
.toast a { color: #fff; font-weight: 700; }

/* ---------- Состояния: с JS и без него (ТЗ_6) ---------- */
[hidden] { display: none !important; }
html:not(.js) .js-only, .js .no-js-only { display: none !important; }

/* ---------- Поля форм (ТЗ_6, п. 2.3.2) ---------- */
.field { margin: 0 0 14px; }
.field > label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); }
.field__optional { color: var(--muted); font-weight: 400; }
.field__error { margin: 6px 0 0; color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.field--error input, .field--error textarea { border-color: var(--danger); }
.field--check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: start; }
.field--check > label { margin: 0; font-size: var(--fs-sm); font-weight: 400; line-height: 1.45; }
.field--check input { margin-top: 1px; }
.field--check .field__error { grid-column: 1 / -1; }
/* Поле-ловушка: вне экрана, а не display: none — программы такие поля пропускают. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Смета (ТЗ_6, п. 2.2) ---------- */
.smeta-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.smeta { display: grid; gap: 24px; align-items: start; }
.smeta__main:focus { outline: none; }
.smeta__main[aria-busy="true"] { opacity: 0.6; pointer-events: none; transition: opacity 0.15s var(--ease); }
.smeta-empty__title { margin: 0 0 4px; color: var(--ink); font-size: var(--fs-lg); font-weight: 800; }
.smeta-empty__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }

/* До 720 px позиция — карточка: товар, цена и «Удалить», количество и сумма. */
.smeta-table { display: block; width: 100%; margin: 0; border-collapse: collapse; }
.smeta-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.smeta-table tbody { display: grid; gap: 12px; }
.smeta-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "item item" "price remove" "qty sum";
  align-items: center; gap: 8px 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper);
}
.smeta-line > td { padding: 0; }
.smeta-line--error { border-color: var(--danger); }
.smeta-line__item { grid-area: item; }
.smeta-line__price { grid-area: price; color: var(--muted); font-size: var(--fs-sm); }
.smeta-line__qty { grid-area: qty; }
.smeta-line__sum { grid-area: sum; color: var(--ink); font-size: var(--fs-lg); font-weight: 800; text-align: right; }
.smeta-line__remove { grid-area: remove; text-align: right; }
.smeta-line__label { margin-right: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.smeta-line__product { display: flex; align-items: flex-start; gap: 12px; }
.smeta-line__media { display: grid; place-items: center; flex: none; width: 64px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-control); background: var(--field); }
.smeta-line__img { width: 100%; height: 100%; object-fit: contain; }
.smeta-line__info { min-width: 0; }
.smeta-line__title { color: var(--ink); font-weight: 700; line-height: 1.35; text-decoration: none; }
.smeta-line__title:hover { color: var(--action); }
.smeta-line__sku { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.smeta-line__warn { margin: 4px 0 0; color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.smeta-line__del {
  min-height: 44px; padding: 0 4px; border: 0; background: none;
  color: var(--link); font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}
.smeta-line__del:hover { color: var(--danger); }
.smeta-line .stepper { max-width: 160px; }

.smeta-total { display: grid; gap: 4px; margin: 16px 0 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.smeta-total p { margin: 0; }
.smeta-total__count, .smeta-total__note { color: var(--muted); font-size: var(--fs-sm); }
.smeta-total__sum { color: var(--ink); font-size: var(--fs-lg); font-weight: 700; }
.smeta-total__sum strong { font-size: var(--fs-2xl); font-weight: 800; }
.smeta-total__recalc { justify-self: start; margin-top: 8px; }

.order-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.order-card__title { margin: 0 0 4px; font-size: var(--fs-xl); }
.order-card__lead { margin: 0 0 16px; color: var(--muted); font-size: var(--fs-sm); }
.order-form[aria-busy="true"] .order-form__submit { opacity: 0.7; cursor: progress; }
.order-form__submit { width: 100%; }
.order-form__note { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.order-card__info { display: grid; gap: 6px; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: var(--fs-sm); }
.send-list { margin: 16px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.print-head { display: none; }

/* ---------- Заявка принята (ТЗ_6, п. 2.3.9) ---------- */
.placed { max-width: 760px; }
.placed__lead { font-size: var(--fs-lg); }
.placed__lines { margin: 0 0 16px; border: 1px solid var(--line); }
.placed__lines th { width: auto; color: var(--ink); font-size: var(--fs-md); font-weight: 600; }
.placed__lines td { color: var(--muted); white-space: nowrap; }
.placed__lines .placed__sum { color: var(--ink); font-weight: 700; text-align: right; }
.placed__total th, .placed__total td { border-bottom: 0; color: var(--ink); font-weight: 800; }

/* ---------- Контакты (ТЗ_6, п. 2.6) ---------- */
.contacts { display: grid; gap: 16px; margin: 0 0 32px; }
.contacts__card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.contacts__shop { margin: 0 0 8px; font-size: var(--fs-lg); }
.contacts__list { margin: 0; }
.contacts__row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.contacts__row dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.contacts__row dd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.contacts__value { min-width: 0; color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
a.contacts__value:hover { color: var(--action); }
.contacts__phone { font-size: var(--fs-xl); font-weight: 800; }
.contacts__subtitle { margin: 16px 0 4px; font-size: var(--fs-md); }
.contacts__hours th { width: 50%; }
.copy {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); color: var(--navy); cursor: pointer;
}
.copy:hover { border-color: var(--navy); }
.copy .icon { width: 18px; height: 18px; }
.map { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--field); }
.map__frame { display: block; width: 100%; height: 100%; border: 0; }
.map__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 10px 0 0; font-weight: 700; }
.contacts-block { max-width: 760px; margin: 0 0 32px; }
.contacts-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.contacts-block__head h2 { margin: 0; }
.requisites { border-top: 1px solid var(--line); }
.requisites td { overflow-wrap: anywhere; }

/* ---------- Главная (ТЗ_6, п. 2.8) ---------- */
.home-head__lead { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: var(--fs-lg); }
.home-block { margin: 0 0 40px; }
.home-block__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.home-block__head h2 { margin: 0; }
.home-block__link { font-weight: 700; }
.home-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.home-section { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.home-section__title { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; text-decoration: none; }
.home-section__title:hover { color: var(--action); }
.home-section__icon { width: 36px; height: 36px; color: var(--navy); }
.home-section__count { margin: 2px 0 0 48px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
/* До 720 px подразделов нет: разделы — короткий список, популярные товары ближе. Ссылки остаются в HTML. */
.home-section__links { display: none; flex-wrap: wrap; gap: 2px 16px; margin: 10px 0 0 48px; padding: 0; list-style: none; font-size: var(--fs-sm); }
.home-section__links a { display: inline-block; padding: 3px 0; color: var(--muted); text-decoration: none; }
.home-section__links a:hover { color: var(--action); }
.home-section__links .home-section__more { color: var(--link); font-weight: 700; }
.home-order { display: grid; gap: 16px; }
.home-order .home-block { margin: 0; }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps__item { position: relative; min-height: 34px; padding-left: 48px; color: var(--muted); }
.steps__item::before {
  content: counter(step); counter-increment: step;
  position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-variant-numeric: tabular-nums;
}
.steps__item strong { display: block; color: var(--ink); }
.home-store { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.home-store__list { margin: 0 0 16px; }
.home-store__list dt { margin-top: 10px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.home-store__list dt:first-child { margin-top: 0; }
.home-store__list dd { margin: 2px 0 0; color: var(--ink); }
.home-store__phone { color: var(--ink); font-size: var(--fs-lg); font-weight: 800; text-decoration: none; }

/* ---------- Инфостраницы (ТЗ_6, п. 2.7) ---------- */
.info { display: grid; gap: 16px; max-width: 860px; }
.info__text { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.info__contacts { padding: 16px 20px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r-card); background: var(--paper); }
.info__contacts p { margin: 0; }
.info__contacts-title { color: var(--ink); font-weight: 700; }
.info__contacts .info__contacts-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin: 6px 0; }
.info__phone { color: var(--ink); font-size: var(--fs-xl); font-weight: 800; text-decoration: none; }
.info__contacts-note { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- 404 и «Форма устарела» (ТЗ_6, п. 2.9) ---------- */
.error-page { max-width: 760px; }
.error-page__lead { font-size: var(--fs-lg); }
.error-page__search { max-width: 560px; margin: 0 0 16px; }
.error-page .error-page__sections { flex-wrap: wrap; margin: 0 0 16px; padding: 0; overflow: visible; }
.error-page__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Совместимость с разметкой Oscar (ТЗ_4, п. 2.1.6) ---------- */
/* Страницы Oscar на Bootstrap до их переверстки в ТЗ_5 и ТЗ_6. Удалять по мере переверстки. */
.row { display: flex; flex-wrap: wrap; margin-inline: -12px; }
.row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding-inline: 12px; min-width: 0; }
.list-unstyled { list-style: none; padding-left: 0; }
.form-group { margin-bottom: 16px; }
.form-group > label, .col-form-label { display: block; margin-bottom: 6px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-control { width: 100%; }
.help-block, .form-text, .text-muted { color: var(--muted); font-size: var(--fs-sm); }
.error-block, .errorlist, .invalid-feedback { color: var(--danger); font-size: var(--fs-sm); }
.errorlist { padding-left: 18px; }
.btn-primary, .btn-success { background: var(--action); }
.btn-secondary, .btn-default, .btn-info { background: var(--navy); }
.btn-outline-secondary, .btn-light, .btn-link { background: var(--paper); border-color: var(--line-strong); color: var(--navy); }
.btn-outline-secondary:hover, .btn-light:hover, .btn-link:hover { background: var(--field); color: var(--navy); }
.btn-danger { background: var(--danger); }
.btn-lg { min-height: 52px; padding-inline: 24px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.alert { margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r-control); background: var(--paper); }
.alert-success { border-left-color: var(--ok); }
.alert-warning { border-left-color: var(--wait); }
.alert-danger, .alert-error { border-left-color: var(--danger); }
.table { width: 100%; border-collapse: collapse; background: var(--paper); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.card, .well { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
.breadcrumb { display: flex; flex-wrap: wrap; margin: 0 0 8px; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding: 0 8px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; padding: 0; list-style: none; }
.page-link, .pagination li > a, .pagination li > span {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); text-decoration: none;
}
.page-item.active .page-link, .pagination .active > a, .pagination .active > span { background: var(--navy); border-color: var(--navy); color: #fff; }
.price_color { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.d-none { display: none !important; }
.float-right { float: right; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.img-thumbnail { border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); }

/* ---------- Планшет: 720 px и шире ---------- */
@media (min-width: 720px) {
  :root { --gutter: 24px; --cookie-reserve: 96px; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }

  .topbar {
    display: block;
    height: var(--topbar-h);
    background: var(--ink); color: var(--on-ink);
    border-bottom: 3px solid var(--signal);
    font-size: var(--fs-xs);
  }
  .topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; }
  .topbar__info, .topbar__phones { display: flex; align-items: center; gap: 20px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
  .topbar__item { display: inline-flex; align-items: center; gap: 6px; }
  .topbar__item .icon { width: 15px; height: 15px; color: var(--signal); }
  .topbar__hours { display: none; }
  .topbar a { color: #fff; text-decoration: none; }
  .topbar a:hover { color: #fff; text-decoration: underline; }
  .topbar__phone { font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
  .topbar__label { display: none; color: var(--on-ink-muted); }
  .topbar__staff { color: var(--on-ink) !important; }

  .header { position: sticky; top: 0; height: var(--header-h); transition: box-shadow 0.2s var(--ease); }
  .header.is-stuck { box-shadow: var(--shadow-stuck); }
  .header__inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "logo catalog search phone smeta";
    align-items: center; gap: 12px;
    height: 100%; padding-block: 0;
  }
  .header__catalog, .header__phone, .header__smeta { display: block; }
  .header__catalog { grid-area: catalog; }
  .header__phone { grid-area: phone; }
  .header__smeta { grid-area: smeta; }
  .logo__sub { display: none; }

  .page { padding-block: 24px 64px; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }

  .bar { display: none; }
  .footer { padding-bottom: 0; }
  .has-cookie-banner .footer { padding-bottom: var(--cookie-reserve); }
  .cookie {
    left: 50%; right: auto; bottom: 16px; width: min(920px, calc(100% - 32px)); transform: translateX(-50%);
    flex-direction: row; align-items: center; gap: 20px; padding: 12px 16px 12px 20px;
  }
  .cookie .btn { align-self: center; flex: none; }

  .chips__list { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .sort { width: auto; }
  .sort__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sort__select { flex: none; width: auto !important; min-width: 210px; }
  .crumbs { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; white-space: normal; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .tile { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 12px 12px 16px; }
  .tiles--strip { grid-template-columns: none; grid-auto-columns: calc((100% - 32px) / 3); margin-inline: 0; padding-inline: 0; }
  .pager__item--wide { display: flex; }
  .pager__item--narrow { display: none; }
  .sections { columns: 2; }
  .toast { left: auto; right: 24px; bottom: 24px; max-width: 440px; }

  .row > .col-sm-4 { flex-basis: 33.333%; max-width: 33.333%; }
  .row > .col-sm-6 { flex-basis: 50%; max-width: 50%; }
  .row > .col-sm-8 { flex-basis: 66.667%; max-width: 66.667%; }

  .home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-section { padding: 16px 20px; }
  .home-section__links { display: flex; }
  .home-order { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
  .map { aspect-ratio: 16 / 10; }
  .info__text { padding: 28px 32px; }
}

/* Смета таблицей — от 720 px и при печати: ширина листа бывает меньше 720 px (ТЗ_6, п. 2.2.6). */
@media (min-width: 720px), print {
  .smeta-table {
    display: table; border: 1px solid var(--line); border-radius: var(--r-card);
    border-collapse: separate; border-spacing: 0; background: var(--paper); overflow: hidden;
  }
  .smeta-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .smeta-table tbody { display: table-row-group; }
  .smeta-line { display: table-row; padding: 0; border: 0; border-radius: 0; background: none; }
  .smeta-table th, .smeta-line > td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
  .smeta-table th { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
  .smeta-line:last-child > td { border-bottom: 0; }
  .smeta-line--error > td { background: #fdf3f2; }
  .smeta-table .smeta-table__num { text-align: right; white-space: nowrap; }
  .smeta-line__price { color: var(--text); font-size: var(--fs-md); }
  .smeta-line__label { display: none; }
  .smeta-line__remove { width: 1%; }
}

@media (min-width: 720px) and (max-width: 899.98px) {
  .header-btn--smeta .header-btn__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-btn--smeta { padding: 0 12px; }
}

/* ---------- Компьютер: 1100 px и шире ---------- */
@media (min-width: 1100px) {
  .topbar__hours { display: inline-flex; }
  .topbar__label { display: inline; margin-right: 6px; }
  .logo__sub { display: block; }
  .header__inner { gap: 16px; }
  .header-btn__label { display: inline; }
  .header-btn--phone { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; }
  .header-btn--phone .icon { display: none; }

  /* Мега-меню: разделы слева, панель активного раздела справа (ТЗ_4, п. 2.4.2). */
  .mm {
    position: absolute; inset: auto 0 auto 0; top: 100%;
    width: min(var(--container), 100%); margin-inline: auto;
    max-height: calc(100vh - var(--header-h) - var(--topbar-h) - 16px);
    flex-direction: row;
    border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
  }
  .mm__head { display: none; }
  .mm__sections {
    flex: 0 0 336px; padding: 8px 0;
    background: var(--field); border-right: 1px solid var(--line);
  }
  .mm__row { border-bottom: 0; }
  .mm__link { min-height: 38px; padding: 6px 16px 6px 13px; border-left: 3px solid transparent; font-size: var(--fs-sm); }
  .mm__icon { width: 24px; height: 24px; }
  .mm__toggle { display: none; }
  .mm__section.is-active > .mm__row .mm__link { border-left-color: var(--signal); background: var(--paper); color: var(--ink); font-weight: 800; }
  .mm__section.is-active > .mm__row .mm__icon { color: var(--action); }
  .mm__panel {
    position: absolute; top: 0; bottom: 0; left: 336px; right: 0;
    padding: 24px 32px 32px; background: var(--paper); overflow-y: auto;
  }
  .mm__section.is-open .mm__panel { display: none; }
  .mm__section.is-active .mm__panel { display: block; }
  .mm__panel-title { display: block; margin: 0 0 4px; color: var(--ink); font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; }
  .mm__all { margin: 0 0 20px; font-size: var(--fs-sm); }
  .mm__groups { columns: 3 220px; column-gap: 32px; }
  .mm__group { break-inside: avoid; padding: 0 0 16px; }
  .mm__items a { padding: 3px 0; font-size: var(--fs-sm); }

  .footer__grid { grid-template-columns: 1.2fr 2fr 1fr; gap: 48px; padding-block: 48px 40px; }
  .footer__list li { padding: 3px 0; }
  .footer__brand { grid-column: auto; }
  .footer__catalog .footer__list { columns: 2; column-gap: 32px; }
  .footer__catalog li { break-inside: avoid; }

  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles--strip { grid-template-columns: none; grid-auto-columns: calc((100% - 48px) / 4); }
  .sections { columns: 3; }
  .product__main { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
  /* Блок покупки липкий: остаётся на экране при прокрутке (ТЗ_5, п. 2.4.4). */
  .product__buy { position: sticky; top: calc(var(--header-h) + 16px); }

  .row > .col-md-3 { flex-basis: 25%; max-width: 25%; }
  .row > .col-md-4 { flex-basis: 33.333%; max-width: 33.333%; }
  .row > .col-md-6 { flex-basis: 50%; max-width: 50%; }
  .row > .col-md-8 { flex-basis: 66.667%; max-width: 66.667%; }
  .row > .col-md-9 { flex-basis: 75%; max-width: 75%; }
  .row > .col-lg-3 { flex-basis: 25%; max-width: 25%; }

  .home-sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smeta { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
  /* Форма заявки липкая: остаётся на экране, пока прокручивается длинная смета. */
  .smeta__side { position: sticky; top: calc(var(--header-h) + 16px); }
  .contacts { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
  .map { aspect-ratio: 4 / 3; }
}

/* Меню открыто на телефоне: страница под панелью не прокручивается. */
html.menu-open, html.menu-open body { overflow: hidden; }
/* Открытое меню — поверх мобильного бара и плашки cookie. */
html.catalog-open .header { z-index: 95; }
@media (min-width: 1100px) {
  html.menu-open, html.menu-open body { overflow: visible; }
}

/* ---------- Уменьшение движения (UX-документ, п. 1.1) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Печать ---------- */
@media print {
  .topbar, .header__catalog, .header__search, .header__smeta, .mm, .bar, .cookie, .footer, .toast, .tile__buy, .buy__form { display: none !important; }
  .header { position: static; box-shadow: none; }
  body { background: #fff; padding: 0 !important; }
  /* Смета: шапка листа с контактами вместо шапки сайта; без формы заявки, кнопок и фото (ТЗ_6, п. 2.2.6). */
  .page-smeta .header, .page-smeta .crumbs, .smeta__side, .smeta-head__print, .stepper__btn, .smeta-line__remove, .smeta-table__remove,
  .smeta-total__recalc, .smeta-line__media, .send-list, .page-smeta .messages, .skip-link { display: none !important; }
  .print-head { display: block; margin: 0 0 12px; font-size: var(--fs-sm); }
  .print-head p { margin: 0 0 4px; }
  .smeta { display: block; }
  .smeta-table { border-radius: 0; }
  .smeta-line .stepper__input { min-height: 0; padding: 0; border: 0 !important; background: none !important; text-align: left; }
  .smeta-total { margin-top: 12px; border: 0; padding: 0; }
}
