/* ЕВРОВИТПРОМ — стили витрины.
   Один файл, без сборки и внешних шрифтов: сайт должен открываться мгновенно. */

:root {
  --brand: #a8001f;
  --brand-dark: #86001a;
  --brand-soft: #fdecef;
  /* Цвет бренда для текста и ссылок: у светлого бренда (жёлтый) он темнее заливки. */
  --brand-ink: var(--brand);
  /* Текст на заливке бренда и светлый оттенок бренда для тёмного фона. */
  --on-brand: #fff;
  --brand-tint: #ffb3c0;
  --ink: #15181d;
  --ink-2: #2a2f37;
  --text: #1c2026;
  --muted: #68707d;
  --line: #e4e7ec;
  --bg: #f4f5f7;
  --card: #ffffff;
  /* Белые поверхности (шапка, панели, поля), фон под фото товара и текст на тёмном —
     отдельные токены: тёмная тема меняет их, не трогая правила ниже. */
  --surface: #ffffff;
  --image-bg: #ffffff;
  --on-dark: #ffffff;
  /* Верхняя полоса шапки и подвал. */
  --top-bg: var(--ink);
  --top-fg: #c9ced6;
  --top-hover: #fff;
  --foot-bg: var(--ink);
  --ok: #157f3c;
  --ok-soft: #e6f5ec;
  --warn: #a35a00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .35);
  --wrap: 1280px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font: 16px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.icon { flex: none; vertical-align: -0.18em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 650; line-height: 1.2; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--brand { background: var(--brand); color: var(--on-brand); }
.btn--brand:hover { background: var(--brand-dark); }
.btn--light { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn--light:hover { border-color: #c9ced6; background: #fafbfc; }
.btn--ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .28); color: var(--on-dark); }
.btn--ghost:hover { background: rgba(255, 255, 255, .16); }
.btn--lg { padding: 14px 24px; font-size: 1.03rem; }
.btn--sm { padding: 8px 14px; font-size: .92rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 10px; width: 42px; height: 42px; }
.btn.is-added { background: var(--ok); }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; background: none; border-radius: 10px; }
.iconbtn:hover { background: rgba(0, 0, 0, .06); }
.linkbtn { border: 0; background: none; padding: 6px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--brand-ink); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); font-weight: 650; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- шапка ---------- */
.header { position: sticky; top: 0; z-index: 60; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.topbar { background: var(--top-bg); color: var(--top-fg); font-size: .86rem; }
.topbar__row { display: flex; align-items: center; gap: 22px; min-height: 38px; }
.topbar__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar__item--link:hover, .topbar__nav a:hover { color: var(--top-hover); }
.topbar__nav { margin-left: auto; display: flex; gap: 20px; }

.mainbar__row { display: flex; align-items: center; gap: 18px; min-height: 76px; }
.mainbar__burger { display: none; }
.logo { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.logo__mark { position: relative; flex: none; width: 58px; height: 58px; }
.logo__mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Ссылка на главную: при наведении шестерня знака поворачивается на два зуба, название
   краснеет — видно, что логотип нажимается. Буквы в середине стоят на месте. */
.logo__gear { transition: transform .7s cubic-bezier(.3, .7, .2, 1); }
.logo__text b { transition: color .2s; }
.logo:hover .logo__gear, .logo:focus-visible .logo__gear { transform: rotate(45deg); }
.logo:hover .logo__text b, .logo:focus-visible .logo__text b { color: var(--brand-ink); }
.logo--light:hover .logo__text b, .logo--light:focus-visible .logo__text b { color: #fff; }
@media (prefers-reduced-motion: reduce) { .logo .logo__gear { transition: transform .45s ease-out !important; } }
.logo__text { display: grid; line-height: 1.15; }
.logo__text b { font-size: 1.42rem; font-weight: 800; letter-spacing: .02em; }
.logo__text small { margin-top: 2px; font-size: .8rem; color: var(--muted); max-width: 230px; }
/* На узких ноутбуках подпись под названием уступает место строке поиска. */
@media (max-width: 1180px) { .logo__text small { display: none; } }
.logo--light .logo__text small { color: #9aa2ae; }
/* У знака тёмные буквы — на тёмном фоне (подвал) он стоит на белом круге. */
.logo--light .logo__mark { background: #fff; border-radius: 50%; box-shadow: 0 0 0 3px #fff; }

.search { position: relative; flex: 1; min-width: 160px; }
.search__input {
  width: 100%; height: 46px; padding: 0 50px 0 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  font: inherit; color: inherit; outline: none; transition: border-color .15s, background .15s;
}
.search__input:focus { border-color: var(--brand); background: var(--surface); }
.search__btn { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.search__btn:hover { color: var(--brand-ink); background: var(--brand-soft); }
.search__drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; max-height: min(70vh, 520px); overflow: auto;
}
.suggest__cat { display: block; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.suggest__item { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 8px; }
.suggest__item img { width: 52px; height: 40px; object-fit: contain; background: var(--image-bg); border-radius: 6px; }
.suggest__item span { display: block; font-size: .94rem; line-height: 1.3; }
.suggest__item small { color: var(--muted); font-size: .86rem; }
.suggest__cat:hover, .suggest__item:hover, .suggest__all:hover { background: var(--bg); }
.suggest__all { display: block; padding: 10px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--brand-ink); font-weight: 650; text-align: center; border-radius: 0 0 8px 8px; }
.suggest__empty { padding: 12px 10px; color: var(--muted); }
.search--page { max-width: 520px; margin: 0 auto 18px; }

.phones { display: grid; line-height: 1.25; text-align: right; flex: none; }
.phones__main { font-weight: 750; font-size: 1.04rem; }
.phones__second { font-size: .9rem; color: var(--muted); }
.phones a:hover { color: var(--brand-ink); }
.brandicon { display: block; flex: none; }
.messengers { display: flex; gap: 6px; flex: none; }
.messengers__link, .pricebox__msg { display: inline-grid; border-radius: 50%; transition: transform .15s; }
.messengers__link:hover, .pricebox__msg:hover { transform: scale(1.08); }
.mainbar__call { display: none; flex: none; color: var(--brand-ink); background: var(--brand-soft); }
/* Значки в шапке — только на широком экране: уже 1280 px они отнимают место у поиска и выталкивают корзину.
   На узких экранах мессенджеры — в меню, в карточке товара и в подвале. */
@media (max-width: 1280px) { .messengers { display: none; } }

.cartbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--bg); font-weight: 650; flex: none; }
.cartbtn:hover { background: var(--brand-soft); color: var(--brand-ink); }
.cartbtn__count {
  position: absolute; left: 26px; top: 3px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: .74rem; font-weight: 700; line-height: 20px; text-align: center;
}

/* ---------- меню каталога ---------- */
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.mega__grid { display: grid; grid-template-columns: 300px 1fr; gap: 0; padding-top: 14px; padding-bottom: 22px; max-height: calc(100vh - 130px); }
.mega__sections { list-style: none; margin: 0; padding: 0 14px 0 0; border-right: 1px solid var(--line); overflow: auto; }
.mega__section { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 10px; font-weight: 650; }
.mega__section.is-active, .mega__section:hover { background: var(--brand-soft); color: var(--brand-ink); }
.mega__section--link { color: var(--brand-ink); }
.mega__panels { padding-left: 26px; overflow: auto; }
.mega__panel { display: none; }
.mega__panel.is-active { display: block; }
.mega__group[hidden] { display: none; }
.mega__title { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px 10px; font-weight: 750; font-size: 1.2rem; }
.mega__back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.mega__back:hover { border-color: var(--brand); color: var(--brand-ink); }
.mega__back .icon { transform: rotate(180deg); }
/* Пункты со значками разделов — в три колонки, как в меню поставщика. */
.mega__items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 16px; }
.megaitem { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 12px 6px 8px; border-radius: 14px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.megaitem:hover { background: var(--bg); color: var(--brand-ink); }
.megaitem__pic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; }
.megaitem__pic img { width: 46px; height: 46px; object-fit: contain; }
.megaitem__pic--empty { background: var(--bg); color: var(--muted); }
.megaitem__name { flex: 1; min-width: 0; }
.megaitem > .icon { flex: none; color: var(--muted); }
.megaitem--all { background: var(--brand-soft); color: var(--brand-ink); }
.megaitem--all:hover { background: var(--brand-soft); filter: brightness(.97); }
.megaitem--all .megaitem__pic { background: var(--surface); }
@media (max-width: 1180px) { .mega__items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Мобильное меню: на весь экран, с уровнями (разделы → пункты → подпункты), как у поставщика. */
.mmenu { position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 22, .55); }
.mmenu__panel { width: 100%; height: 100%; background: var(--bg); display: flex; flex-direction: column; }
.mmenu__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.mmenu__head .linkbtn { font-size: 1rem; font-weight: 600; }
.mmenu__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 28px; }
.mmenu__level[hidden] { display: none; }
.mmenu__level { display: grid; gap: 2px; }
/* Строка раздела: название и круглая стрелка — нажимается вся строка. */
.mmenu__row, .mmenu__item, .mmenu__back {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 10px 8px 12px;
  border: 0; border-radius: 14px; background: none; color: var(--ink); font: inherit; font-weight: 650; line-height: 1.25; text-align: left; cursor: pointer;
}
.mmenu__row { font-size: 1.06rem; justify-content: space-between; }
.mmenu__row:active, .mmenu__item:active, .mmenu__back:active { background: var(--surface); }
.mmenu__row--link { color: var(--brand-ink); }
.mmenu__go { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 1.5px solid var(--brand); border-radius: 50%; color: var(--brand-ink); background: var(--surface); }
/* «Назад»: стрелка влево и название уровня; остаётся наверху при прокрутке. */
.mmenu__back { position: sticky; top: -10px; z-index: 1; margin-bottom: 6px; padding-left: 8px; font-size: 1.1rem; background: var(--bg); border-radius: 0; }
.mmenu__back .mmenu__go .icon { transform: rotate(180deg); }
.mmenu__back b { flex: 1; }
.mmenu__item { font-weight: 600; }
.mmenu__pic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; color: var(--brand-ink); }
.mmenu__pic img { width: 44px; height: 44px; object-fit: contain; }
.mmenu__name { flex: 1; min-width: 0; }
.mmenu__item--all { margin-bottom: 4px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.mmenu__item--all .mmenu__pic { width: 40px; height: 40px; margin: 0 4px; border-radius: 50%; background: var(--surface); }
.mmenu__item.is-current { background: var(--surface); box-shadow: inset 3px 0 0 var(--brand); }
.mmenu__item .mmenu__go { width: 32px; height: 32px; border-color: var(--line); color: var(--muted); }
.mmenu__links { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; }
.mmenu__links a { padding: 12px; font-weight: 500; }
.mmenu__contacts { margin-top: 8px; padding: 16px; border-radius: 14px; background: var(--surface); display: grid; gap: 10px; font-weight: 600; }
.mmenu__contacts a, .mmenu__contacts span { display: flex; align-items: center; gap: 8px; }
/* На планшете — панель слева, а не весь экран. */
@media (min-width: 620px) { .mmenu__panel { width: 440px; box-shadow: var(--shadow-lg); } }

/* ---------- первый экран ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 88% -10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 62%),
    radial-gradient(700px 380px at -5% 110%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px),
    var(--ink);
  color: var(--on-dark);
}
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 68px; }
.eyebrow { display: inline-block; margin: 0 0 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .84rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-tint); }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); line-height: 1.08; }
.hero__lead { margin: 18px 0 28px; max-width: 560px; color: #c9ced6; font-size: 1.1rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 36px; margin: 40px 0 0; }
.hero__stats dt { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.hero__stats dd { margin: 2px 0 0; color: #9aa2ae; font-size: .92rem; }
.hero__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.herotile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--image-bg); aspect-ratio: 4 / 3; }
.herotile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.herotile:hover img { transform: scale(1.05); }
.herotile span { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 26px 14px 12px; background: linear-gradient(transparent, rgba(15, 18, 22, .86)); font-weight: 650; }

/* ---------- блоки главной ---------- */
.section { padding: 56px 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section__head h2 a:hover { color: var(--brand-ink); }

.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.sectioncard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.sectioncard:hover { box-shadow: var(--shadow); border-color: #d5d9e0; }
.sectioncard__head { display: block; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 2px solid var(--brand); }
.sectioncard__head h3 { font-size: 1.18rem; }
.sectioncard__head:hover h3 { color: var(--brand-ink); }
.sectioncard__count { color: var(--muted); font-size: .88rem; }
.sectioncard__links { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; }
.sectioncard__links a { display: block; padding: 5px 0; color: var(--ink-2); }
.sectioncard__links a:hover { color: var(--brand-ink); }
.sectioncard__more { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); font-weight: 650; font-size: .94rem; }

.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.perk { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.perk__icon { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 14px; }
.perk h3 { margin-bottom: 8px; }
.perk p { margin: 0; color: var(--muted); font-size: .96rem; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.steps li { counter-increment: step; position: relative; padding: 22px 22px 22px 74px; background: var(--bg); border-radius: var(--radius); }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--on-dark); font-weight: 800; display: grid; place-items: center; }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: .95rem; }

.cta { background: var(--ink); color: var(--on-dark); padding: 52px 0; }
.cta__grid { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.cta p { margin: 10px 0 0; color: #c9ced6; max-width: 640px; }
.cta__actions { display: grid; gap: 12px; justify-items: center; }
.cta__phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.cta__phone:hover { color: var(--brand-tint); }

/* ---------- страницы каталога ---------- */
.page { padding-top: 22px; padding-bottom: 64px; }
.page--text { max-width: 880px; }
.page > h1 { margin-bottom: 22px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: .9rem; color: var(--muted); }
.crumbs a:hover { color: var(--brand-ink); }
.crumbs__sep { color: #c3c7ce; }
.crumbs [aria-current] { color: var(--text); }
.pagehead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 20px; }
.pagehead__count { color: var(--muted); }
/* «Перейти в каталог» ведёт к разделам на главной: шапка липкая, заголовок не должен уйти под неё. */
#catalog { scroll-margin-top: 110px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, border-color .2s, transform .2s; }
.tile:hover { box-shadow: var(--shadow); border-color: #d5d9e0; transform: translateY(-2px); }
.tile__media { display: block; aspect-ratio: 4 / 3; background: var(--image-bg); overflow: hidden; }
.tile__media img { width: 100%; height: 100%; object-fit: cover; }
/* У раздела нет картинки — ровная заглушка, чтобы плитки в ряду были одной высоты. */
.tile__media--empty { display: grid; place-items: center; background: linear-gradient(135deg, #eef0f3, #e3e6eb); color: #b3b9c3; }
.tile__name { padding: 12px 14px; font-weight: 650; line-height: 1.3; flex: 1; }
.tile__count { position: absolute; right: 10px; top: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(21, 24, 29, .78); color: var(--on-dark); font-size: .78rem; font-weight: 650; }
.tile:not(:has(.tile__media)) .tile__count { position: static; margin: 0 14px 12px; align-self: flex-start; background: var(--bg); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .93rem; font-weight: 550; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.chip i { font-style: normal; color: var(--muted); font-size: .84rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.toolbar__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 550; }
.switch__dot { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #cfd4dc; transition: background .15s; }
.switch__dot::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.is-on .switch__dot { background: var(--ok); }
.switch.is-on .switch__dot::after { transform: translateX(16px); }
.dropdown { position: relative; }
.dropdown summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; font-weight: 550; list-style: none; cursor: pointer; background: var(--surface); }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary .icon { transform: rotate(90deg); }
.dropdown[open] summary { border-color: var(--brand); }
.dropdown__menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; max-height: 340px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.dropdown--right .dropdown__menu { left: auto; right: 0; }
.dropdown__menu a { display: flex; justify-content: space-between; gap: 14px; padding: 8px 10px; border-radius: 8px; }
.dropdown__menu a:hover { background: var(--bg); }
.dropdown__menu a.is-current { color: var(--brand-ink); font-weight: 650; }
.dropdown__menu i { font-style: normal; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* ---------- карточка товара в списке ---------- */
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); border-color: #d5d9e0; transform: translateY(-2px); }
.card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--image-bg); border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card__badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.4; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--sale { background: var(--brand); color: var(--on-brand); }
.badge--dark { background: var(--ink); color: var(--on-dark); }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; flex: 1; }
.card__title { font-weight: 650; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__title:hover { color: var(--brand-ink); }
.card__specs { list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.card__specs li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.card__specs b { color: var(--ink-2); font-weight: 600; text-align: right; }
.card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.card__price { display: grid; line-height: 1.2; }
.card__price s { color: var(--muted); font-size: .88rem; }
.card__price b { font-size: 1.24rem; font-weight: 800; white-space: nowrap; }
.card__price small { font-size: .82rem; font-weight: 600; color: var(--muted); }
.card__price .card__ask { font-size: 1rem; font-weight: 650; color: var(--ink-2); white-space: normal; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 30px; }
.pager__item { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; }
.pager__item:hover { border-color: var(--brand); color: var(--brand-ink); }
.pager__item.is-current { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.pager__item--nav { font-size: 1.3rem; }
.pager__gap { align-self: center; color: var(--muted); padding: 0 2px; }

.empty { padding: 44px 20px; text-align: center; background: var(--surface); border: 1px dashed #cfd4dc; border-radius: var(--radius); color: var(--muted); }
.empty p { max-width: 520px; margin: 0 auto 16px; }

.prose { max-width: 820px; }
.prose h2 { font-size: 1.25rem; margin: 1.5em 0 .5em; }
.prose h3, .prose h4 { margin: 1.3em 0 .4em; font-size: 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 1em; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose--muted { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.page--text .prose { margin-bottom: 24px; }

/* ---------- страница товара ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 36px; align-items: start; }
.gallery { position: sticky; top: 132px; }
.gallery__main { position: relative; background: var(--image-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.gallery__zoom { border: 0; background: none; padding: 0; width: 100%; height: 100%; cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery__thumb { padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--brand); }

.buy h1 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); }
.buy__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 18px; color: var(--muted); font-size: .93rem; }
.buy__meta b { color: var(--text); font-weight: 600; }
.avail { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.avail--ok { color: var(--ok); }
.avail--order { color: var(--warn); }

.pricebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.pricebox__old { color: var(--muted); }
.pricebox__now { font-size: 2.1rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.pricebox__now small { font-size: 1.05rem; font-weight: 650; color: var(--muted); }
.pricebox__now--ask { font-size: 1.5rem; }
.pricebox__note { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.pricebox__actions { display: flex; gap: 10px; margin: 18px 0 10px; }
.pricebox__add { flex: 1; }
.pricebox__contact { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pricebox__call { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-weight: 700; font-size: 1.05rem; }
.pricebox__call:hover { color: var(--brand-ink); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); flex: none; }
.qty button { width: 40px; height: 46px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.qty button:hover { color: var(--brand-ink); }
.qty input { width: 48px; height: 46px; border: 0; text-align: center; font: inherit; font-weight: 650; background: none; outline: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.keyspecs { margin: 22px 0 10px; display: grid; gap: 0; }
.keyspecs div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.keyspecs dt { color: var(--muted); }
.keyspecs dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.assure { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: .93rem; }
.assure li { display: inline-flex; align-items: center; gap: 7px; }
.assure .icon { color: var(--brand-ink); }

.details { margin-top: 44px; display: grid; gap: 18px; }
.details__block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.details__block h2 { margin-bottom: 16px; font-size: 1.3rem; }
.specs { width: 100%; border-collapse: collapse; max-width: 820px; }
.specs th, .specs td { padding: 10px 12px; text-align: left; vertical-align: top; }
.specs th { width: 46%; color: var(--muted); font-weight: 500; }
.specs td { font-weight: 600; }
.specs tr:nth-child(odd) { background: var(--bg); }
.specs tr th:first-child { border-radius: 8px 0 0 8px; }
.specs tr td:last-child { border-radius: 0 8px 8px 0; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs a { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 550; }
.docs a:hover { border-color: var(--brand); color: var(--brand-ink); }
.docs small { color: var(--muted); font-weight: 600; }
.related { margin-top: 44px; }
.details .chips { margin-bottom: 0; }

.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(12, 14, 18, .94); display: grid; place-items: center; padding: 56px 64px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; background: var(--image-bg); border-radius: 10px; }
.lightbox .iconbtn { position: absolute; color: var(--on-dark); }
.lightbox .iconbtn:hover { background: rgba(255, 255, 255, .14); }
.lightbox__close { right: 14px; top: 12px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2.2rem; line-height: 1; }
.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }

/* ---------- формы ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .9rem; font-weight: 600; }
.field__label i { font-style: normal; font-weight: 400; color: var(--muted); }
.input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: inherit; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 84px; }
.field.has-error .input { border-color: #d92d20; }
.field__error { color: #b42318; font-size: .86rem; min-height: 0; }
.form__error { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #fef3f2; color: #b42318; font-size: .93rem; }
.form__consent { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }
.form__consent a { text-decoration: underline; text-underline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 110; background: rgba(15, 18, 22, .6); display: grid; place-items: center; padding: 16px; overflow: auto; }
.modal__box { position: relative; width: min(460px, 100%); background: var(--surface); border-radius: 18px; padding: 30px 28px 26px; box-shadow: var(--shadow-lg); }
.modal__close { position: absolute; right: 10px; top: 10px; }
.modal__title { font-size: 1.4rem; padding-right: 30px; }
.modal__lead { margin: 8px 0 18px; color: var(--muted); }
.modal__product { margin: -6px 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-weight: 600; font-size: .95rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 130; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--on-dark); box-shadow: var(--shadow-lg); font-weight: 550; max-width: calc(100vw - 32px); }
.toast a { color: var(--brand-tint); font-weight: 700; white-space: nowrap; }

/* ---------- корзина ---------- */
.cart__loading { padding: 40px 0; color: var(--muted); }
.cart__grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.cartlist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 12px; }
.cartitem { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto 40px; gap: 16px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cartitem__media img { width: 96px; height: 72px; object-fit: contain; }
.cartitem__name { font-weight: 650; line-height: 1.3; }
.cartitem__name:hover { color: var(--brand-ink); }
.cartitem__sku { color: var(--muted); font-size: .85rem; }
.cartitem__price { color: var(--muted); font-size: .9rem; }
.cartitem__sum { font-weight: 800; font-size: 1.08rem; white-space: nowrap; text-align: right; min-width: 120px; }
.cartitem__remove { color: var(--muted); }
.cartitem__remove:hover { color: var(--brand-ink); background: var(--brand-soft); }
.checkout { position: sticky; top: 132px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.checkout__total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 1.05rem; }
.checkout__total b { font-size: 1.7rem; font-weight: 800; }
.checkout__note { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }

.thanks { max-width: 560px; margin: 40px auto; padding: 44px 28px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.thanks__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.thanks__icon--muted { background: var(--bg); color: var(--muted); font-weight: 800; font-size: 1.3rem; }
.thanks h1 { margin-bottom: 14px; font-size: 1.7rem; }
.thanks p { color: var(--muted); }
.thanks p a { color: var(--text); }

/* ---------- контакты ---------- */
.contacts { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.contacts__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.contactcard, .contacts__side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contactcard h2, .contacts__side h2 { font-size: 1.05rem; margin-bottom: 10px; }
.contactcard__big { display: block; margin: 0 0 4px; font-size: 1.14rem; font-weight: 750; }
a.contactcard__big:hover { color: var(--brand-ink); }
.contactcard p { color: var(--muted); font-size: .94rem; margin: 8px 0 0; }
.contactcard__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contacts__side p { color: var(--ink-2); }
.map { margin-top: 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; min-height: 420px; border: 0; }

/* ---------- подвал ---------- */
.footer { background: var(--foot-bg); color: #c9ced6; font-size: .94rem; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 36px; padding-top: 52px; padding-bottom: 36px; }
.footer__col { display: grid; gap: 8px; align-content: start; }
.footer__col a:hover { color: var(--on-dark); }
.footer__title { color: var(--on-dark); font-size: 1rem; margin-bottom: 6px; }
.footer__note { margin: 14px 0 0; color: #9aa2ae; max-width: 320px; }
.footer__phone { color: var(--on-dark); font-weight: 700; font-size: 1.06rem; }
.footer__msg { display: inline-flex; align-items: center; gap: 8px; }
.footer .btn { justify-self: start; margin-top: 8px; }
.logo--light { color: var(--on-dark); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 26px; border-top: 1px solid rgba(255, 255, 255, .1); color: #8a929f; font-size: .84rem; }
.footer__credit a { color: #c9ced6; text-decoration: underline; text-underline-offset: 2px; }
.footer__credit a:hover { color: var(--on-dark); }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1100px) {
  .phones, .messengers { display: none; }
  .mainbar__call { display: inline-grid; }
  .topbar__item--link { display: none; }
  .cart__grid { grid-template-columns: 1fr; }
  .checkout { position: static; }
  .contacts { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  html { scroll-padding-top: 72px; }
  .topbar { display: none; }
  .mainbar__row { min-height: 64px; gap: 10px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 12px; }
  .mainbar__burger { display: inline-grid; margin-left: -8px; }
  .mainbar__catalog { display: none; }
  .logo { margin-right: auto; }
  .logo__mark { width: 46px; height: 46px; }
  .logo__text b { font-size: 1.24rem; }
  .logo__text small { display: none; }
  .cartbtn__label { display: none; }
  .search { order: 5; flex-basis: 100%; }
  .mega { display: none !important; }
  .hero__grid { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; padding-bottom: 44px; }
  .hero__stats { gap: 24px; margin-top: 30px; }
  .section { padding: 40px 0; }
  .cta__grid { grid-template-columns: 1fr; }
  .cta__actions { justify-items: start; }
  /* minmax(0, …): длинное значение характеристики не должно раздвигать колонку шире экрана. */
  .product { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  /* Миниатюры фото — одной лентой с прокруткой вбок: у товара их бывает за двадцать,
     и сеткой они отодвигали цену и кнопку «В корзину» на экран вниз. */
  .gallery__thumbs { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .gallery__thumb { flex: 0 0 76px; scroll-snap-align: start; }
  .gallery { position: static; }
  .details__block { padding: 20px 16px; }
}
@media (max-width: 600px) {
  /* Только боковые поля: вертикальные отступы у блоков свои (шапка, страницы, подвал). */
  .wrap { padding-inline: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__body { padding: 10px 10px 12px; gap: 8px; }
  .card__title { font-size: .92rem; }
  .card__specs { display: none; }
  .card__price b { font-size: 1.05rem; }
  .card__media img { padding: 6px; }
  .badge { font-size: .68rem; padding: 2px 7px; }
  .btn--icon { width: 38px; height: 38px; padding: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero__tiles { gap: 10px; }
  .hero__actions .btn { width: 100%; }
  .footer__grid { grid-template-columns: 1fr; gap: 26px; padding-top: 36px; }
  .cartitem { grid-template-columns: 72px minmax(0, 1fr) 36px; gap: 10px 12px; }
  .cartitem__media img { width: 72px; height: 54px; }
  .cartitem .qty { grid-column: 2; justify-self: start; }
  .cartitem__sum { grid-column: 2; text-align: left; min-width: 0; }
  .cartitem__remove { grid-column: 3; grid-row: 1; }
  .pricebox { padding: 16px; }
  .pricebox__now { font-size: 1.75rem; }
  .specs th { width: 50%; }
  .specs th, .specs td { padding: 8px; font-size: .93rem; }
  .lightbox { padding: 52px 8px; }
  .toolbar { padding: 8px 10px; }
  .modal__box { padding: 26px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .header, .footer, .cta, .toast, .modal, .mmenu, .pricebox__actions, .related { display: none !important; }
  body { background: #fff; }
}

/* ---------- каталог с боковой колонкой: «Категории» и «Фильтры» слева ---------- */
.catalog { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.catalog--wide { grid-template-columns: minmax(0, 1fr); }
.catalog__side { display: grid; gap: 16px; position: sticky; top: 128px; max-height: calc(100vh - 144px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.catalog__main { min-width: 0; }
.catalog__main .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sidebtns { display: none; }
.sidebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.sidebox__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.sidebox__head h2 { font-size: 1.05rem; margin-right: auto; }
.sidebox__back { display: none; }

.catlist { list-style: none; margin: 0; padding: 0; }
.catlist a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); line-height: 1.3; }
.catlist a:hover { background: var(--bg); color: var(--brand-ink); }
.catlist a.is-current { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.catlist i { font-style: normal; font-size: .82rem; color: var(--muted); flex: none; }
.catlist__up { color: var(--muted) !important; font-size: .92rem; }

.filters { display: grid; gap: 4px; }
.filter { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 12px; min-width: 0; }
.filter:first-of-type { border-top: 0; padding-top: 4px; }
.filter legend { padding: 0; font-weight: 650; font-size: .95rem; margin-bottom: 8px; float: left; width: 100%; }
.filter legend + * { clear: both; }
.filter__hint { margin: 0 0 8px; color: var(--muted); font-size: .84rem; }
.filter__range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter__range label { display: grid; gap: 4px; font-size: .84rem; color: var(--muted); }
.filter__range .input { padding: 9px 10px; }
/* Ползунок диапазона: одна ручка у массы техники, две — у «от–до». Ручки — обычные
   поля type=range, наложенные друг на друга: работают с клавиатуры и на телефоне. */
.range { display: grid; gap: 10px; }
.range__single { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.range__single .input { width: 92px; padding: 8px 10px; text-align: center; font-weight: 600; }
.range__slider { position: relative; height: 26px; margin: 2px 11px 0; touch-action: pan-y; }
.range__track { position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; }
.range__track::before { content: ""; position: absolute; left: -11px; right: -11px; top: 0; bottom: 0; border-radius: 3px; background: var(--line); }
.range__fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--brand); }
.range__thumb {
  position: absolute; left: -11px; top: 0; width: calc(100% + 22px); height: 26px; margin: 0; padding: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none; outline: none;
}
.range__thumb::-webkit-slider-runnable-track { height: 26px; background: none; border: 0; }
.range__thumb::-moz-range-track { height: 26px; background: none; border: 0; }
.range__thumb::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; box-sizing: border-box; width: 22px; height: 22px; margin-top: 2px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(15, 18, 22, .28); cursor: grab;
}
.range__thumb::-moz-range-thumb {
  pointer-events: auto; box-sizing: border-box; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(15, 18, 22, .28); cursor: grab;
}
.range__thumb:active::-webkit-slider-thumb { cursor: grabbing; background: var(--brand-soft); }
.range__thumb:active::-moz-range-thumb { cursor: grabbing; background: var(--brand-soft); }
.range__thumb:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }
.range__thumb:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }
.range__scale { position: relative; height: 16px; margin: -4px 11px 0; font-size: .76rem; color: var(--muted); }
.range__scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.range__scale span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: var(--line); }
.range__scale span:first-child { transform: none; }
.range__scale span:first-child::before { left: 0; }
.range__scale span:last-child { transform: translateX(-100%); }
.range__scale span:last-child::before { left: 100%; }
.filter__options { display: grid; gap: 2px; }
.filter--long:not(.is-open) .filter__options { max-height: 244px; overflow: hidden; }
.filter__more { font-size: .88rem; margin-top: 4px; }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 5px 4px; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.check:hover { background: var(--bg); }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.check span { overflow-wrap: anywhere; }
.check i { font-style: normal; font-size: .8rem; color: var(--muted); }
.filters__buttons { display: grid; gap: 8px; padding-top: 10px; position: sticky; bottom: 0; background: var(--surface); }
.toolbar__found { color: var(--ink-2); }

.machinebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 18px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); border: 1px solid #f3c7cf; }
.machinebar .icon { color: var(--brand-ink); }
.massform { display: flex; align-items: flex-end; gap: 8px; }
.massform label { display: grid; gap: 3px; font-size: .84rem; color: var(--ink-2); }
.massform .input { width: 150px; padding: 8px 10px; }
.notice { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius-sm); background: #fff7e6; color: #7a4a00; }

/* ---------- подбор оборудования: тип → бренд → модель ---------- */
.pickersection { background: var(--surface); border-bottom: 1px solid var(--line); padding: 40px 0 36px; }
.pickerbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.pickerbox__lead { margin: 0 0 16px; color: var(--muted); max-width: 760px; }
.picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.picker__field { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.picker select.input { height: 50px; padding: 0 12px; background-color: var(--bg); cursor: pointer; }
.picker select.input:disabled { color: var(--muted); cursor: default; }
.picker__button { height: 50px; }
/* Страницы пути подбора: тип → бренды → модели. */
.podhead { display: flex; align-items: center; gap: 22px; margin-bottom: 20px; }
.podhead h1 { margin: 0 0 6px; }
.podhead__lead { margin: 0; color: var(--muted); max-width: 720px; }
.podhead__pic { flex: none; width: 150px; height: auto; }
.podhead__logo { flex: none; width: 150px; height: 96px; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.podhead__logo img { width: auto; height: auto; max-width: 100%; max-height: 72px; }
.pickerbox--note { margin-top: 26px; }
.pickerbox--note .massform { flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pickerbox--note .massform > span { flex: 1 1 320px; color: var(--ink-2); }
.pickerbox--note .massform label { display: flex; align-items: center; gap: 8px; }
/* Бренды с логотипом — плитками, шесть в ряд; логотипы разной формы вписаны в одно поле. */
.brandtiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.brandtile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; text-align: center; line-height: 1.25; transition: border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.brandtile:hover { border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); transform: translateY(-2px); }
.brandtile__logo { width: 100%; height: 72px; display: flex; align-items: center; justify-content: center; }
/* Высота — числом: логотипы бывают и широкими, и высокими, а процент от ячейки сетки их не держит. */
.brandtile__logo img { width: auto; height: auto; max-width: 86%; max-height: 72px; }
/* Полный список брендов — колонками по буквам. */
.brandlist { columns: 5 180px; column-gap: 28px; }
.brandlist__group { break-inside: avoid; margin-bottom: 16px; display: grid; gap: 2px; }
.brandlist__letter { font-size: 1.05rem; color: var(--brand-ink); padding-bottom: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.brandlist a { padding: 3px 0; color: var(--ink-2); }
.brandlist a:hover { color: var(--brand-ink); }
/* Модели бренда. */
.modeltiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.modeltile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; transition: border-color .15s, color .15s, background .15s; }
.modeltile:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.modeltile .icon { flex: none; color: var(--muted); }
.modeltile:hover .icon { color: var(--brand-ink); }
.link-arrow--back { margin-top: 22px; }
.link-arrow--back .icon { transform: rotate(180deg); }
@media (max-width: 1100px) { .brandtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  /* На телефоне форма выбора заняла бы весь первый экран — на страницах пути её заменяют плитки. */
  .pickerbox--wide { display: none; }
  .brandtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .podhead { align-items: flex-start; gap: 14px; }
  .podhead__pic { width: 96px; }
  .podhead__logo { width: 96px; height: 64px; padding: 8px; }
  .podhead__logo img { max-height: 48px; }
}
@media (max-width: 520px) {
  .brandtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modeltiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brandlist { columns: 2; }
}

/* Плитки типов техники: рисунок машины сверху, название под ним; 12 типов — два ряда по шесть. */
.typetiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.typetile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; line-height: 1.25; text-align: center; transition: border-color .15s, color .15s, box-shadow .15s, transform .15s; }
/* Плитка при наведении не сдвигается: в ней двигается механизм машины, а не она сама. */
.typetile:hover { border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.typetile__pic { width: 100%; max-width: 150px; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.typetile__pic img { width: 100%; height: 100%; object-fit: contain; }
.typetile .icon { color: var(--brand-ink); }
.typetile__name { min-height: 2.5em; display: flex; align-items: center; }
@media (max-width: 1100px) { .typetiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .typetiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.section--flat { padding: 8px 0 0; }
.mainbar__podbor { flex: none; }

@media (max-width: 1100px) {
  .mainbar__podbor span { display: none; }
  .mainbar__podbor { padding: 11px 12px; }
}
@media (max-width: 900px) {
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .catalog__side { position: static; max-height: none; overflow: visible; display: block; }
  .sidebtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  /* Колонка превращается в две кнопки. Нажал — «проваливаешься» в экран настройки:
     он выезжает справа на весь экран, стрелка в шапке (и кнопка «назад» телефона)
     возвращает к товарам. */
  .sidebtns .btn { min-height: 52px; font-size: 1rem; }
  .sidebox {
    display: block; position: fixed; inset: 0; z-index: 105; border: 0; border-radius: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 16px 24px; background: var(--surface); transform: translateX(100%); visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s;
  }
  .sidebox.is-open { transform: none; visibility: visible; transition: transform .24s ease; }
  .sidebox__head { position: sticky; top: 0; z-index: 2; align-items: center; gap: 12px; margin: 0 -16px 10px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .sidebox__head h2 { font-size: 1.15rem; }
  .sidebox__back { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1.5px solid var(--brand); border-radius: 50%; background: var(--surface); color: var(--brand-ink); cursor: pointer; }
  .sidebox__back .icon { transform: rotate(180deg); }
  .sidebox .catlist a { min-height: 48px; padding-top: 10px; padding-bottom: 10px; font-size: 1rem; }
  .picker { grid-template-columns: 1fr; }
  .picker__button { width: 100%; }
  .mainbar__podbor { display: none; }
  .massform { width: 100%; }
  .massform label { flex: 1; }
  .massform .input { width: 100%; }
}
@media (max-width: 600px) {
  .catalog__main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pickersection { padding: 28px 0; }
  .typetiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pickerbox { padding: 16px; }
}

/* ---------- «живые» рисунки техники ----------
   Слои собирает bin/make-machine-rigs.php, разметку — rig_markup(). Каждое звено —
   обёртка во весь холст со своим шарниром (--o) и поворотом при наведении (--t);
   у гидроцилиндра есть и исходное преобразование (--r) той же формы. Двигается только
   transform. На сенсорных экранах рисунок неподвижен. */
.rig { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; }
.rig__j { position: absolute; inset: 0; transform-origin: var(--o, 50% 50%); transform: var(--r, none); transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.rig .rig__i { position: absolute; max-width: none; object-fit: fill; }
@media (hover: hover) {
  a:hover > .typetile__pic .rig__j, .rig:hover .rig__j {
    transform: var(--t, var(--r, none));
    transition: transform .62s cubic-bezier(.33, .08, .2, 1) var(--d, 0ms);
  }
}
/* Настройка «уменьшить движение» на сайте отключает все переходы (правило выше), но этот
   оставлен: движение маленькое, одно и только по наведению самого посетителя. Иначе его
   не видит никто на Windows Server и в удалённых сеансах — там анимация окон выключена
   по умолчанию, и браузер сообщает это как «уменьшить движение» (так было у владельца
   13.10.2026). Запаздывания звеньев в этом режиме нет — все двигаются разом. */
@media (prefers-reduced-motion: reduce) {
  .rig .rig__j { transition: transform .45s cubic-bezier(.4, 0, .2, 1) !important; }
}
/* В плитке: на сенсорном экране — одна неподвижная картинка, слои «живого» рисунка даже
   не запрашиваются. С мышью слои грузятся поверх неё невидимыми, и рисунок подменяет
   картинку, только когда загрузились все (класс is-live ставит site.js) — машина
   не показывается собранной наполовину. */
.typetile__pic--rig { position: relative; }
.typetile__pic--rig .rig { display: none; }
@media (hover: hover) {
  .typetile__pic--rig .rig { display: block; position: absolute; inset: 0; opacity: 0; }
  .typetile__pic--rig.is-live .rig { opacity: 1; }
  .typetile__pic--rig.is-live .typetile__still { opacity: 0; }
}
/* Конечное положение без наведения — для проверки и снимков. */
.rig.is-on .rig__j { transform: var(--t, var(--r, none)); transition: none; }

/* Шапка телефона в одну строку: меню, логотип, «позвонить», корзина. С кнопкой звонка
   на 393 px (iPhone) не хватало 14 px, и корзина уезжала под логотип. */
@media (max-width: 600px) {
  .mainbar__row { column-gap: 6px; }
  .cartbtn { padding: 10px; }
}
@media (max-width: 400px) {
  .logo { gap: 9px; }
  .logo__mark { width: 40px; height: 40px; }
  .logo__text b { font-size: 1.08rem; }
}
@media (max-width: 350px) {
  .logo { gap: 7px; }
  .logo__mark { width: 36px; height: 36px; }
  .logo__text b { font-size: .9rem; }
  .mainbar__burger, .mainbar__call { width: 38px; height: 38px; }
  .cartbtn { padding: 8px; }
}
