/*
  «Лидер» — сайт завода кабеленесущих систем.

  Сдержанная техническая тема: стальные серые, графит, белые панели
  с тонкими линиями. Фирменный оранжевый — только акцент: метки,
  тонкие линии, рисунок, фокус. Кнопки — приглушённый оранжевый
  --accent-strong, на нём белый текст проходит WCAG AA (4,7:1).
*/

:root {
  --accent: #f26a1b;          /* фирменный: только декоративные элементы */
  --accent-strong: #c4500c;   /* кнопки с белым текстом */
  --accent-strong-hover: #a8440a;
  --accent-text: #b04a0c;     /* мелкий акцентный текст на белом */
  --accent-tint: #fdf2ea;
  --ink: #1f2429;
  --ink-2: #2b3138;
  --text: #262b31;
  --steel: #5c6672;           /* второстепенный текст: 5,9:1 на белом */
  --steel-light: #9aa3ad;     /* только для декоративных линий */
  --line: #dfe3e8;
  --line-strong: #c6ccd3;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ok: #2e7d32;
  --bad: #c62828;
  --radius: 3px;
  --shadow: 0 6px 20px rgba(31, 36, 41, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --header-h: 124px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); accent-color: var(--accent-strong); }
img { max-width: 100%; }

a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.15; font-weight: 750; letter-spacing: -0.015em; color: var(--ink); margin: 4px 0 18px; }
h2 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 28px 0 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.caption { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- шапка */

.top { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar { background: var(--ink); color: #c9d0d7; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: #e6eaee; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .phone { font-weight: 600; white-space: nowrap; }

.top-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding-top: 14px; padding-bottom: 14px; }

.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
/* Знак ростом с надпись и стоит с ней на одной линии; подпись — под ними
   обоими, по центру. */
.logo-row { display: flex; align-items: flex-start; gap: 10px; }
.logo-mark { width: 42px; height: 33px; flex: none; color: #231f20; }
.logo-word { display: block; width: 150px; height: 33px; color: #231f20; }
.logo-sub { font-size: 11px; line-height: 1.1; color: var(--steel); letter-spacing: 0.02em; text-align: center; white-space: nowrap; }

.btn-catalog { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn-catalog:hover { background: var(--ink-2); color: #fff; }
.icon-grid { width: 13px; height: 13px; flex: none; background:
  linear-gradient(currentColor, currentColor) 0 0 / 5px 5px no-repeat,
  linear-gradient(currentColor, currentColor) 100% 0 / 5px 5px no-repeat,
  linear-gradient(currentColor, currentColor) 0 100% / 5px 5px no-repeat,
  linear-gradient(currentColor, currentColor) 100% 100% / 5px 5px no-repeat; }
.btn-catalog .icon-grid { color: var(--accent); }

.search { display: flex; min-width: 0; position: relative; }
.search input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); font: inherit; background: #fff; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.search button { height: 42px; width: 48px; padding: 0; border-radius: 0 var(--radius) var(--radius) 0; }

/* Подсказки поиска (static/suggest.js) */
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(31, 36, 41, 0.16); padding: 6px 0; }
.suggest[hidden] { display: none; }
.suggest-head { margin: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel); }
.suggest-note, .suggest-empty { margin: 6px 14px; font-size: 13px; color: var(--steel); }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 7px 14px; color: var(--text); text-decoration: none; }
.suggest-item:hover, .suggest-item.is-active { background: var(--accent-tint); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suggest-name { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.suggest-meta { font-size: 12px; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-count { font-size: 12px; color: var(--steel); font-variant-numeric: tabular-nums; }
.suggest-pic { flex: 0 0 44px; height: 44px; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--radius); }
.suggest-pic img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.suggest-pic:empty { background-image: radial-gradient(circle, #dde1e6 1.5px, transparent 2px); background-size: 8px 8px; } /* нет фото — как «Фото готовится» */
.suggest-price { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.suggest-all { justify-content: center; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--accent-text); }

.cart-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.cart-link:hover { color: var(--accent-text); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-strong); color: #fff; font-size: 12px; font-weight: 700; }

/* Меню сайта под шапкой. Подпункты — при наведении и при переходе по Tab
   (:focus-within), без JavaScript; на телефоне пункт ведёт на страницу раздела. */
.sitenav { border-top: 1px solid var(--line); background: var(--card); }
.sitenav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; }
.sitenav-item { position: relative; }
.sitenav-item > a { display: flex; align-items: center; gap: 7px; padding: 11px 0 9px; color: var(--steel); font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.sitenav-item > a:hover, .sitenav-item:focus-within > a, .sitenav-item.is-current > a { color: var(--ink); border-bottom-color: var(--accent); }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.6; }
.sitenav-sub { display: none; position: absolute; top: 100%; left: -14px; z-index: 35; min-width: 230px; list-style: none; margin: 0; padding: 6px 0;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(31, 36, 41, 0.16); }
.has-sub:hover > .sitenav-sub, .has-sub:focus-within > .sitenav-sub { display: block; }
.sitenav-sub a { display: block; padding: 8px 14px; color: var(--text); font-size: 14px; text-decoration: none; white-space: nowrap; }
.sitenav-sub a:hover, .sitenav-sub a:focus-visible, .sitenav-sub a[aria-current] { background: var(--accent-tint); color: var(--ink); outline: none; }

@media (max-width: 760px) {
  :root { --header-h: 0px; }
  .top { position: relative; }
  .topbar { display: none; }
  .top-row { grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; }
  .logo-sub { display: none; }
  .top .logo-row { gap: 7px; align-items: center; }
  .top .logo-mark { width: 28px; height: 22px; }
  .top .logo-word { width: 100px; height: 22px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  /* На телефоне подпунктов нет: пункт открывает страницу раздела со списком.
     Шесть пунктов переносятся во вторую строку, а не уезжают за край. */
  .sitenav-list { flex-wrap: wrap; gap: 0 20px; }
  .sitenav-item > a { padding: 9px 0 7px; }
  .sitenav-sub, .caret { display: none !important; }
  .cart-link { justify-self: end; }
  .cart-link span:not(.badge) { display: none; }
  .btn-catalog { padding: 8px 12px; }
}
/* Узкие телефоны (360 px и уже): логотип, кнопка каталога и корзина в одной строке. */
@media (max-width: 400px) {
  .top-row { gap: 10px; }
  .top .logo-mark { width: 24px; height: 19px; }
  .top .logo-word { width: 86px; height: 19px; }
  .btn-catalog { padding: 8px 10px; }
}
@media (max-width: 350px) {
  .btn-catalog-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------------------------------------------------------------- кнопки и поля */

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  color: #fff; background: var(--accent-strong); border: 1px solid var(--accent-strong); border-radius: var(--radius);
  padding: 10px 18px; cursor: pointer; text-decoration: none; transition: background-color 0.15s, border-color 0.15s;
}
button:hover, .btn:hover { background: var(--accent-strong-hover); border-color: var(--accent-strong-hover); color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--steel-light); }
.btn-big { padding: 13px 26px; font-size: 16px; }
button.link { background: none; border: 0; padding: 0; color: var(--steel); font-weight: 500; font-size: 13px; text-decoration: underline; }
button.link:hover { color: var(--bad); background: none; }

input[type=text], input[type=search], input[type=tel], input[type=email], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.18); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; margin: 0; flex: none; }

/* ---------------------------------------------------------------- общие блоки */

main.wrap { padding-top: 24px; padding-bottom: 72px; min-height: 60vh; }
.crumbs { font-size: 13px; color: var(--steel); margin: 0 0 6px; }
.crumbs a { color: var(--steel); text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.crumbs .sep { color: var(--steel-light); margin: 0 7px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.notice { background: var(--accent-tint); border: 1px solid #f6d3bb; border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 11px 16px; margin: 14px 0; }
.error { color: var(--bad); font-size: 14px; margin: 6px 0 0; }
.empty { padding: 40px 24px; text-align: center; color: var(--steel); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

.section-title { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 750; margin: 0 0 18px; }
.section-title::before { content: ""; width: 4px; height: 22px; background: var(--accent); flex: none; }

.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }

/* Страницы меню (info.html): раздел со списком подстраниц, заготовка, контакты */
.info-tiles { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.info-tiles a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 600; text-decoration: none; }
.info-tiles a:hover { border-color: var(--accent); }
.info-tiles .arrow { color: var(--steel-light); }
.info-tiles a:hover .arrow { color: var(--accent-text); }
.info-stub { max-width: 640px; padding: 18px 20px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--steel); }
.info-stub p { margin: 0; }
.info-text { margin-bottom: 24px; font-size: 16px; line-height: 1.6; }
.info-docs { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.info-docs li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.doc-icon { flex: none; display: grid; place-items: center; width: 44px; height: 52px; border: 1px solid #f6d3bb; border-radius: var(--radius); background: var(--accent-tint);
  color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.doc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.doc-text > a { font-weight: 600; }
.doc-text .muted { font-size: 13px; }
.info-gallery { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.info-gallery li { display: flex; flex-direction: column; gap: 6px; }
.info-gallery a { display: block; aspect-ratio: 3 / 4; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.info-gallery a:hover { border-color: var(--accent); }
.info-gallery img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.info-gallery span { font-size: 13px; color: var(--steel); }
.info-back { margin-top: 8px; }
.info-stub p + p { margin-top: 10px; }
.contacts-page address { font-style: normal; }
.contacts-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; max-width: 640px; }
.contacts-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.contacts-list .icon { flex: none; width: 20px; height: 20px; margin-top: 18px; color: var(--accent); }
.contacts-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); margin-bottom: 2px; }
.count-tag { font-size: 14px; color: var(--steel); }

.code { display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.03em; color: var(--accent-text); background: var(--accent-tint); border: 1px solid #f6d3bb; border-radius: 2px; padding: 2px 8px; }
.sku { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--steel); }

.stock { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; margin: 0; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--steel); }
.stock.order { color: var(--accent-text); }
.stock.order::before { border-radius: 0; background: var(--accent); }
.summary-note { margin: 0; padding: 0 18px 16px; font-size: 13px; color: var(--steel); }

/* ---------------------------------------------------------------- главная */

/* Фон — сетка миллиметровки, справа — чертёж лотка. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center;
  padding: clamp(28px, 5vw, 56px); margin-bottom: 44px;
  background-color: var(--card);
  background-image:
    linear-gradient(var(--bg) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.hero h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; margin: 10px 0 14px; }
.hero h1 span { color: var(--accent-text); }
.hero-lead { max-width: 620px; margin: 0 0 24px; color: var(--steel); font-size: 17px; }
.hero-search { display: flex; max-width: 600px; position: relative; }
.hero-search input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; font-size: 16px; border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.hero-search button { height: 50px; padding: 0 24px; border-radius: 0 var(--radius) var(--radius) 0; }
.hero-facts { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--steel); font-size: 14px; }
.hero-facts li { display: flex; align-items: center; gap: 9px; }
.hero-facts li::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; }
.hero-facts strong { color: var(--ink); }
@media (max-width: 560px) {
  .hero-search button { padding: 0 14px; }
  .hero-search button svg { display: none; }
}
.hero-art svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
@media (max-width: 979px) { .hero-art { display: none; } }

.cat-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-tiles a { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; min-height: 148px; height: 100%; padding: 18px 20px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.cat-tiles a::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: transparent; border-radius: var(--radius) 0 0 var(--radius); transition: background-color 0.15s; }
.cat-tiles a:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.cat-tiles a:hover::before { background: var(--accent); }
.cat-tiles .code { justify-self: start; }
.tile-num { font-family: var(--mono); font-size: 13px; color: var(--steel); }
.tile-name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.tile-count { font-size: 13px; color: var(--steel); }
.tile-arrow { position: absolute; right: 18px; bottom: 14px; color: var(--steel-light); font-size: 20px; transition: transform 0.15s, color 0.15s; }
.cat-tiles a:hover .tile-arrow { color: var(--accent); transform: translateX(4px); }

/* ---------------------------------------------------------------- новости */

.home-news { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head .section-title { margin: 0; }
.more-link { font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }

.news-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.news-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.news-card::before { content: ""; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background-color 0.15s; }
.news-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.news-card:hover::before { background: var(--accent); }
.news-img { display: block; aspect-ratio: 16 / 9; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.news-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.news-date { font-family: var(--mono); font-size: 13px; color: var(--steel); }
.news-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
/* Ссылка растянута на всю карточку: кликается вся плитка, в доступности — один заголовок. */
.news-title a { color: var(--ink); text-decoration: none; }
.news-title a::after { content: ""; position: absolute; inset: 0; }
.news-card:hover .news-title a { color: var(--accent-text); }
.news-summary { margin: 0; font-size: 14px; color: var(--steel); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
@media (max-width: 560px) { .news-grid { grid-template-columns: minmax(0, 1fr); } }

.news-article { max-width: 860px; }
.news-article h1 { margin: 6px 0 14px; }
.news-lead { margin: 0 0 22px; font-size: 18px; color: var(--steel); }
.news-cover { display: block; width: 100%; height: auto; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.news-article .description { margin-top: 8px; }
.news-back { margin: 32px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 600; }
.news-back a { text-decoration: none; }

/* ---------------------------------------------------------------- каталог */

.cat-tree { columns: 3 300px; column-gap: 20px; }
.cat-tree section { break-inside: avoid; margin-bottom: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cat-tree h2 { margin: 0; padding: 14px 18px; font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); }
.cat-tree h2 a { text-decoration: none; }
.cat-tree ul { list-style: none; margin: 0; padding: 8px 18px 12px; }
.cat-tree li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--bg); }
.cat-tree li:last-child { border-bottom: 0; }
.cat-tree li a { text-decoration: none; }

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chips a { display: inline-flex; gap: 8px; align-items: baseline; padding: 7px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; font-weight: 600; text-decoration: none; }
.chips a span { font-size: 12px; font-weight: 400; color: var(--steel); }
.chips a:hover { border-color: var(--accent); color: var(--ink); }

.listing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 980px) { .listing { grid-template-columns: 270px minmax(0, 1fr); align-items: start; } }

.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 980px) { .filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; } }
.filters-title { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
/* Разделитель — псевдоэлемент: рамку fieldset браузер рисует сквозь legend. */
.filters fieldset { position: relative; border: 0; margin: 0; padding: 0 16px 14px; min-width: 0; }
.filters fieldset + fieldset::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--line); }
.filters legend { display: block; padding: 14px 0 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.filters fieldset label { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 3px 0; cursor: pointer; }
.filters fieldset label .muted { margin-left: auto; font-size: 12px; }
.filters .row { display: flex; gap: 8px; }
.filters .row input { flex: 1 1 0; width: 0; min-width: 0; }
.filters select { width: 100%; padding: 7px 10px; }
.filters input[type=text] { padding: 7px 10px; }
.filter-actions { display: flex; gap: 14px; align-items: center; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.filter-actions button { flex: 1; }
.filter-actions a { font-size: 14px; }

.ft-label { display: none; }
@media (max-width: 979px) {
  .ft-label { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 700; font-size: 15px; cursor: pointer; }
  .ft-label::after { content: "+"; font-size: 20px; line-height: 1; color: var(--steel); }
  .ft:checked ~ .ft-label::after { content: "−"; }
  .ft:focus-visible ~ .ft-label { outline: 2px solid var(--accent); outline-offset: -2px; }
  .filters-body { display: none; border-top: 1px solid var(--line); }
  .ft:checked ~ .filters-body { display: block; }
  .filters-title { display: none; }
}

/* ---------------------------------------------------------------- карточки */

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
/* Заглушка — точки перфорации, как на листовом лотке. */
.noimg { position: absolute; inset: 0; display: grid; place-items: center; background-color: #f7f8fa; background-image: radial-gradient(circle, #dde1e6 2px, transparent 2.5px); background-size: 16px 16px; }
.noimg span { font-size: 12px; color: var(--steel); background: #f7f8fa; padding: 2px 10px; border: 1px solid var(--line); border-radius: 2px; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.card-name { color: var(--ink); font-weight: 600; line-height: 1.35; text-decoration: none; }
.card-name:hover { color: var(--accent-text); }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.card-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font-size: 20px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; margin: 0; white-space: nowrap; }
.price small { font-size: 13px; font-weight: 500; color: var(--steel); }
.price-ask { font-size: 14px; font-weight: 600; color: var(--steel); }
.card-foot form, .card-foot .btn { width: 100%; }
.card-foot button { width: 100%; padding: 9px 12px; font-size: 14px; }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .card-name { font-size: 14px; }
  .price { font-size: 17px; }
  .card-foot button, .card-foot .btn { font-size: 13px; padding: 8px 6px; }
  .card-foot button svg { display: none; }
}

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 32px 0 0; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 600; text-decoration: none; }
.pager a:hover { border-color: var(--accent); }
.pager .cur { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .gap { border: 0; background: none; min-width: 20px; }

/* ---------------------------------------------------------------- товар */

.product { display: grid; gap: 36px; }
@media (min-width: 980px) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .description { grid-column: 1 / -1; } }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs label { display: block; width: 76px; height: 76px; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.thumbs label:hover { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Галерея без JavaScript: выбранное фото — отмеченная радиокнопка .g-pick
   (невидима, но остаётся в порядке Tab: стрелки клавиатуры листают фото),
   миниатюры и стрелки — её подписи. Позиций — maxGallery в store.go.
   Радиокнопки закреплены в углу экрана (fixed): щелчок по подписи передаёт
   им фокус, и браузер прокрутил бы страницу к верху галереи. */
.g-pick { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.g-slide > a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.g-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--ink); font-size: 26px; line-height: 1;
  cursor: pointer; user-select: none; }
.g-arrow:hover { border-color: var(--accent); color: var(--accent-text); }
.g-arrow span { margin-top: -3px; }
.g-prev { left: 10px; }
.g-next { right: 10px; }
/* На телефоне миниатюры — одна лента с прокруткой: иначе 11 штук заняли бы
   четыре ряда и отодвинули название и цену. Отступ — под рамку фокуса. */
@media (max-width: 760px) {
  .gallery { min-width: 0; } /* иначе лента растянет колонку сетки на всю свою длину */
  .thumbs { flex-wrap: nowrap; overflow-x: auto; padding: 3px; margin: 9px -3px 0; scrollbar-width: thin; }
  .thumbs label { flex: 0 0 64px; height: 64px; }
}
.g-count { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.92);
  color: var(--steel); font-size: 12px; font-variant-numeric: tabular-nums; }

.gallery-main .g-slide { display: none; position: absolute; inset: 0; }
.gallery-main .g-slide:only-child,
#photo0:checked ~ .gallery-main .g-s0,
#photo1:checked ~ .gallery-main .g-s1,
#photo2:checked ~ .gallery-main .g-s2,
#photo3:checked ~ .gallery-main .g-s3,
#photo4:checked ~ .gallery-main .g-s4,
#photo5:checked ~ .gallery-main .g-s5,
#photo6:checked ~ .gallery-main .g-s6,
#photo7:checked ~ .gallery-main .g-s7,
#photo8:checked ~ .gallery-main .g-s8,
#photo9:checked ~ .gallery-main .g-s9,
#photo10:checked ~ .gallery-main .g-s10,
#photo11:checked ~ .gallery-main .g-s11
{ display: block; }

#photo0:checked ~ .thumbs .g-t0,
#photo1:checked ~ .thumbs .g-t1,
#photo2:checked ~ .thumbs .g-t2,
#photo3:checked ~ .thumbs .g-t3,
#photo4:checked ~ .thumbs .g-t4,
#photo5:checked ~ .thumbs .g-t5,
#photo6:checked ~ .thumbs .g-t6,
#photo7:checked ~ .thumbs .g-t7,
#photo8:checked ~ .thumbs .g-t8,
#photo9:checked ~ .thumbs .g-t9,
#photo10:checked ~ .thumbs .g-t10,
#photo11:checked ~ .thumbs .g-t11
{ border-color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-strong); }

#photo0:focus-visible ~ .thumbs .g-t0,
#photo1:focus-visible ~ .thumbs .g-t1,
#photo2:focus-visible ~ .thumbs .g-t2,
#photo3:focus-visible ~ .thumbs .g-t3,
#photo4:focus-visible ~ .thumbs .g-t4,
#photo5:focus-visible ~ .thumbs .g-t5,
#photo6:focus-visible ~ .thumbs .g-t6,
#photo7:focus-visible ~ .thumbs .g-t7,
#photo8:focus-visible ~ .thumbs .g-t8,
#photo9:focus-visible ~ .thumbs .g-t9,
#photo10:focus-visible ~ .thumbs .g-t10,
#photo11:focus-visible ~ .thumbs .g-t11
{ outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.info h1 { margin: 6px 0 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--steel); font-size: 14px; }
.meta strong { color: var(--ink); font-weight: 600; }

.buy-box { display: grid; gap: 14px; margin: 22px 0 28px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-block .price { font-size: clamp(28px, 3vw, 36px); }
.buy-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.qty { width: 92px; text-align: center; }
.info .section-title { margin-top: 30px; font-size: 19px; }

table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel); background: #f0f2f4; }
.offers { background: var(--card); border: 1px solid var(--line); }
.offers td:last-child { text-align: right; }
.offers button { padding: 7px 12px; font-size: 13px; }
.props { background: var(--card); border: 1px solid var(--line); }
.props th { width: 45%; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; background: var(--card); }
.props td { font-weight: 600; color: var(--ink); }
.props tr:nth-child(odd) th, .props tr:nth-child(odd) td { background: #f8f9fa; }

.pickup { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pickup li { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pickup li::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }

.description { max-width: 860px; }
.description p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- корзина и заказ */

.cart { background: var(--card); border: 1px solid var(--line); }
.cart td:first-child a { font-weight: 600; text-decoration: none; }
.cart .unavailable td { color: var(--steel); background: #f8f9fa; }
.cart-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 20px; padding: 18px 22px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.total-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
.total-bar .price { font-size: clamp(24px, 3vw, 30px); }
.total { font-size: 20px; font-weight: 750; color: var(--ink); }

.checkout { display: grid; gap: 28px; }
@media (min-width: 980px) { .checkout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px 24px; }
.form label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 14px; }
.form input[type=text], .form input[type=tel], .form input[type=email], .form textarea, .form select { width: 100%; }
.form fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.form legend { font-weight: 700; font-size: 14px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.form .check input { margin-top: 2px; }
.form-submit { margin-top: 22px; }
.form h2 { font-size: 16px; margin: 24px 0 2px; padding-top: 20px; border-top: 1px solid var(--line); }
.form > h2:first-child { border-top: 0; padding-top: 10px; margin-top: 8px; }
.form .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
@media (max-width: 560px) { .form .grid2 { grid-template-columns: minmax(0, 1fr); } }
.pay-note { margin: 8px 0 14px; padding: 10px 14px; background: var(--bg); border-radius: var(--radius); }

/* Переключатель «Организация / Частное лицо». */
.segmented { display: grid; grid-template-columns: 1fr 1fr; max-width: 520px; margin-top: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.form .segmented label { position: relative; display: flex; align-items: center; justify-content: center; margin: 0; padding: 11px 12px; background: var(--card); font-weight: 600; cursor: pointer; }
.form .segmented label + label { border-left: 1px solid var(--line-strong); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.form .segmented label:has(input:checked) { background: var(--ink); color: #fff; }
.form .segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -3px; }

/* Поля, не относящиеся к выбранному варианту, скрываются через :has.
   Браузер без :has покажет все поля — форма всё равно работает. */
.form:has(#buyer-person:checked) .for-company,
.form:has(#buyer-company:checked) .for-person,
.form:has(#delivery-pickup:checked) .for-courier,
.form:has(#delivery-courier:checked) .for-pickup { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.summary { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
@media (min-width: 980px) { .summary { position: sticky; top: calc(var(--header-h) + 16px); } }
.summary h2 { margin: 0; padding: 14px 18px; font-size: 16px; border-bottom: 1px solid var(--line); }
.summary td { padding: 10px 18px; font-size: 14px; }
.summary td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.summary .total { padding: 14px 18px 18px; margin: 0; }

.order-ok { position: relative; padding: 24px 24px 24px 84px; margin-bottom: 24px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ok); border-radius: var(--radius); }
.order-ok::before { content: "✓"; position: absolute; left: 24px; top: 24px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #e8f3e9; color: var(--ok); font-size: 22px; font-weight: 700; }
.order-ok h1 { margin: 0 0 8px; }
.order-num { font-family: var(--mono); color: var(--accent-text); }
.status { display: inline-block; padding: 2px 10px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 2px; font-weight: 600; font-size: 13px; }

/* ---------------------------------------------------------------- сообщения и тексты */

.message { max-width: 720px; padding: 32px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.message h1 { margin-top: 0; }
.message .links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.text-page { max-width: 820px; }

/* ---------------------------------------------------------------- подвал */

.foot { background: var(--ink); color: #aeb6bf; font-size: 14px; border-top: 3px solid var(--accent); }
.foot-grid { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 28px; grid-template-columns: minmax(0, 1fr); }
/* Телефон: контакты сразу под логотипом, а не после списка из двух десятков
   разделов — номер на телефоне нажимают, чтобы позвонить. */
.foot-grid > :first-child { order: -2; }
.foot-contacts { order: -1; }
/* Средний экран: сверху логотип, «Покупателям» и контакты, под ними
   «Продукция» на всю ширину — иначе её список вытянулся бы в одну колонку. */
@media (min-width: 760px) {
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-grid > :first-child, .foot-contacts { order: 0; }
  .foot-cats { grid-column: 1 / -1; order: 1; }
}
@media (min-width: 1000px) {
  .foot-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.1fr); }
  .foot-cats { grid-column: auto; order: 0; }
}
.foot-contacts address { font-style: normal; }
.foot-contacts li { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; }
.foot-contacts .icon { flex: none; margin-top: 2px; color: var(--accent); }
.foot h2 { margin: 0 0 12px; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding: 3px 0; }
.foot-cats ul { columns: 3 200px; column-gap: 24px; } /* сколько поместится, не уже 200 px */
.foot-cats li { break-inside: avoid; } /* название раздела не разрывается между колонками */
.foot a { color: #dfe4e9; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); }
.foot .logo { color: #fff; margin-bottom: 12px; }
.foot .logo-mark, .foot .logo-word { color: #fff; }
.foot .logo-sub { color: #aeb6bf; }
.foot-bottom { border-top: 1px solid var(--ink-2); padding-top: 14px; padding-bottom: 18px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
