/*
 * Imperial Server — тема 2026 (шаблоны MODX). Один файл, без Bootstrap и jQuery.
 * Фирменный стиль: тёмно-бирюзовый (#184850), золотой акцент, Roboto Condensed для заголовков.
 * Сначала мобильная вёрстка, расширения — от 640 / 960 / 1200 px.
 */

/* ---------- Шрифт: свой хостинг (variable 400–700) ---------- */
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/roboto-condensed-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/roboto-condensed-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Токены ---------- */
:root {
  --primary: #184850;
  --primary-700: #123b42;
  --primary-900: #0b2a30;
  --primary-50: #e8f1f2;
  --accent: #f2b93b;
  --accent-600: #e0a522;
  --accent-50: #fdf5e1;
  --text: #17242a;
  --muted: #5b6c73;
  --border: #dfe6e8;
  --surface: #f4f7f8;
  --white: #ffffff;
  --success: #2a8f53;
  --danger: #c0392b;

  --font-head: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(11, 42, 48, .06), 0 4px 16px rgba(11, 42, 48, .06);
  --shadow-lg: 0 10px 30px rgba(11, 42, 48, .14);
  --container: 1240px;
  --gutter: 16px;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.55 var(--font-body); color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent-600); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; color: var(--primary-900); }
h1 { font-size: clamp(28px, 4.2vw, 42px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0; }
.section--surface { background: var(--surface); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section__head h2 { margin: 0; }
.section__more { font-weight: 600; white-space: nowrap; }
.eyebrow { font: 700 13px/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-600); margin-bottom: 8px; }
@media (min-width: 960px) { .section { padding: 72px 0; } }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--radius-sm); font: 700 15px/1.2 var(--font-head); letter-spacing: .02em; text-transform: uppercase; cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn--accent { background: var(--accent); color: var(--primary-900); }
.btn--accent:hover { background: var(--accent-600); color: var(--primary-900); }
.btn--primary { background: var(--primary); color: var(--white); }
.btn--primary:hover { background: var(--primary-700); color: var(--white); }
.btn--outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn--outline:hover { background: var(--primary); color: var(--white); }
.btn--ghost-light { border-color: rgba(255,255,255,.6); color: var(--white); background: transparent; }
.btn--ghost-light:hover { background: var(--white); color: var(--primary-900); }
.btn--sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn--block { width: 100%; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Шапка ---------- */
.topbar { background: var(--primary-900); color: rgba(255,255,255,.78); font-size: 13px; display: none; }
.topbar .container { display: flex; align-items: center; gap: 24px; min-height: 38px; }
.topbar a { color: rgba(255,255,255,.9); }
.topbar a:hover { color: var(--accent); }
.topbar__item { display: inline-flex; align-items: center; gap: 6px; }
.topbar__spacer { flex: 1; }
@media (min-width: 960px) { .topbar { display: block; } }

.header { background: var(--primary); color: var(--white); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.header__main { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.header__logo img { height: 40px; width: auto; }
.header__burger, .header__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: rgba(255,255,255,.1); color: var(--white); cursor: pointer; position: relative; }
.header__burger:hover, .header__icon:hover { background: rgba(255,255,255,.2); color: var(--white); }
.header__catalog { display: none; }
.header__search { display: none; flex: 1; position: relative; }
.header__search input { width: 100%; height: 44px; padding: 0 48px 0 16px; border: 0; border-radius: var(--radius-sm); background: var(--white); color: var(--text); }
.header__search button { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--primary-900); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.header__phones { display: none; line-height: 1.25; text-align: right; }
.header__phones a { color: var(--white); font: 700 17px/1.3 var(--font-head); display: block; white-space: nowrap; }
.header__phones small { color: rgba(255,255,255,.7); font-size: 12px; }
.header__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header__request-label { display: none; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--primary-900); font: 700 12px/20px var(--font-body); text-align: center; }
.badge[data-count="0"] { display: none; }
.header__mobile-search { padding: 0 0 12px; }
.header__mobile-search .header__search { display: block; }
@media (min-width: 960px) {
  .header__burger, .header__mobile-search, .header__icon--phone { display: none; }
  .header__main { min-height: 76px; gap: 20px; }
  .header__logo img { height: 46px; }
  .header__catalog { display: inline-flex; }
  .header__search { display: block; }
  .header__phones { display: block; }
  .header__request-label { display: inline; }
  .header__request { width: auto; padding: 0 16px; gap: 8px; background: var(--accent); color: var(--primary-900); font: 700 15px/1 var(--font-head); text-transform: uppercase; }
  .header__request:hover { background: var(--accent-600); color: var(--primary-900); }
  .header__request .badge { background: var(--primary-900); color: var(--white); }
}

.nav { background: var(--primary-700); display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a { display: block; padding: 12px 14px; color: rgba(255,255,255,.88); font: 700 14px/1 var(--font-head); letter-spacing: .04em; text-transform: uppercase; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
@media (min-width: 960px) { .nav { display: block; } }

/* Мега-меню каталога */
.megamenu { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); color: var(--text); box-shadow: var(--shadow-lg); display: none; }
.megamenu.is-open { display: block; }
.megamenu__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 32px; padding: 28px 0; }
.megamenu__title { font: 700 17px/1.2 var(--font-head); color: var(--primary-900); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.megamenu__title img { width: 40px; height: 40px; object-fit: contain; }
.megamenu ul { list-style: none; margin: 0; padding: 0 0 0 50px; columns: 1; }
.megamenu li a { display: block; padding: 3px 0; color: var(--muted); font-size: 14px; }
.megamenu li a:hover { color: var(--primary); }

/* Мобильное меню */
.drawer { position: fixed; inset: 0; z-index: 100; display: none; }
.drawer.is-open { display: block; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(11,42,48,.55); }
.drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); background: var(--white); overflow-y: auto; padding: 16px; box-shadow: var(--shadow-lg); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer__close { width: 44px; height: 44px; border: 0; background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; }
.drawer nav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); font: 700 16px/1.2 var(--font-head); }
.drawer details summary { padding: 12px 4px; border-bottom: 1px solid var(--border); font: 700 16px/1.2 var(--font-head); cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.drawer details summary::after { content: '+'; color: var(--muted); }
.drawer details[open] summary::after { content: '−'; }
.drawer details a { padding-left: 16px; font: 400 15px/1.3 var(--font-body); }
.drawer__contacts { margin-top: 16px; font-size: 14px; color: var(--muted); }
.drawer__contacts a { font: 700 18px/1.4 var(--font-head); display: block; }

/* ---------- Главная: первый экран ---------- */
.hero { position: relative; color: var(--white); background: var(--primary-900); overflow: hidden; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(11,42,48,.96) 0%, rgba(11,42,48,.8) 50%, rgba(24,72,80,.35) 100%); }
.hero .container { position: relative; z-index: 1; display: grid; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.hero h1 { color: var(--white); font-size: clamp(30px, 5vw, 52px); max-width: 15em; }
.hero__lead { font-size: 18px; color: rgba(255,255,255,.85); max-width: 36em; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-content: center; }
.fact { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(4px); }
.fact b { display: block; font: 700 30px/1 var(--font-head); color: var(--accent); margin-bottom: 6px; }
.fact span { font-size: 14px; color: rgba(255,255,255,.82); }
@media (min-width: 960px) { .hero .container { grid-template-columns: 1.4fr 1fr; padding-top: 80px; padding-bottom: 80px; align-items: center; } }

/* ---------- Плитки категорий ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card { position: relative; display: grid; grid-template-columns: 1fr 96px; gap: 12px; padding: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); transition: box-shadow .15s, border-color .15s; }
.cat-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card h3 { margin: 0 0 8px; }
.cat-card h3 a { color: var(--primary-900); }
.cat-card h3 a::after { content: ''; position: absolute; inset: 0; }
.cat-card img { width: 96px; height: 96px; object-fit: contain; align-self: center; }
.cat-card ul { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); position: relative; z-index: 1; }
.cat-card li { display: inline; }
.cat-card li:not(:last-child)::after { content: ' · '; }
.cat-card li a { color: var(--muted); }
.cat-card li a:hover { color: var(--primary); }

/* ---------- Преимущества, шаги, цифры ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.feature { padding: 20px; background: var(--white); border-radius: var(--radius); border-top: 3px solid var(--accent); box-shadow: var(--shadow); }
.feature__num { font: 700 14px/1 var(--font-head); color: var(--accent-600); margin-bottom: 10px; }
.feature h3 { margin-bottom: 6px; font-size: 19px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { display: grid; gap: 16px; counter-reset: step; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.step::before { counter-increment: step; content: counter(step); width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--accent); font: 700 24px/56px var(--font-head); text-align: center; }
.step h3 { margin: 6px 0 4px; }
.step p { margin: 0; color: var(--muted); }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat b { display: block; font: 700 clamp(30px, 4vw, 44px)/1 var(--font-head); color: var(--primary); }
.stat span { color: var(--muted); font-size: 15px; }
@media (min-width: 960px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.split { display: grid; gap: 32px; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; } }

/* ---------- Бренды ---------- */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.brands li { list-style: none; display: flex; align-items: center; justify-content: center; height: 72px; padding: 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.brands img { max-height: 40px; width: auto; filter: grayscale(1); opacity: .75; transition: filter .15s, opacity .15s; }
.brands li:hover img { filter: none; opacity: 1; }
.brands { padding: 0; margin: 0; }

/* ---------- Новости ---------- */
.news-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.news-card { position: relative; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.news-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--surface); }
.news-card__body { padding: 16px 20px 20px; }
.news-card time { color: var(--muted); font-size: 13px; }
.news-card h3 { margin: 6px 0 0; font-size: 18px; }
.news-card h3 a { color: var(--primary-900); }
.news-card h3 a::after { content: ''; position: absolute; inset: 0; }

/* ---------- Призыв + форма ---------- */
.cta-band { background: var(--primary); color: var(--white); border-radius: var(--radius); padding: 28px; display: grid; gap: 20px; }
.cta-band h2 { color: var(--white); margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.82); margin: 0; }
.cta-band form { display: grid; gap: 10px; }
@media (min-width: 960px) { .cta-band { grid-template-columns: 1fr 1.2fr; align-items: center; padding: 40px; } .cta-band form { grid-template-columns: 1fr 1fr auto; } }

/* ---------- Формы ---------- */
.field { display: grid; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; }
.input, .textarea, .select { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); outline: 2px solid var(--primary-50); }
.input.error, .textarea.error { border-color: var(--danger); }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .field--wide { grid-column: 1 / -1; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }

/* ---------- Хлебные крошки, заголовок страницы ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 12px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.crumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--border); }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head__count { color: var(--muted); }

/* ---------- Каталог ---------- */
.catalog { display: grid; gap: 24px; padding-bottom: 56px; }
@media (min-width: 960px) { .catalog { grid-template-columns: 280px 1fr; align-items: start; } }
.sidebar { display: none; }
.sidebar.is-open { display: block; }
@media (min-width: 960px) { .sidebar { display: block; position: sticky; top: 92px; } .filters-toggle { display: none !important; } }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h3 { font-size: 17px; margin-bottom: 10px; }
.tree { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.tree a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text); }
.tree a:hover { background: var(--surface); color: var(--primary); }
.tree a[aria-current="page"] { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; border-left: 2px solid var(--border); }
.filter { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.filter__title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.filter__list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; display: grid; gap: 6px; }
.filter__list label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.filter__list input { accent-color: var(--primary); width: 17px; height: 17px; }
.filter__list small { color: var(--muted); margin-left: auto; }
.filter__range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter__actions { display: grid; gap: 8px; margin-top: 16px; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .select { width: auto; min-height: 40px; padding: 6px 12px; }
.filters-toggle { display: inline-flex; }

.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .products { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1200px) { .products--wide { grid-template-columns: repeat(4, 1fr); } }
.product-card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.product-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; }
.product-card__img { aspect-ratio: 4 / 3; background: var(--white); display: flex; align-items: center; justify-content: center; padding: 12px; border-bottom: 1px solid var(--surface); }
.product-card__img img { max-height: 100%; object-fit: contain; }
.product-card__img--empty { color: var(--border); }
.product-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__title { font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em; }
.product-card__title a { color: inherit; }
.product-card__title a::after { content: ''; position: absolute; inset: 0; }
.product-card__sku { font-size: 12px; color: var(--muted); }
.product-card__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.price { font: 700 20px/1.1 var(--font-head); color: var(--primary-900); }
.price small { font: 400 14px var(--font-body); color: var(--muted); }
.price--request { font: 600 15px/1.2 var(--font-body); color: var(--muted); }
@media (min-width: 640px) { .product-card__foot { flex-direction: row; align-items: center; justify-content: space-between; } }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; padding: 0; list-style: none; }
.pagination a, .pagination span { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--white); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ---------- Карточка товара ---------- */
.product { display: grid; gap: 28px; padding-bottom: 40px; }
@media (min-width: 960px) { .product { grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; } }
.gallery__main { aspect-ratio: 4 / 3; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-in; }
.gallery__main img { max-height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.gallery__thumbs button { flex: none; width: 76px; height: 76px; padding: 6px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; scroll-snap-align: start; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--primary); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(11,42,48,.85); }
.lightbox img { max-width: 96vw; max-height: 88vh; object-fit: contain; background: var(--white); border-radius: var(--radius); }
.lightbox button { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--white); cursor: pointer; font-size: 22px; }

.buybox { display: grid; gap: 16px; }
.buybox h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); margin: 0; }
.meta b { color: var(--text); font-weight: 600; }
.buybox__price { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.buybox__price .price { font-size: 32px; }
.buybox__price .price--request { font: 700 22px/1.2 var(--font-head); color: var(--primary-900); }
.buybox__note { font-size: 14px; color: var(--muted); margin: 0; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.qty { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); overflow: hidden; }
.qty button { width: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--primary); }
.qty button:hover { background: var(--surface); }
.qty input { width: 56px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row .btn--accent { flex: 1; min-width: 200px; }
.perks { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.perks li { display: flex; gap: 10px; align-items: center; }
.perks .icon { color: var(--primary); }

.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px; }
.tabs a { padding: 12px 16px; border-bottom: 3px solid transparent; color: var(--muted); font: 700 16px/1 var(--font-head); white-space: nowrap; }
.tabs a:hover, .tabs a[aria-current="true"] { color: var(--primary-900); border-bottom-color: var(--accent); }
.prose { max-width: 820px; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.specs { width: 100%; max-width: 820px; border-collapse: collapse; font-size: 15px; }
.specs th, .specs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs th { width: 40%; color: var(--muted); font-weight: 400; }
.specs tr:nth-child(even) { background: var(--surface); }

/* Карусель (scroll-snap, без библиотек) */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 70%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.carousel > * { scroll-snap-align: start; }
@media (min-width: 640px) { .carousel { grid-auto-columns: calc((100% - 24px) / 3); } }
@media (min-width: 1200px) { .carousel { grid-auto-columns: calc((100% - 36px) / 4); } }

/* ---------- Подвал ---------- */
.footer { background: var(--primary-900); color: rgba(255,255,255,.75); font-size: 14px; padding: 48px 0 24px; }
.footer a { color: rgba(255,255,255,.85); }
.footer a:hover { color: var(--accent); }
.footer__grid { display: grid; gap: 28px; }
@media (min-width: 960px) { .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; } }
.footer h4 { color: var(--white); font-size: 16px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer__phone { font: 700 20px/1.3 var(--font-head); color: var(--white) !important; display: block; }
.footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: rgba(255,255,255,.55); font-size: 13px; }
.messengers { display: flex; gap: 8px; margin-top: 12px; }
.messengers a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; }

/* Уведомление «добавлено в запрос» (request-list.js) */
.request-toast { position: fixed; right: 16px; bottom: 16px; z-index: 200; padding: 12px 18px; background: var(--primary-900); color: var(--white); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }

/* ---------- Служебное ---------- */
.hide, [hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 300; padding: 10px 16px; background: var(--accent); color: var(--primary-900); border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
main { display: block; min-height: 40vh; }
.page { padding-bottom: 56px; }
.muted { color: var(--muted); }

/* Активные пункты меню (pdoMenu: класс active — текущая страница и её родители) */
.nav li.active > a { color: var(--accent); }
.megamenu__title:hover { color: var(--primary); }

/* Дерево категорий: раскрыта только ветка текущей страницы */
.tree li:not(.active) > ul { display: none; }
.tree li.current > a { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tree > li > a { font-weight: 600; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 20px; padding: 0; }
.subcats a { display: inline-block; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); color: var(--text); font-size: 14px; }
.subcats a:hover { border-color: var(--primary); color: var(--primary); }

/* Пагинация pdoPage */
.pagination li { list-style: none; }
.pagination .disabled span { color: var(--border); }

/* Пустой результат, описание категории */
.empty { padding: 32px; text-align: center; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.catalog__about { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ---------- Текст страниц (контент из редактора) ---------- */
.prose { line-height: 1.65; }
.prose--wide { max-width: none; }
.prose img { border-radius: var(--radius-sm); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface); }
.prose blockquote { margin: 0 0 1em; padding: 12px 18px; border-left: 4px solid var(--accent); background: var(--accent-50); }
.prose dl { margin: 0 0 1em; }
.prose dt { font-weight: 600; margin-top: .6em; }
.prose dd { margin: 0; color: var(--muted); }
.prose iframe, .prose video { max-width: 100%; }
/* Совместимость со старой вёрсткой контента (классы Bootstrap в текстах страниц) */
.prose .container { max-width: none; padding: 0; }
.prose .row { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 24px; }
.prose .row > [class*="col-"] { flex: 1 1 260px; min-width: 0; }
.prose .row > .col-lg-12, .prose .row > .col-12 { flex-basis: 100%; }
.prose .text-center { text-align: center; }
.prose .lead { font-size: 19px; color: var(--muted); }
.prose .fw-bold { font-weight: 700; }
.prose .display-4 { font-size: clamp(28px, 4vw, 40px); }
.prose .fs-4 { font-size: 20px; }
.prose .fs-5 { font-size: 18px; }
.prose .mb-3 { margin-bottom: 12px; }
.prose .mb-4 { margin-bottom: 20px; }
.prose .mb-5 { margin-bottom: 32px; }
.prose .mt-3 { margin-top: 12px; }
.prose .mt-4 { margin-top: 20px; }
.prose .mt-5 { margin-top: 32px; }
.prose .my-5 { margin: 32px 0; }
.prose .btn:not([class*="btn--"]) { background: var(--primary); color: var(--white); }
.prose .btn:not([class*="btn--"]):hover { background: var(--primary-700); }
.prose .feature-card, .prose .service-card, .prose .info-card { height: 100%; padding: 20px; background: var(--surface); border-radius: var(--radius); }
.prose .feature-icon, .prose .service-icon { font-size: 28px; color: var(--primary); margin-bottom: 10px; }
.prose .hero-section { padding: 0 !important; background: none !important; }

/* Галерея страницы (TV gallery) */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 24px 0; }
.photo-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.photo-grid img { width: 100%; aspect-ratio: 42 / 26; object-fit: cover; transition: transform .2s; }
.photo-grid a:hover img { transform: scale(1.03); }

/* ---------- Формы FetchIt ---------- */
@media (min-width: 640px) { .field--wide { grid-column: 1 / -1; } .cta-band form.form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-error { display: block; font-size: 13px; color: var(--danger); }
.form-error:empty { display: none; }
.cta-band .form-error { color: #ffc9c2; }
.cta-band .check { color: rgba(255,255,255,.85); }
.cta-band .check a { color: var(--accent); }
.upload { display: grid; gap: 4px; font-size: 14px; }
.upload input { font-size: 14px; }
.cta-band .upload { color: rgba(255,255,255,.85); }
.form-note { font-size: 13px; color: var(--muted); margin: 0; }
.cta-band .form-note { color: rgba(255,255,255,.7); }
.check.error { color: var(--danger); }
.cta-band .check.error { color: #ffc9c2; }

/* Окна: результат отправки формы, «Заказать звонок» */
.modal { border: 0; border-radius: var(--radius); padding: 28px; width: min(92vw, 440px); box-shadow: var(--shadow-lg); color: var(--text); }
.modal::backdrop { background: rgba(11,42,48,.6); }
.modal h2 { font-size: 24px; margin-bottom: 8px; padding-right: 32px; }
.modal__close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.modal .form-grid { margin-top: 16px; }

/* ---------- Страница «Список запроса» ---------- */
.request-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 16px; }
.request-table th, .request-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.request-table th { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.request-table .request-count { width: 80px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.request-table .element-delete { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); }
.request-table .element-delete::before { content: '\00d7'; }
.request-table .element-delete:hover { background: #fbe3e0; }
@media (max-width: 639px) {
  .request-table thead { display: none; }
  .request-table tr { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .request-table td { border: 0; padding: 0; }
  .request-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
}

/* ---------- Новости ---------- */
.article { display: grid; gap: 32px; padding-bottom: 56px; }
@media (min-width: 960px) { .article { grid-template-columns: 1fr 320px; align-items: start; } }
.article__img { width: 100%; border-radius: var(--radius); margin-bottom: 20px; }
.article__date { color: var(--muted); font-size: 14px; margin-bottom: 12px; display: block; }
.aside-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.aside-list li { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.aside-list img { width: 88px; height: 66px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface); }
.aside-list time { display: block; font-size: 12px; color: var(--muted); }
.aside-list a { color: var(--primary-900); font-weight: 600; font-size: 14px; line-height: 1.35; }
.news-card__text { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.news-card__noimg { aspect-ratio: 16 / 9; background: var(--primary-50); }

/* ---------- Контакты ---------- */
.contacts { display: grid; gap: 24px; margin-bottom: 40px; }
@media (min-width: 960px) { .contacts { grid-template-columns: 380px 1fr; } }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 24px; display: grid; gap: 10px; align-content: start; }
.contact-card h3 { margin: 0 0 4px; }
.contact-card p { margin: 0; }
.contact-line { display: flex; gap: 10px; align-items: flex-start; }
.contact-line .icon { color: var(--primary); margin-top: 3px; }
.contact-line b { font: 700 19px/1.3 var(--font-head); }
.map { min-height: 380px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.map > div { width: 100%; height: 100%; min-height: 380px; }
.branch-tabs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; }
.branch-tabs button { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); cursor: pointer; font-weight: 600; }
.branch-tabs button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ---------- Поиск ---------- */
.search-form { display: flex; gap: 8px; max-width: 640px; margin-bottom: 24px; }
.search-form .input { flex: 1; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.search-results li { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.search-results a { font-weight: 600; font-size: 17px; }
.search-results p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Товар: видео, документы, группы характеристик ---------- */
.videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.videos video, .videos img { width: 100%; border-radius: var(--radius-sm); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.files a { display: inline-flex; gap: 8px; align-items: center; }
.specs .specs__group th { background: var(--primary-50); color: var(--primary-900); font-weight: 700; width: auto; }
.product-section { margin-top: 32px; scroll-margin-top: 100px; }
/* Шаги и цифры в двухколоночном блоке главной — столбиком / по два */
@media (min-width: 960px) { .split .steps { grid-template-columns: 1fr; } .split .stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .sidebar { max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain; } }
.price-old { color: var(--muted); font-size: 15px; }
@media (max-width: 959px) { .sidebar .panel--tree { display: none; } }
/* Колонки сеток не растягиваются по содержимому (полоса миниатюр, таблицы) */
.product > *, .catalog > *, .article > *, .contacts > *, .split > * { min-width: 0; }
/* Наличие (TV stock): в наличии / ожидается / под заказ */
.stock { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; }
.stock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock--in { color: #1f7a45; background: #e6f4ec; }
.stock--pre { color: #8a5a00; background: var(--accent-50); }
.stock--order { color: var(--muted); background: var(--surface); }
.meta .stock { margin-right: 4px; }
/* Форма КП: подсказка организации по ИНН / названию и карточка реквизитов */
.inn-field { position: relative; }
.inn-suggest { position: absolute; left: 0; right: 0; top: 48px; z-index: 30; margin: 0; padding: 4px; list-style: none; background: var(--white); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.inn-suggest li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.inn-suggest li:hover, .inn-suggest li[aria-selected="true"] { background: var(--primary-50); }
.inn-suggest small { color: var(--muted); font-size: 12px; }
.org-card { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.5; }
.cta-band .org-card { background: rgba(255,255,255,.1); color: rgba(255,255,255,.92); }
.org-card__warn { color: var(--danger); font-weight: 600; }
.cta-band .org-card__warn { color: #ffc9c2; }
/* Поля ввода — свой цвет текста: на тёмном фоне (.cta-band) иначе наследуется белый на белом */
.input, .textarea, .select { color: var(--text); }
.input::placeholder, .textarea::placeholder { color: #7a8a91; }
/* Товар без фото: иконка по типу (theme.noimg) — поставщик даёт фото примерно для 1/5 прайса */
.noimg { width: 100%; height: 100%; min-height: 120px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 12px; text-align: center; border-radius: var(--radius-sm); background: linear-gradient(140deg, var(--primary-50) 0%, #f9fbfb 70%); color: var(--primary); }
.noimg__icon { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.noimg__brand { font: 700 12px/1.2 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.noimg--big { min-height: 320px; }
.noimg--big .noimg__icon { width: 120px; height: 120px; stroke-width: 1.1; }
.noimg--big .noimg__brand { font-size: 15px; }
.noimg__note { font-size: 13px; color: var(--muted); }

/* «Подбор сервера» (ресурс 8834, чанк theme.form.brief): выбор вариантами-«чипами» */
.brief-page { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .brief-page { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.brief-page__intro .lead { font-size: 18px; color: var(--text); }
.brief-steps { padding-left: 20px; margin: 16px 0; }
.brief-steps li { margin-bottom: 8px; }
.brief-page__form.panel { padding: 20px; margin: 0; }
.brief__group { border: 0; padding: 0; margin: 0; min-width: 0; }
.brief__group legend, .brief__label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.brief .field .brief__label + .select { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); font-size: 14px; line-height: 1.3; transition: background .15s, border-color .15s; }
.chip:hover span { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips--sm .chip span { padding: 6px 12px; font-size: 13px; }
.prose .brief-page ol.brief-steps { list-style: decimal; }
.brief__selects { display: grid; gap: 12px; }
@media (min-width: 480px) { .brief__selects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prose:has(> .brief-page) { max-width: none; }

/* «Предварительное КП» (ресурс 18439, сниппет requestKp) — на экране и в печать / PDF */
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.request-actions .btn { margin: 0; }
.prose:has(> .kp-doc) { max-width: 960px; }
.kp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.kp-doc { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.kp-supplier { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); font-size: 13px; line-height: 1.5; color: var(--muted); }
.kp-supplier__brand { display: inline-flex; align-items: center; background: var(--primary); border-radius: var(--radius-sm); padding: 8px 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.kp-supplier__brand img { height: 44px; width: auto; display: block; }
.kp-supplier__info { text-align: right; }
.kp-supplier__info b { color: var(--text); font-size: 15px; }
.prose .kp-title { font-size: 24px; margin: 20px 0 4px; }
.kp-date { color: var(--muted); margin: 0 0 16px; }
.kp-doc { overflow-x: auto; }
.kp-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.kp-table col.c-num { width: 5%; } .kp-table col.c-art { width: 15%; } .kp-table col.c-stock { width: 11%; }
.kp-table col.c-qty { width: 8%; } .kp-table col.c-price { width: 12%; } .kp-table col.c-sum { width: 13%; }
.kp-table td { overflow-wrap: anywhere; }
.kp-table th, .kp-table td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.kp-table th { background: var(--surface); font-weight: 600; }
.kp-table .kp-num { text-align: right; }
.kp-table td.kp-num { white-space: nowrap; overflow-wrap: normal; }
.kp-table td a { color: var(--text); text-decoration: none; }
.kp-table tfoot td { background: var(--surface); }
.prose .kp-notes { font-size: 13px; color: var(--muted); margin: 16px 0 0; padding-left: 18px; list-style: disc; }
.kp-contact { font-size: 14px; margin: 16px 0 0; }
@media (max-width: 639px) { .kp-doc { padding: 16px; } .kp-supplier__info { text-align: left; } }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .topbar, .header, .nav, .drawer, .footer, .crumbs, .kp-actions, dialog, .skip-link, .request-toast, body > a, body > noscript { display: none !important; }
  main .container, .page, .prose { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .kp-doc { border: 0; padding: 0; overflow: visible; }
  .kp-table { font-size: 10.5pt; }
  .kp-table tr { break-inside: avoid; }
  .kp-table a { color: #000; }
}
