/*
 * Витрина Kassium: основа, общая для всех шаблонов. Без сборщика — один обычный файл.
 *
 * Здесь нет ни одного цвета и ни одного радиуса напрямую: всё через переменные,
 * которые задаёт шаблон (t-classic.css, t-gallery.css, t-catalog.css). Так правка
 * вёрстки делается один раз, а не трижды, и шаблоны не разъезжаются между собой.
 *
 * Цвет объявляется парой: --что-то-light и --что-то-dark. Рабочая переменная --что-то
 * только ссылается на одну из них, и переключение темы — это подмена ссылок, собранная
 * ниже в одном месте. Иначе каждый шаблон держал бы вторую копию своей палитры, и
 * светлая с тёмной разъехались бы при первой же правке.
 */

/* --- Значения по умолчанию. Шаблон перекрывает пары, но не сами ссылки. --- */
:root {
  --bg-light: #ffffff;              --bg-dark: #0d0f14;
  --surface-light: #ffffff;         --surface-dark: #14171f;
  --surface-2-light: #f6f7fb;       --surface-2-dark: #1b1f29;
  --border-light: #e4e7ef;          --border-dark: #252a36;
  --text-light: #16192b;            --text-dark: #f2f3f7;
  --muted-light: #6b7280;           --muted-dark: #9ba3b4;
  --ok-light: #15803d;              --ok-dark: #4ade80;
  --warn-light: #b45309;            --warn-dark: #fbbf24;
  --danger-light: #b91c1c;          --danger-dark: #f87171;
  /* Подпись на красном значке скидки. В тёмной палитре красный светлый, и белым
     по нему не прочитать. */
  --danger-contrast-light: #ffffff; --danger-contrast-dark: #16192b;

  /* Акцент по умолчанию. Фирменный синий на тёмном полотне выглядит грязно, поэтому
     там тёплый светлый — и подпись на кнопке соответственно тёмная. Выбранный владельцем
     цвет приходит со страницы и перекрывает обе половины пары сразу: один и тот же
     фирменный цвет в обеих темах. */
  --accent-light: #2c3991;          --accent-dark: #e8c37a;
  --accent-contrast-light: #ffffff; --accent-contrast-dark: #16192b;

  --shadow-light: 0 1px 2px rgba(16, 19, 43, .05), 0 10px 30px rgba(16, 19, 43, .06);
  --shadow-dark: 0 1px 2px rgba(0, 0, 0, .6), 0 14px 40px rgba(0, 0, 0, .45);
  --shadow-soft-light: 0 1px 2px rgba(16, 19, 43, .04);
  --shadow-soft-dark: 0 1px 2px rgba(0, 0, 0, .5);

  /* Цвет звёзд. Акцент сюда не годится: оценку ищут глазами по привычному жёлтому,
     а у магазина акцент может быть любым, вплоть до серого. Жёлтый читается в обеих
     темах, поэтому пара ему не нужна. */
  --star: #f0a92e;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --container: 1240px;
  --grid-min: 180px;
  --card-ratio: 1 / 1;
  --card-fit: cover;
  --gap: 16px;

  /* Высота логотипа в шапке. Шаблон задаёт её под свою строку, а потолок на узком
     экране остаётся за этим файлом: шаблон подключается следом и перекрыл бы
     ограничение, окажись оно в той же переменной. */
  --logo-h: 52px;
  --logo-h-max: 999px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: var(--font);
  --h1: 28px;
  --h2: 22px;
  --title-weight: 700;
  --head-spacing: -0.01em;
}

/* Светлая — исходная. color-scheme чинит то, что рисует не наш код: полосы прокрутки,
   выпадающие списки и календарь в поле даты. */
:root {
  color-scheme: light;
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-2: var(--surface-2-light);
  --border: var(--border-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --ok: var(--ok-light);
  --warn: var(--warn-light);
  --danger: var(--danger-light);
  --danger-contrast: var(--danger-contrast-light);
  --accent: var(--accent-light);
  --accent-contrast: var(--accent-contrast-light);
  --shadow: var(--shadow-light);
  --shadow-soft: var(--shadow-soft-light);
}

/* Тёмная по настройке устройства. Отменяется только закреплённой светлой: магазин,
   который выбрал светлую витрину, не должен темнеть у половины покупателей. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-2: var(--surface-2-dark);
    --border: var(--border-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --ok: var(--ok-dark);
    --warn: var(--warn-dark);
    --danger: var(--danger-dark);
    --danger-contrast: var(--danger-contrast-dark);
    --accent: var(--accent-dark);
    --accent-contrast: var(--accent-contrast-dark);
    --shadow: var(--shadow-dark);
    --shadow-soft: var(--shadow-soft-dark);
  }
}

/* Тёмная по выбору: владелец закрепил её или покупатель нажал переключатель. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --surface-2: var(--surface-2-dark);
  --border: var(--border-dark);
  --text: var(--text-dark);
  --muted: var(--muted-dark);
  --ok: var(--ok-dark);
  --warn: var(--warn-dark);
  --danger: var(--danger-dark);
  --danger-contrast: var(--danger-contrast-dark);
  --accent: var(--accent-dark);
  --accent-contrast: var(--accent-contrast-dark);
  --shadow: var(--shadow-dark);
  --shadow-soft: var(--shadow-soft-dark);
}

/* Скругления — отдельная настройка: шаблон задаёт характер, владелец подкручивает мягкость. */
[data-corners="sharp"] { --radius: 2px; --radius-sm: 2px; --radius-lg: 3px; --radius-pill: 3px; }
[data-corners="soft"] { --radius: 12px; --radius-sm: 8px; --radius-lg: 18px; --radius-pill: 999px; }
[data-corners="round"] { --radius: 20px; --radius-sm: 14px; --radius-lg: 28px; --radius-pill: 999px; }

* { box-sizing: border-box; }

/* Свои display-правила перебивают браузерный [hidden] — без этого скрытые блоки остаются видимыми. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: var(--head-spacing); }

h1 { font-size: var(--h1); font-weight: var(--title-weight); margin: 0 0 8px; line-height: 1.15; }
h2 { font-size: var(--h2); font-weight: var(--title-weight); margin: 40px 0 16px; line-height: 1.2; }

.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 24px; }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: filter .15s ease, background-color .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.94); }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-wide { width: 100%; }

/* --- Шапка --- */
.header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--text); white-space: nowrap; min-width: 0; }
/* height: auto обязателен: в разметке у картинки стоит height на случай, если стили
   не доехали, и без этой строки он же и остался бы итоговым размером — логотип
   не вырос бы до отведённой шаблоном высоты. */
.brand img { max-height: min(var(--logo-h), var(--logo-h-max)); max-width: 100%; width: auto; height: auto; }
/* Логотип надписью фирменным шрифтом: кегль от той же высоты, что отведена картинке,
   — буквы заглавного размера занимают её так же, как надпись в шапке старого магазина. */
.brand.has-tagline { flex-direction: column; align-items: flex-start; gap: 8px; }
.nav-cart { display: none; }
/* Панель каталога слева — её включает тема (--nav-drawer: 1) и рисует под себя; здесь
   только устройство: затемнение, выезд, прокрутка длинного списка. */
.cat-drawer { position: fixed; inset: 0; z-index: 100; }
.cat-drawer[hidden] { display: none; }
.cat-drawer-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); opacity: 0; transition: opacity .3s; }
.cat-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(332px, 85vw); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: 0 0 5px rgba(0, 0, 0, .09); transform: translateX(-100%); transition: transform .3s;
}
.cat-drawer.is-open .cat-drawer-shade { opacity: 1; }
.cat-drawer.is-open .cat-drawer-panel { transform: none; }
.cat-drawer-head { position: relative; flex: none; padding: 12px 50px 15px 20px; font-size: 22px; font-weight: 600; }
.cat-drawer-close {
  position: absolute; top: 0; right: 0; width: 50px; height: 100%; display: grid; place-items: center;
  border: 0; background: none; color: var(--text); cursor: pointer;
}
.cat-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cat-drawer-list { margin: 0; padding: 0; list-style: none; }
.cat-drawer-subtitle { padding: 12px 50px 15px 20px; border-top: 1px solid #ededed; font-size: 22px; font-weight: 600; }
/* Меню сайта в полосе и в панели — его показывают темы (Jara); шаблон ставит в полосу разделы. */
.nav-bar .nav > .site-link, .nav-bar .nav > .site-item, .cat-drawer-site { display: none; }
.cat-drawer-list ul { margin: 0; padding: 0; list-style: none; }
.cat-drawer-list li { position: relative; border-top: 1px solid #ededed; }
.cat-drawer-list a { display: block; padding: 14px 50px 13px 20px; font-size: 18px; line-height: 22px; color: var(--text); transition: background .3s, color .3s; }
.cat-drawer-list ul a { padding-left: 40px; font-weight: 300; }
.cat-drawer-list a:hover, .cat-drawer-list li.has.open > a { background: var(--accent); color: var(--accent-contrast, #fff); }
.cat-drawer-more {
  position: absolute; top: 0; right: 0; width: 50px; height: 49px; border: 0; background: none; cursor: pointer; color: #c4c4c4;
}
.cat-drawer-more::before {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -2px 0 0 -5px;
  border: 5px solid transparent; border-top-color: currentColor; border-bottom-width: 0; transition: transform .3s;
}
.cat-drawer-list li.open > .cat-drawer-more { color: #fff; }
.cat-drawer-list li.open > .cat-drawer-more::before { transform: rotate(180deg); }
.cat-drawer-list a:hover + .cat-drawer-more { color: #fff; }
html.drawer-lock { overflow: hidden; }
.cat-drawer-panel:focus, .search:focus { outline: none; }
/* Лупа, избранное в полосе и крестик поиска — их показывают темы (Jara); в шаблоне скрыты. */
.nav-search, .nav-fav, .search-close { display: none; }
.search-shade { position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s; }
.search-open .search-shade { opacity: 1; }
.search-shade[hidden] { display: none; }
.brand-tagline { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; white-space: normal; }
.brand-tagline .brand-slogan { font-family: var(--font-head); font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--text); }
.brand-tagline .brand-note { font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--accent); }
.brand-text { font-family: 'shop-logo', var(--font); font-weight: 400; font-size: calc(min(var(--logo-h), var(--logo-h-max)) * .8); line-height: 1; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }

/* Логотип под тему. Оба варианта лежат в разметке, и нужный выбирают стили: какая тема
   у покупателя, сервер не знает — он отдаёт одну и ту же страницу всем и из кэша.
   Загружен только один — он и показывается, без этих правил. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* Переключатель темы. Стоит рядом с корзиной и выглядит так же, как она: это не настройка
   магазина, а такая же кнопка шапки. */
/* Без скриптов переключать нечем, и кнопка не рисуется вовсе: мёртвый орган управления
   в шапке хуже, чем его отсутствие. data-js ставит разметка в самом начале head. */
.theme-switch { display: none; }
:root[data-js] .theme-switch {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 17px; cursor: pointer;
}
.theme-switch:hover { border-color: var(--accent); color: var(--accent); }

/* Поиск занимает всё, что осталось между логотипом и корзиной. Потолок оставлял
   посреди шапки пустое место: корзина прижата к правому краю, и зазор собирался
   между ней и полем. */
.search { display: flex; flex: 1 1 auto; }
.search input {
  flex: 1; min-width: 0; padding: 11px 16px; border: 1px solid var(--border);
  border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.search button { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 11px 20px; }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-phones { display: flex; flex-direction: column; gap: 1px; }
.header-phone { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; line-height: 1.35; }
.phone-icon { width: 14px; height: 14px; flex: none; color: var(--muted); }
.header-phone:hover .phone-icon { color: var(--accent); }
.cart-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; white-space: nowrap; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cart-link:hover { border-color: var(--accent); }
.cart-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-contrast);
  font-size: 12px; font-weight: 700;
}

/* Поиск уходит под шапку на узком экране: иначе он выдавливает корзину за край. */
@media (max-width: 760px) {
  :root { --logo-h-max: 40px; }
  .header-row { flex-wrap: wrap; min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .header-phones { display: none; }
}

/* --- Навигация по разделам --- */
/* Строка переносится, а не прокручивается: выпадающий список подразделов обрезался бы
   краем прокручиваемой области, и у магазина с полутора десятками разделов он просто
   не показался бы. На узком экране список всё равно не достать пальцем — там прокрутка. */
.nav { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-size: 14px; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-current="page"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.chip-more { margin-left: 6px; font-size: 11px; opacity: .6; }

/* Раздел с подразделами. Сам раздел остаётся ссылкой — список только дополняет его,
   поэтому до товаров добираются и те, у кого наведение не работает. */
.nav-open, .nav-toggle { display: none; }
.nav-item { position: relative; display: flex; }
.submenu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 240px; max-width: 320px; padding: 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
/* Невидимая перемычка через зазор между разделом и списком: без неё курсор по пути вниз
   на мгновение покидает .nav-item, и список закрывается раньше, чем до него доведут мышь. */
.submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 7px; }
.submenu a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text); }
.submenu a:hover { background: var(--surface-2); color: var(--accent); }

/* Список раскрывается только там, где есть чем наводить. На телефоне его не достать,
   и строка разделов возвращается к прокрутке — переносить полтора десятка разделов
   на узком экране значит отдать им половину первого экрана. */
@media (hover: hover) and (min-width: 761px) {
  .nav-item:hover > .submenu, .nav-item:focus-within > .submenu { display: block; }
}
@media (max-width: 760px) {
  .nav { flex-wrap: nowrap; overflow-x: auto; }
  .chip-more { display: none; }
}

.main { padding: 28px 20px 64px; }
@media (max-width: 560px) { .main { padding: 20px 16px 48px; } }

/* --- Хлебные крошки --- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: .5; }

/* --- Панель сортировки --- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Без скрипта — системный список, но со своей стрелкой и в размер кнопок витрины. */
.toolbar select, .field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.toolbar select {
  height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  box-shadow: var(--shadow-soft);
}
.field select { padding-right: 38px; }

/* --- Выпадающий список (dropdown.js) --- */
.dd { position: relative; display: inline-block; }
.dd-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-soft); transition: border-color .15s ease, box-shadow .15s ease;
}
.dd-btn:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border)); }
.dd-btn:focus-visible, .dd.is-open .dd-btn {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.dd-prefix { color: var(--muted); }
.dd-value { font-weight: 600; }
.dd-chevron { color: var(--muted); flex: none; transition: transform .15s ease; }
.dd.is-open .dd-chevron { transform: rotate(180deg); }
.dd-menu {
  display: none; position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 100%;
  margin: 0; padding: 6px; list-style: none; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); outline: none;
}
.dd.dd-right .dd-menu { left: auto; right: 0; }
.dd.is-open .dd-menu { display: block; animation: dd-in .12s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; white-space: nowrap; cursor: pointer;
}
.dd-option.is-active { background: var(--surface-2); }
.dd-option[aria-selected="true"] { font-weight: 600; color: var(--accent); }
.dd-check { visibility: hidden; flex: none; }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }
@media (max-width: 560px) {
  .dd-option { padding: 12px 10px; font-size: 15px; }
}

/* --- Сетка товаров --- */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr)); }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-photo { aspect-ratio: var(--card-ratio); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: var(--card-fit); transition: transform .3s ease; }
.card:hover .card-photo img { transform: scale(1.04); }
.card-photo .placeholder { color: var(--muted); font-size: 13px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-size: 15px; color: var(--text); font-weight: 500; line-height: 1.35; }
.card:hover .card-name { color: var(--accent); }

.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.badge {
  padding: 4px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
  background: var(--accent); color: var(--accent-contrast);
}
.badge.sale { background: var(--danger); color: var(--danger-contrast); }

.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price { font-size: 19px; font-weight: 700; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.stock { font-size: 13px; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--muted); }

/* --- Каталог с боковыми фильтрами --- */
.catalog { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .catalog.with-aside { grid-template-columns: 240px minmax(0, 1fr); } }
.aside { display: grid; gap: 20px; }
.aside-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.aside-title { font-weight: 600; margin-bottom: 10px; font-size: 15px; }
.aside-list { display: grid; gap: 6px; font-size: 14px; }
.aside-list a { color: var(--muted); padding: 3px 0; }
.aside-list a:hover, .aside-list a[aria-current="page"] { color: var(--accent); }
.aside-list a.child { padding-left: 14px; }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-inputs input { width: 100%; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* --- Карточка товара --- */
.detail { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .detail { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } }
.gallery { display: grid; gap: 12px; align-content: start; position: sticky; top: 92px; }
@media (max-width: 899px) { .gallery { position: static; } }
/* Рамка повторяет форму снимка: квадрат обрезал бы обложки книг и прочие вытянутые фото.
 * Высокий снимок ограничен по высоте экрана и стоит по центру на фоне рамки. */
.gallery-main {
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.gallery-main img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(75vh, 700px); }
.gallery-main.gallery-empty { aspect-ratio: 1 / 1; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs button {
  flex: 0 0 auto; width: 72px; height: 72px; padding: 0; cursor: pointer; overflow: hidden;
  border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.gallery-thumbs button[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-weight: 600; margin-bottom: 10px; }

.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qty button { width: 42px; height: 44px; border: 0; background: var(--surface-2); color: var(--text); font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--border); }
.qty input { width: 58px; height: 44px; border: 0; text-align: center; background: var(--surface); color: var(--text); font: inherit; }
.description { line-height: 1.7; white-space: pre-line; }

.specs { display: grid; gap: 10px; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.specs div:last-child { border-bottom: 0; padding-bottom: 0; }
.specs dt, .specs .key { color: var(--muted); }

/* --- Корзина и строки заказа --- */
.rows { display: grid; gap: 12px; }
.row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.row img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); }
.row-actions { display: flex; align-items: center; gap: 14px; }
@media (max-width: 560px) {
  .row { grid-template-columns: 64px minmax(0, 1fr); }
  .row img { width: 64px; height: 64px; }
  .row-actions { grid-column: 1 / -1; justify-content: space-between; }
}
.link-danger { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link-danger:hover { color: var(--danger); }
/* Убрать строку корзины — крестиком: слово рядом с суммой читалось как часть цены. */
.row-remove {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.row-remove:hover { background: var(--surface-2); color: var(--danger); }

.totals { display: grid; gap: 10px; margin-top: 18px; }
.totals div { display: flex; justify-content: space-between; gap: 16px; }
.totals .total { font-size: 20px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--border); }

/* --- Формы --- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field textarea, .field select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.field .hint { font-size: 13px; color: var(--muted); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.choice input { margin-top: 3px; }
.notice { border-left: 3px solid var(--warn); background: var(--surface); padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.notice.error { border-color: var(--danger); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.hp { position: absolute; left: -9999px; }

/* --- Ход заказа --- */
.status-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 28px; }
.status-step { padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.status-step.done { border-color: var(--accent); color: var(--accent); }
.status-step.current { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* --- Главная: баннер и подборки --- */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 36px;
  background: var(--surface-2); min-height: 260px; display: grid; align-items: center;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-body { position: relative; padding: 48px 40px; max-width: 620px; }
.hero.has-image .hero-body { color: #fff; text-shadow: 0 1px 24px rgba(0, 0, 0, .55); }
.hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .12)); }
.hero.has-image .hero-body { z-index: 1; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 12px; }
.hero p { margin: 0 0 20px; font-size: 17px; }
@media (max-width: 560px) { .hero-body { padding: 28px 20px; } }

/* --- Сменяющиеся баннеры (слайды владельца вместо одиночного баннера) ---
   Слайды лежат друг на друге и проявляются по очереди: высота не прыгает при смене. */
.slider {
  position: relative; overflow: hidden; aspect-ratio: 3 / 1; min-height: 240px; margin-bottom: 32px;
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.slide {
  position: absolute; inset: 0; display: block; color: #fff;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
.slide.is-active { z-index: 1; opacity: 1; visibility: visible; transition: opacity .6s ease; }
.slide:hover { color: #fff; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption {
  position: absolute; left: 40px; bottom: 36px; display: flex; flex-direction: column; gap: 4px;
  max-width: min(560px, calc(100% - 80px)); padding: 18px 24px;
  border-radius: var(--radius-sm); background: rgba(0, 0, 0, .55);
}
.slide-text { font-size: 17px; line-height: 1.35; opacity: .92; }
.slide-title { font-family: var(--font-head); font-size: clamp(24px, 3vw, 40px); font-weight: var(--title-weight); line-height: 1.15; }
.slider-dots { position: absolute; z-index: 2; right: 20px; bottom: 16px; display: flex; gap: 8px; }
.slider-dots button {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); cursor: pointer;
}
.slider-dots button[aria-current="true"] { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-active { transition: none; } }
@media (max-width: 560px) {
  .slider { aspect-ratio: 16 / 9; min-height: 0; }
  .slide-caption { left: 16px; bottom: 30px; max-width: calc(100% - 32px); padding: 12px 16px; }
  .slide-text { font-size: 14px; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head h2 { margin-bottom: 16px; }
.section-head a { color: var(--accent); font-size: 14px; font-weight: 600; }

.tiles { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tile {
  display: grid; place-items: center; min-height: 92px; padding: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-weight: 600;
}
.tile:hover { border-color: var(--accent); color: var(--accent); }

/* --- Доверие: доставка, оплата, связь --- */
.benefits { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 40px 0 8px; }
.benefit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.benefit-title { font-weight: 600; margin-bottom: 4px; }
.benefit p { margin: 0; color: var(--muted); font-size: 14px; }

/* --- Подвал --- */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; margin-top: 64px; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer p { margin: 6px 0; }
.footer a:hover { color: var(--accent); }
.footer-title { font-weight: 600; color: var(--text); margin-bottom: 10px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
/* Мессенджеры — круглые кнопки в тон остальным кнопкам витрины, знак Font Awesome
   обычного кегля. Фирменный цвет приложения появляется при наведении: покупатель видит,
   куда нажимает, а в покое ряд не пестрит рядом с акцентом магазина. */
.socials { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.social {
  --social-size: 38px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--social-size); height: var(--social-size); border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.social svg { width: 18px; height: 18px; display: block; }
.social:hover { background: var(--social-brand); border-color: var(--social-brand); color: #fff; }
.social:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-wa { --social-brand: #25d366; }
.social-tg { --social-brand: #229ed9; }
.social-ig { --social-brand: #e1306c; }
.social-vk { --social-brand: #0077ff; }

.empty { text-align: center; padding: 64px 16px; color: var(--muted); }
/* Листание как у больших магазинов: одна строка-группа «‹ Назад | 1 2 3 … 9 | Вперёд ›»,
   текущая страница — в рамке и жирным, недоступный шаг приглушён. */
.pager {
  display: flex; align-items: stretch; justify-content: center; width: fit-content; max-width: 100%;
  margin: 40px auto 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-soft); font-size: 14px; overflow: hidden;
}
.pager > a, .pager > span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 42px; height: 42px; padding: 0 12px; color: var(--text);
  border-left: 1px solid var(--border); transition: background-color .15s ease;
}
.pager > :first-child { border-left: 0; }
.pager > a:hover { background: var(--surface-2); }
.pager > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pager .current {
  font-weight: 700; position: relative; z-index: 1;
  box-shadow: inset 0 0 0 2px var(--text); border-radius: 2px;
}
.pager .gap { color: var(--muted); min-width: 32px; padding: 0 4px; }
.pager-step { padding: 0 16px; font-weight: 500; }
.pager-step.is-disabled { color: var(--muted); opacity: .55; cursor: default; }
@media (max-width: 560px) {
  .pager > a, .pager > span { min-width: 38px; height: 40px; padding: 0 8px; }
  .pager-step span { display: none; }
}

/* ===== Оценка и отзывы ===== */
/* Два слоя одинаковых глифов: верхний обрезан по ширине, поэтому 4,3 рисуется как 4,3. */
.stars { position: relative; display: inline-block; color: var(--border); line-height: 1; white-space: nowrap; }
.stars-on { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.rating-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.rating-line:hover { color: var(--accent); }
.card-rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.card-variants { font-size: 13px; }

.rating-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.rating-value { font-size: 40px; font-weight: 700; line-height: 1; }

.reviews { display: grid; gap: 14px; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.review-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.review-text { margin: 0; line-height: 1.6; white-space: pre-line; }
.review-reply { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--accent); font-size: 14px; }
.review-reply p { margin: 2px 0 0; white-space: pre-line; }

/* Оценка в форме: пять звёзд подряд, подсветка — до наведённой включительно.
   Поэтому разметка идёт от 5 к 1: соседей «слева» в CSS нет, а «справа» есть. */
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; font-size: 30px; line-height: 1; }
.rating-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-input label { color: var(--border); cursor: pointer; transition: color .15s ease; }
.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label,
.rating-input input:checked + label { color: var(--star); }
.rating-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Варианты товара ===== */
.variants { display: grid; gap: 16px; }
.variant-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.variant-values { display: flex; flex-wrap: wrap; gap: 8px; }
.variant {
  display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 15px; cursor: pointer;
}
.variant:hover { border-color: var(--accent); }
.variant.current { border-color: var(--accent); background: var(--accent); color: var(--accent-contrast); cursor: default; }
/* Кончившийся вариант остаётся открытым: его можно посмотреть и дождаться. */
.variant.sold { text-decoration: line-through; color: var(--muted); }
.variant.sold.current { color: var(--accent-contrast); opacity: .75; }
/* Сочетания, которого не делают, нажать нельзя — ссылки у него и нет. */
.variant.missing { color: var(--border); border-style: dashed; cursor: not-allowed; }

/* ===== Избранное ===== */
.fav {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--muted); font: inherit; cursor: pointer; padding: 11px 16px;
}
.fav:hover { border-color: var(--danger); color: var(--danger); }
.fav[aria-pressed="true"] { border-color: var(--danger); color: var(--danger); }
.fav .fav-icon { font-size: 16px; line-height: 1; }
.fav-wide { min-height: 44px; }
/* На карточке каталога — поверх фотографии, справа сверху: бейджи скидки стоят слева. */
.fav-corner {
  position: absolute; top: 10px; right: 10px; z-index: 1; padding: 0;
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  /* Непрозрачная подложка объявлена первой: в браузере без color-mix правило ниже
     отбрасывается целиком, и без неё кнопка осталась бы без фона поверх фотографии. */
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(6px);
}
.cart-link .fav-icon { font-size: 15px; }

/* Бренд над названием показывает шаблон «Магазин»; в остальных карточка без него. */
.card-brand { display: none; }
.detail-brand { display: none; }

/* --- Чат с магазином ---
 * Кнопка в правом нижнем углу и окно переписки. Цвета — из темы витрины: окно выглядит частью
 * магазина в любой из тем, а не чужим виджетом. На телефоне окно занимает весь экран. */
[data-support-chat] { font-size: 15px; }
.ksc-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-contrast); font: 600 15px/1 var(--font);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.ksc-launch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.ksc-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #e5484d; color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}
.ksc-open .ksc-launch { display: none; }
.ksc-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 61; width: 380px; height: min(600px, calc(100vh - 36px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.ksc-panel[hidden] { display: none; }
.ksc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--accent); color: var(--accent-contrast); }
.ksc-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18); flex: none; }
.ksc-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ksc-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ksc-title span { font-size: 12px; opacity: .85; }
.ksc-close { border: 0; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ksc-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.ksc-empty { margin: auto 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; padding: 0 12px; }
.ksc-empty[hidden] { display: none; }
.ksc-msg { display: flex; flex-direction: column; max-width: 82%; }
.ksc-mine { align-self: flex-end; align-items: flex-end; }
.ksc-shop { align-self: flex-start; align-items: flex-start; }
.ksc-bubble { padding: 9px 12px; border-radius: 14px; line-height: 1.45; word-break: break-word; }
.ksc-mine .ksc-bubble { background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 4px; }
.ksc-shop .ksc-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ksc-text { white-space: pre-wrap; }
.ksc-img { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; cursor: zoom-in; margin-bottom: 4px; }
.ksc-doc { color: inherit; text-decoration: underline; }
.ksc-meta { font-size: 11px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.ksc-contact { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.ksc-contact[hidden] { display: none; }
.ksc-contact p { margin: 0 0 8px; color: var(--muted); }
.ksc-contact-row { display: flex; gap: 8px; margin-bottom: 8px; }
.ksc-contact input, .ksc-form textarea {
  min-width: 0; flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
.ksc-contact button { border: 0; border-radius: 10px; padding: 8px 14px; background: var(--accent); color: var(--accent-contrast); font: 600 13px var(--font); cursor: pointer; }
.ksc-file, .ksc-note { padding: 6px 14px; font-size: 13px; border-top: 1px solid var(--border); }
.ksc-file[hidden], .ksc-note[hidden] { display: none; }
.ksc-note { color: #e5484d; }
.ksc-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.ksc-form textarea { resize: none; max-height: 140px; line-height: 1.4; }
.ksc-form textarea:focus, .ksc-contact input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ksc-attach, .ksc-send {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; cursor: pointer;
}
.ksc-attach { color: var(--muted); background: transparent; }
.ksc-attach:hover { color: var(--accent); }
.ksc-send { background: var(--accent); color: var(--accent-contrast); }
.ksc-send:disabled { opacity: .6; cursor: default; }
.ksc-foot { padding: 8px 14px 10px; font-size: 12px; color: var(--muted); text-align: center; }
.ksc-foot a { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .ksc-launch { right: 14px; bottom: 14px; padding: 14px; }
  .ksc-launch-text { display: none; }
  .ksc-panel { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
}

/* ---------- Свои страницы, новости, контакты ---------- */

.page-title { margin: 0 0 28px; }

/* Статья: узкая колонка для чтения, крупный кегль и воздух между абзацами — как у изданий. */
.article { max-width: 780px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.article-body { font-size: 18px; line-height: 1.75; color: var(--text); }
.article-body p { margin: 0 0 1.1em; }
.article-body ul { margin: 0 0 1.1em; padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--accent); }
.article-back { display: inline-flex; gap: 8px; margin-top: 12px; font-weight: 600; color: var(--accent); }
.article-back:hover { text-decoration: underline; }
.article-more { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.article-more h2 { margin: 0 0 24px; }

/* Под страницей — связаться: её читают, чтобы заказать. */
.cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px;
  max-width: 780px; margin-top: 48px; padding: 28px 32px;
  border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius, 12px);
  background: var(--surface);
}
.cta-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.cta-box p { margin: 0; color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.cta-phone { font-size: 22px; font-weight: 700; white-space: nowrap; color: var(--text); }
.cta-phone:hover { color: var(--accent); }

/* Новости — карточки сеткой: дата, заголовок, начало текста; карточка целиком — ссылка. */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.news-card {
  display: flex; flex-direction: column; gap: 12px; padding: 28px; min-height: 220px;
  border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--surface); color: var(--text);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: transparent; box-shadow: 0 14px 34px rgba(17, 24, 39, .1); }
.news-date { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.news-title { margin: 0; font-size: 21px; line-height: 1.3; }
.news-card:hover .news-title { color: var(--accent); }
.news-excerpt {
  margin: 0; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-more { margin-top: auto; font-weight: 600; color: var(--accent); }

/* Контакты: сведения слева, большая карта справа. Без карты сведения — в две колонки. */
.contacts-page { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.contacts-page.no-map { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.contacts-info { display: grid; gap: 26px; }
.contact-block { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: start; }
.contact-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent);
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-label { margin-bottom: 4px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.contact-value { display: block; font-size: 18px; line-height: 1.5; color: var(--text); }
.contact-phone { font-size: 22px; font-weight: 700; }
a.contact-value:hover { color: var(--accent); }
.contact-link { display: inline-block; margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--accent); }
.contact-link:hover { text-decoration: underline; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.contacts-map {
  position: sticky; top: 90px; overflow: hidden; height: 520px;
  border-radius: var(--radius, 12px); box-shadow: 0 10px 30px rgba(17, 24, 39, .08); background: var(--surface-2, #f3f4f6);
}
.contacts-map-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; color: var(--accent);
}
.contacts-map.is-ready .contacts-map-fallback { display: none; }

@media (max-width: 900px) {
  .contacts-page { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .contacts-map { position: static; height: 360px; }
}
@media (max-width: 560px) {
  .article-body { font-size: 17px; }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .news-card { padding: 22px; min-height: 0; }
  .cta-box { padding: 22px 20px; }
  .contacts-map { height: 300px; margin: 0 -16px; border-radius: 0; }
}
