@charset "UTF-8";
/* ==========================================================================
   МАГАЗИН ПИЛОМАТЕРИАЛОВ — ОСНОВНОЙ ФАЙЛ СТИЛЕЙ
   --------------------------------------------------------------------------
   Один файл, без сборщиков. Подключается в includes/header.php.
   Mobile-first: базовые правила — для телефона, ниже медиазапросы «вверх».

   КАК МЕНЯТЬ ЦВЕТА: блок «ПАЛИТРА» ниже, всё завязано на переменные.
   КАК МЕНЯТЬ ШРИФТ:  блок «ШРИФТ», файлы кладутся в assets/fonts/.

   Содержание:
     01. Токены (палитра, размеры, тени)
     02. Шрифт
     03. Сброс и базовая типографика
     04. Сетка и секции
     05. Кнопки
     06. Шапка и меню
     07. Главный экран
     08. Плитки категорий
     09. Карточка товара в списке
     10. Каталог: фильтры и сортировка
     11. Страница товара
     12. Калькулятор
     13. Таблицы (характеристики, прайс)
     14. Формы
     15. Корзина и оформление
     16. Отзывы, преимущества, аккордеон
     17. Подвал
     18. Плавающие кнопки (моб.)
     19. Служебные классы
     20. Печать
   ========================================================================== */


/* ==========================================================================
   01. ТОКЕНЫ
   ========================================================================== */
:root {

  /* --- ПАЛИТРА -----------------------------------------------------------
     Хвойный тёмно-зелёный + охра смолы + тёплый белый.
     Меняете здесь — меняется весь сайт.                                   */
  --forest:      #1B3B2F;   /* основной тёмный: шапка, подвал, заголовки   */
  --forest-deep: #12281F;   /* нажатое состояние, подвал                   */
  --resin:       #C87C1F;   /* акцент: кнопки, цены, активные элементы     */
  --resin-dark:  #8F550F;   /* акцент при наведении, темнее для контраста  */
  --paper:       #EDF4EE;   /* фон страницы, светло-зелёный                */
  --panel:       #DFEBE1;   /* фон блоков, полос, «подложек», зеленее      */
  --ink:         #16191B;   /* основной текст                              */
  --ink-soft:    #5C6560;   /* второстепенный текст, подписи               */
  --line:        #CFE0D3;   /* границы, разделители, в тон зелёному фону   */
  --white:       #FFFFFF;
  --ok:          #2E7D4F;   /* «в наличии», успех                          */
  --warn:        #B3261E;   /* ошибки валидации                            */

  /* Доп. акценты для карточек «Что вы строите» — та же землистая гамма,
     просто два новых оттенка: терракота (огонь/тепло) и приглушённая бирюза
     (кровля/небо). Не рассыпаются радугой, остаются в стиле бренда. */
  --clay:        #B1532E;
  --clay-tint:   rgba(177, 83, 46, .10);
  --teal:        #2F6F62;
  --teal-tint:   rgba(47, 111, 98, .10);
  --resin-tint:  rgba(200, 124, 31, .10);
  --forest-tint: rgba(27, 59, 47, .07);

  /* --- РАЗМЕРЫ ---------------------------------------------------------- */
  --wrap:        1240px;    /* максимальная ширина контента                */
  --pad-x:       20px;      /* поля слева и справа у всей страницы.

     Отдельная переменная, а не --gap. Раньше .wrap брал отступ из --gap,
     а та же переменная задаёт промежутки между карточками в сетках —
     то есть добавить воздуха по краям было нельзя, не раздвинув заодно
     всю плитку. Теперь это два независимых числа.

     Меняется в медиазапросе на 600 px: на телефоне 20, дальше 24.
     ЕСЛИ БУДЕТЕ УВЕЛИЧИВАТЬ — проверьте шапку: она тоже лежит внутри
     .wrap, и её содержимое помещается впритык, см. комментарий
     у медиазапроса @media (min-width: 1240px).                        */
  --gap:         16px;      /* промежутки внутри сеток и между блоками     */
  --gap-lg:      24px;
  --radius:      10px;
  --radius-sm:   6px;
  --tap:         44px;      /* минимальный размер кликабельного элемента   */

  /* --- ТЕНИ И ПЕРЕХОДЫ -------------------------------------------------- */
  --shadow:      0 1px 2px rgba(22,25,27,.06), 0 4px 16px rgba(22,25,27,.06);
  --shadow-up:   0 6px 28px rgba(22,25,27,.12);
  --t:           .18s ease;

  /* --- ТИПОГРАФИКА ------------------------------------------------------ */
  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
}


/* ==========================================================================
   02. ШРИФТ
   Один шрифт, два начертания — 400 и 700 (требование ТЗ).
   Файлы Golos Text положить в assets/fonts/ (формат woff2).
   Скачать: fonts.google.com/specimen/Golos+Text — лицензия SIL OFL.
   Если файлов нет — сайт возьмёт системный шрифт из --font, ничего не сломается.
   ========================================================================== */
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-text-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;   /* текст виден сразу, не ждём загрузки шрифта */
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-text-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   03. СБРОС И БАЗОВАЯ ТИПОГРАФИКА
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* iOS не увеличивает шрифт в альбоме */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* Цифры одинаковой ширины — цены в столбцах не «прыгают» */
  font-variant-numeric: tabular-nums;

  background: var(--paper);
}

img, picture, video, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--forest);
  text-wrap: balance;        /* заголовок не оставляет одно слово на строке */
}
h1 { font-size: clamp(28px, 7vw, 46px); }
h2 { font-size: clamp(23px, 5.2vw, 34px); }
h3 { font-size: clamp(18px, 4vw, 22px); }
h4 { font-size: 17px; }

p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: rgba(200,124,31,.45);
  text-underline-offset: 3px;
  transition: color var(--t);
}
a:hover { color: var(--resin-dark); }

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .35em; }

strong, b { font-weight: 700; }
small { font-size: 13px; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--gap-lg) 0; }

/* Видимый фокус с клавиатуры — обязателен для доступности */
:focus-visible {
  outline: 3px solid var(--resin);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Уважаем системную настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ==========================================================================
   04. СЕТКА И СЕКЦИИ
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section { padding: 40px 0; }
.section--tight { padding: 24px 0; }
.section--panel { background: var(--panel); }
.section--dark  { background: var(--forest); color: rgba(255,255,255,.88); }
.section--dark h2, .section--dark h3 { color: var(--white); }

/* Надзаголовок секции: короткая метка над h2 */
.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--resin-dark);
}
.section--dark .eyebrow { color: #E5A85C; }

.section__head { margin-bottom: var(--gap-lg); }
.section__head p { color: var(--ink-soft); max-width: 62ch; }

/* Универсальная адаптивная сетка. Колонки задаются модификатором. */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 600px) {
  /* Экран уже не узкий — можно дать больше воздуха по краям */
  :root { --pad-x: 24px; }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .section { padding: 64px 0; }
  .grid { gap: var(--gap-lg); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Хлебные крошки */
.crumbs {
  padding: 14px 0;
  font-size: 13px;
  color: var(--ink-soft);
  overflow-x: auto;              /* на телефоне длинная цепочка скроллится */
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--resin-dark); }
.crumbs span + span::before { content: "→"; margin: 0 8px; opacity: .5; }


/* ==========================================================================
   05. КНОПКИ
   Высота не ниже 44px — требование по кликабельности на телефоне.
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 11px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t),
              transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

/* Главное действие: «в корзину», «отправить заявку» */
.btn--primary {
  background: var(--resin);
  border-color: var(--resin);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--resin-dark);
  border-color: var(--resin-dark);
  color: var(--white);
}

/* Второе по важности: «подробнее», «в каталог» */
.btn--dark {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}
.btn--dark:hover { background: var(--forest-deep); color: var(--white); }

/* Контурная: «купить в 1 клик», «сбросить фильтры» */
.btn--ghost {
  background: transparent;
  border-color: var(--forest);
  color: var(--forest);
}
.btn--ghost:hover { background: var(--forest); color: var(--white); }

.btn--light {
  background: var(--white);
  border-color: var(--line);
  color: var(--forest);
}
.btn--light:hover { border-color: var(--forest); }

.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 14px 30px; font-size: 17px; }

.btn[disabled], .btn.is-disabled {
  opacity: .45;
  pointer-events: none;
}


/* ==========================================================================
   06. ШАПКА И МЕНЮ
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--forest);
  color: var(--white);
}

.header__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  /* Базовый размер — мобильный. На экранах от 420 px возвращается 18 px,
     см. медиазапрос ниже. */
  font-size: 16px;
  letter-spacing: -.01em;
  /* Логотип не сжимается. Шапка — это флекс-строка, и когда меню в неё
     не влезало, браузер отбирал место у единственного гибкого элемента —
     логотипа. Из-за этого «Пиломатериалы · Томск» ломалось на две строки
     даже на широком экране. */
  flex: 0 0 auto;
}
.logo img { width: 34px; height: 34px; flex: 0 0 auto; }

/* Текстовая часть логотипа */
.logo > span { display: block; }

.logo__city {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .65;
  /* Строка «Пиломатериалы · Томск» не должна ломаться: перенос сдвигал
     всю шапку вниз и разрывал город на отдельную строку. */
  white-space: nowrap;
}

/* Телефон в шапке. На телефоне прячем — есть плавающая кнопка «Позвонить». */
.header__phone {
  display: none;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  flex: 0 0 auto;   /* не сжимается, см. пояснение у .header__icon */
}
.header__phone small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: .65;
}

/* Иконочные кнопки шапки: корзина, бургер.

   flex: 0 0 auto здесь критично. Шапка — флекс-строка, и когда содержимое
   в неё не влезает, браузер отбирает ширину у любого элемента, которому
   это не запрещено. Кнопка 44×44 сжималась до 5–6 пикселей: иконка корзины
   пропадала совсем, а на её месте оставался висеть только оранжевый
   счётчик — он позиционирован абсолютно и от ширины кнопки не зависит.
   Внутренней svg запрет нужен по той же причине. */
.header__icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.10);
  color: var(--white);
  cursor: pointer;
  transition: background var(--t);
}
.header__icon:hover { background: rgba(255,255,255,.20); }
.header__icon svg { width: 22px; height: 22px; flex: 0 0 auto; }

/* Счётчик позиций на иконке корзины */
.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--resin);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

/* Меню: на телефоне — выезжающая панель, на десктопе — строка */
.nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 86vw);
  padding: 76px 20px 28px;
  background: var(--forest-deep);
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  z-index: 60;
}
.nav.is-open { transform: translateX(0); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; border-bottom: 1px solid rgba(255,255,255,.10); }
.nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 10px 0;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
}
.nav a:hover, .nav a.is-active { color: #E5A85C; }

.nav__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* Затемнение под открытым меню */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18,40,31,.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
  z-index: 55;
}
.overlay.is-open { opacity: 1; visibility: visible; }

/* Логотип на узких телефонах (320–420 px). Раз строка «Пиломатериалы · Томск»
   больше не переносится, на самых узких экранах ей надо чуть меньше места —
   иначе она упрётся в кнопки корзины и бургера. Мобильный размер задан базовым
   выше в .logo, здесь возвращаем полный на экранах пошире. */
@media (min-width: 420px) {
  .logo      { font-size: 18px; }
  .logo__city { font-size: 11px; }
}

/* ==========================================================================
   ГОРИЗОНТАЛЬНОЕ МЕНЮ В ШАПКЕ
   --------------------------------------------------------------------------
   Порог 1240 px выбран не на глаз, а посчитан. В шапке помещаются:
   логотип (~185 px) + телефон (~110) + корзина (44) + семь пунктов меню
   (~660) + промежутки (~55). Итого около 1055 px, а контейнер .wrap
   при полях --pad-x: 24 px даёт 1192 px — запас примерно 140 px.

   Раньше порог был 1000 px, и на экранах 1000–1240 px меню физически
   не помещалось: браузер сжимал логотип, его подпись ломалась на две
   строки, а последние пункты меню уезжали за край экрана.
   Ниже 1240 px показывается бургер — он там уместнее.

   ЕСЛИ ДОБАВИТЕ ПУНКТ В МЕНЮ (массив $MENU в includes/header.php) —
   поднимите это число примерно на ширину нового пункта, иначе история
   повторится.
   ========================================================================== */
@media (min-width: 1240px) {
  .header__bar { min-height: 76px; gap: 18px; }
  .header__phone { display: block; }
  .header__burger { display: none; }
  /* Меню становится строкой внутри шапки и центрируется по вертикали */
  .nav {
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    transform: none;
    overflow: visible;
    display: flex;
    align-items: center;
  }
  .nav ul {
    display: flex;
    align-items: center;
    /* Компактный шаг в полосе 1240–1360 px: там места впритык.
       На экранах шире промежутки возвращаются, см. медиазапрос ниже. */
    gap: 16px;
  }
  .nav li { border: 0; }
  .nav a {
    display: inline-flex;
    align-items: center;
    min-height: auto;
    padding: 0;
    font-size: 14px;
    white-space: nowrap;   /* пункты не ломаются на две строки */
  }
  .nav__close { display: none; }
}

/* Экраны пошире — возвращаем меню обычный размер и воздух */
@media (min-width: 1360px) {
  .header__bar { gap: 24px; }
  .nav ul { gap: 20px; }
  .nav a { font-size: 15px; }
}

/* ==========================================================================
   07. ГЛАВНЫЙ ЭКРАН
   ========================================================================== */
.hero {
  position: relative;
  padding: 36px 0 40px;
  background: var(--forest);
  color: rgba(255,255,255,.85);
  overflow: hidden;
}
/* Фото штабеля доски фоном. Затемнение — чтобы текст читался. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/ui/hero.webp") center/cover no-repeat;
  opacity: .22;
}
.hero > * { position: relative; }
.hero h1 { color: var(--white); margin-bottom: 14px; }
.hero__lead {
  max-width: 46ch;
  font-size: 17px;
  margin-bottom: 22px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Полоса ключевых фактов под первым экраном */
.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 30px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts div { padding: 16px 14px; background: var(--forest); }
.facts b {
  display: block;
  font-size: 24px;
  color: var(--white);
  line-height: 1.1;
}
.facts span { font-size: 13px; opacity: .7; }

@media (min-width: 700px) {
  .hero { padding: 72px 0 76px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
}


/* --- Первый экран без фонового фото ---------------------------------------
   Плотный зелёный + крупная типографика. Грузится мгновенно,
   читается на солнце, не выглядит как сток.                              */
.hero--flat::before { display: none; }
.hero--flat {
  /* Тонкая полоса цвета смолы снизу — вместо картинки */
  border-bottom: 4px solid var(--resin);
}
.eyebrow--light { color: #E5A85C; }

.hero__price {
  margin: 0 0 22px;
  font-size: 17px;
  color: rgba(255,255,255,.75);
}
.hero__price strong {
  font-size: 30px;
  color: var(--white);
  letter-spacing: -.02em;
}

.link--light { color: #E5A85C; }
.btn--ghost-light { border-color: rgba(255,255,255,.5); color: var(--white); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); color: var(--white); }


/* ==========================================================================
   07b. ПОДБОР ПО ЗАДАЧЕ
   ========================================================================== */
/* ==========================================================================
   КАРТОЧКИ «ЧТО ВЫ СТРОИТЕ» — цветной акцент, иконка, мягкое появление.
   Стили класса .task используются только в этом блоке (проверено).
   ========================================================================== */
.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 46px 20px 20px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--forest);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(27,59,47,.04);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t), background var(--t);
}
.task:hover {
  transform: translateY(-3px);
  border-color: var(--accent, var(--resin));
  box-shadow: 0 14px 28px -12px var(--accent, var(--resin));
  background: var(--accent-tint, var(--panel));
}

/* Цветной акцент — своя переменная на каждый вариант, дальше всё общее */
.task--clay   { --accent: var(--clay);   --accent-tint: var(--clay-tint); }
.task--teal   { --accent: var(--teal);   --accent-tint: var(--teal-tint); }
.task--forest { --accent: var(--forest); --accent-tint: var(--forest-tint); }
.task--resin  { --accent: var(--resin);  --accent-tint: var(--resin-tint); }

/* Иконка-чип: цветной кружок слева */
.task__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-tint, var(--panel));
  color: var(--accent, var(--resin));
  transition: background var(--t), transform var(--t);
}
.task__icon svg { flex: 0 0 auto; width: 24px; height: 24px; }
.task:hover .task__icon {
  background: var(--accent, var(--resin));
  color: #fff;
  transform: scale(1.06);
}

.task__body { min-width: 0; }
.task b {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--forest);
}
.task span { display: block; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }
.task i {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 20px;
  color: var(--accent, var(--resin));
  transition: transform var(--t);
}
.task:hover i { transform: translateY(-50%) translateX(3px); }


/* ==========================================================================
   ПОЯВЛЕНИЕ КАРТОЧЕК ПРИ ПРОКРУТКЕ
   --------------------------------------------------------------------------
   ВАЖНО: класс .reveal-item добавляется только через JS (main.js), а не
   в исходном HTML. Значит без JavaScript карточки остаются полностью
   видимыми и стилизованными — анимация только украшает, никогда не прячет
   контент. Анимируется каждая карточка отдельно, сетка .grid--tasks
   не трогается — раскладка не может «поехать».
   ========================================================================== */
.grid--tasks .task.reveal-item {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--d, 0ms);
}
/* На широких экранах чередуем сторону по колонке: левая колонка выезжает
   слева, средняя — снизу, правая — справа. На мобильном (1 колонка)
   остаётся только вертикальный сдвиг — без горизонтального движения. */
@media (min-width: 760px) {
  .grid--tasks .task.reveal-item:nth-child(3n+1) { transform: translateX(-30px); }
  .grid--tasks .task.reveal-item:nth-child(3n+2) { transform: translateY(22px); }
  .grid--tasks .task.reveal-item:nth-child(3n)   { transform: translateX(30px); }
}
.grid--tasks .task.reveal-item.is-visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .grid--tasks .task.reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ==========================================================================
   07c. ПОРОДЫ
   ========================================================================== */
.species {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.species > img {
  width: 100%;
  aspect-ratio: 400 / 260;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.species__body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.species__body h3 { margin-bottom: 4px; }
.species__body p { font-size: 14.5px; }
.species__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--resin-dark);
  margin-bottom: 12px;
}
.species__body .btn { margin-top: auto; align-self: flex-start; }


/* ==========================================================================
   07d. ШАГИ И ЗАМЕТКИ
   ========================================================================== */
.step { padding: 18px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
}
.step b { display: block; margin-bottom: 6px; font-size: 16px; color: var(--forest); }
.step p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* Выделенная заметка — совет или важное уточнение */
.note {
  padding: 16px 18px;
  border-left: 4px solid var(--resin);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #FDF7EF;
  font-size: 15px;
  line-height: 1.55;
}
.section--panel .note { background: var(--white); }


/* ==========================================================================
   08. ПЛИТКИ КАТЕГОРИЙ
   ========================================================================== */
.cat {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--forest);
  text-decoration: none;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.cat:hover {
  border-color: var(--resin);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--forest);
}
/* Фото товара вместо прежней иконки — квадрат с скруглением, object-fit
   гарантирует, что снимок любых пропорций впишется в рамку без искажений
   и никогда не станет больше отведённого места. */
.cat__photo {
  display: block;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.cat__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t);
}
.cat:hover .cat__photo img { transform: scale(1.06); }
.cat b { display: block; font-size: 18px; line-height: 1.25; }
.cat > span {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.cat__from {
  display: block;
  margin-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--resin-dark);
  letter-spacing: -.01em;
}
.cat small { display: block; margin-top: 2px; font-size: 12.5px; }


/* ==========================================================================
   09. КАРТОЧКА ТОВАРА В СПИСКЕ
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--resin); box-shadow: var(--shadow); }

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

/* Метки на фото: «хит», «в наличии», «сушка» */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--forest);
  color: var(--white);
}
.badge--hit  { background: var(--resin); }
.badge--dry  { background: #4C6E8A; }
.badge--stock{ background: var(--ok); }
.card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
}
.card__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--forest);
}
.card__title a { text-decoration: none; color: inherit; }

/* Порода / сорт / влажность — короткой строкой */
.card__meta {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.card__price { margin-top: auto; }
.price {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -.02em;
}
.price__unit { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
/* Пересчёт «≈ 780 ₽/шт» под основной ценой */
.price__alt {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
}
.card__actions { display: flex; gap: 8px; margin-top: 12px; }
.card__actions .btn { flex: 1; }


/* ==========================================================================
   10. КАТАЛОГ: ФИЛЬТРЫ И СОРТИРОВКА
   ========================================================================== */
.catalog { display: grid; gap: var(--gap-lg); }

@media (min-width: 1000px) {
  .catalog { grid-template-columns: 280px 1fr; align-items: start; }
}

/* На телефоне фильтры скрыты и открываются кнопкой */
.filters {
  display: none;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.filters.is-open { display: block; }
@media (min-width: 1000px) {
  .filters { display: block; position: sticky; top: 92px; }
  .filters__toggle { display: none; }
}

.filters__group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filters__group:last-child { border-bottom: 0; padding-bottom: 0; }
.filters__group > b {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--forest);
}

/* Чекбоксы и радио с крупной зоной нажатия */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: 15px;
  cursor: pointer;
}
.check input { width: 19px; height: 19px; accent-color: var(--resin); flex: none; }
.check span { color: var(--ink); }
.check small { margin-left: auto; color: var(--ink-soft); font-size: 12px; }

/* Диапазон цены */
.range { display: flex; align-items: center; gap: 8px; }
.range input { width: 100%; }
.range span { color: var(--ink-soft); }

.catalog__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--gap);
}
.catalog__count { color: var(--ink-soft); font-size: 14px; margin-right: auto; }

.field-sort {
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

/* Активные фильтры «чипсами» */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  font-size: 13px;
}
.chip button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

/* Пустой результат — не «ничего не найдено», а подсказка что делать */
.empty {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-soft);
}

/* Пагинация */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.pager a, .pager span {
  min-width: var(--tap);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
.pager .is-current { background: var(--forest); border-color: var(--forest); color: var(--white); }


/* ==========================================================================
   11. СТРАНИЦА ТОВАРА
   ========================================================================== */
.product { display: grid; gap: var(--gap-lg); }
@media (min-width: 900px) {
  .product { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

/* Галерея */
.gallery__main {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery__thumbs button {
  flex: none;
  width: 68px;
  height: 54px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.gallery__thumbs button.is-active { border-color: var(--resin); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Блок цены и покупки */
.buybox {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.buybox .price { font-size: 34px; }

.stock { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.stock--out { color: var(--ink-soft); }
.stock--out::before { background: var(--ink-soft); }

/* Переключатель единиц: м³ / шт / м² */
.units { display: flex; gap: 0; margin: 16px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.units label { flex: 1; }
.units input { position: absolute; opacity: 0; pointer-events: none; }
.units span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.units input:checked + span { background: var(--forest); color: var(--white); }

/* Счётчик количества.

   flex: 0 0 auto — по той же причине, что и у кнопок шапки. Здесь риск
   не теоретический: overflow: hidden обнуляет минимальную ширину флекс-
   элемента, то есть браузеру разрешено сплющить весь блок в ноль.
   На экране 320 px запас был около двух пикселей. */
.qty {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty button {
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: var(--panel);
  font-size: 20px;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
}
.qty button:hover { background: var(--line); }
.qty input {
  flex: 0 0 auto;
  width: 76px;
  height: var(--tap);
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Итог по позиции */
.buybox__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.buybox__total b { font-size: 22px; color: var(--forest); }
.buybox__actions { display: grid; gap: 8px; }


/* ==========================================================================
   12. КАЛЬКУЛЯТОР ПИЛОМАТЕРИАЛОВ
   Ключевой элемент сайта. Используется на главной, в карточке и на /calculator.
   ========================================================================== */
.calc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.calc__head {
  padding: 16px 18px;
  background: var(--forest);
  color: var(--white);
}
.calc__head b { display: block; font-size: 18px; }
.calc__head span { font-size: 13px; opacity: .7; }

.calc__body { padding: 18px; }

/* Поля сечения: толщина × ширина × длина */
.calc__dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; }
.calc__dims .field { margin-bottom: 0; }

.calc__row { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 560px) { .calc__row--2 { grid-template-columns: repeat(2, 1fr); } }

/* Результат: крупные цифры, это главное ради чего пришли */
.calc__out {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.calc__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.calc__grid > div { min-width: 0; }
.calc__grid b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  color: var(--forest);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.calc__grid span { font-size: 12px; color: var(--ink-soft); }

.calc__sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.calc__sum b { font-size: 26px; color: var(--resin-dark); letter-spacing: -.02em; }

.calc__note { margin-top: 10px; font-size: 12px; color: var(--ink-soft); }

@media (min-width: 700px) {
  .calc__grid { grid-template-columns: repeat(4, 1fr); }
}


/* ==========================================================================
   13. ТАБЛИЦЫ
   ========================================================================== */
/* Обёртка для горизонтальной прокрутки на телефоне */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--panel); }

/* Числовые колонки прижаты вправо — так столбик цифр читается разряд
   в разряд. ВАЖНО: правило распространяется и на th, и на td.
   Раньше здесь стоял только td.num, а заголовок оставался слева —
   «₽ за м³» висел у левого края колонки, а число под ним у правого,
   и вся таблица выглядела съехавшей. */
.table th.num,
.table td.num { text-align: right; white-space: nowrap; }
.table td.num { font-weight: 700; }

/* Таблица характеристик товара: две колонки, точечный лидер */
.specs { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs th, .specs td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs th { width: 47%; font-weight: 400; color: var(--ink-soft); text-align: left; }
.specs td { font-weight: 700; text-align: right; }

/* Модификатор для текстовых значений (адрес, название организации) —
   не для чисел. Базовый .specs выравнивает td вправо и жирнит, что
   отлично смотрится для «150 мм» на карточке товара, но превращает
   длинный адрес на телефоне в рваную лесенку из коротких строк.
   Тут же — обычный левый край и не такой жирный вес. */
.specs--left td { text-align: left; font-weight: 600; }
@media (min-width: 500px) {
  .specs--left th { width: 200px; }
}

/* Прайс: липкая шапка при прокрутке длинного списка */
.table--price thead th {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}


/* ==========================================================================
   14. ФОРМЫ
   ========================================================================== */
.form { display: grid; gap: 14px; }
@media (min-width: 640px) { .form--2col { grid-template-columns: repeat(2, 1fr); } }

.field { display: block; margin-bottom: 0; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.field .req { color: var(--warn); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  font-size: 16px;   /* не меньше 16px, иначе iOS зумит страницу при фокусе */
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--resin);
  box-shadow: 0 0 0 3px rgba(200,124,31,.16);
  outline: none;
}
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235C6560' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Состояние ошибки — ставится классом из JS и из PHP */
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--warn); }
.error-text { display: block; margin-top: 5px; font-size: 13px; color: var(--warn); }

/* Согласие на обработку ПД — обязательный чекбокс по 152-ФЗ */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--resin); }

/* Ловушка для спам-ботов: невидима для человека, но не display:none —
   часть ботов игнорирует скрытые через display поля */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Контейнер под сообщение об отправке. Пустой — не занимает места. */
.form__msg { grid-column: 1 / -1; }
.form__msg:empty { display: none; }

/* Сообщения после отправки */
.msg { padding: 13px 15px; border-radius: var(--radius-sm); font-size: 15px; }
.msg--ok   { background: #E8F3EC; color: #1D5A38; border: 1px solid #BFE0CC; }
.msg--err  { background: #FBEAE9; color: #8C1D18; border: 1px solid #F1C7C4; }

.form__full { grid-column: 1 / -1; }


/* ==========================================================================
   15. КОРЗИНА И ОФОРМЛЕНИЕ
   ========================================================================== */
.cart { display: grid; gap: var(--gap-lg); }
@media (min-width: 1000px) { .cart { grid-template-columns: 1fr 340px; align-items: start; } }

.cart-item {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item__img { width: 78px; height: 66px; border-radius: var(--radius-sm); object-fit: cover; background: var(--panel); }
.cart-item__title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.cart-item__title a { text-decoration: none; color: var(--forest); }
.cart-item__meta { font-size: 13px; color: var(--ink-soft); margin: 3px 0 8px; }
.cart-item__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cart-item__sum { margin-left: auto; font-weight: 700; font-size: 17px; white-space: nowrap; }
.cart-item__del {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 0;
  min-height: 34px;
}
.cart-item__del:hover { color: var(--warn); }

/* Итоги. Липкие на десктопе, внизу на телефоне. */
.summary {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
@media (min-width: 1000px) { .summary { position: sticky; top: 92px; } }

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 15px;
}
.summary__row span { color: var(--ink-soft); }
.summary__row--total {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
}
.summary__row--total b { color: var(--resin-dark); }

/* Подсказка о транспорте — зависит от суммарного объёма */
.summary__hint {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 13px;
  color: var(--ink-soft);
}

/* Переключатель физлицо / юрлицо */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs label { flex: 1; }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.tabs input:checked + span {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--white);
}

/* Блок полей юрлица показывается скриптом */
[data-legal-fields] { display: none; }
[data-legal-fields].is-visible { display: grid; gap: 14px; }

/* Варианты доставки — крупные карточки-радио */
.delivery-opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.delivery-opt:hover { border-color: var(--ink-soft); }
.delivery-opt input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--resin); }
.delivery-opt b { display: block; font-size: 15px; color: var(--forest); }
.delivery-opt small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 13px; }
.delivery-opt:has(input:checked) { border-color: var(--resin); background: #FDF7EF; }

.steps { display: grid; gap: 22px; }


/* ==========================================================================
   16. ПРЕИМУЩЕСТВА, ОТЗЫВЫ, АККОРДЕОН
   ========================================================================== */
.adv {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
}
.adv svg { width: 30px; height: 30px; color: var(--resin); margin-bottom: 12px; }
.adv b { display: block; margin-bottom: 6px; font-size: 16px; color: var(--forest); }
.adv p { font-size: 14px; color: var(--ink-soft); margin: 0; }

.review {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
}
.review__text { font-size: 15px; margin-bottom: 14px; }
.review__who { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.review__who b { color: var(--forest); font-size: 14px; }
.review__who span { color: var(--ink-soft); margin-left: auto; }
.stars { color: var(--resin); letter-spacing: 2px; font-size: 14px; }

/* Аккордеон на <details> — без JS */
.acc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 10px;
}
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  padding: 13px 16px;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 21px; color: var(--resin); flex: none; }
.acc[open] summary::after { content: "−"; }
.acc__body { padding: 0 16px 16px; font-size: 15px; color: var(--ink-soft); }


/* ==========================================================================
   17. ПОДВАЛ
   ========================================================================== */
/* Подвал компактный: раньше занимал почти весь экран из-за крупных
   отступов и пятого блока, который переносился на вторую строку сетки. */
.footer {
  padding: 24px 0 0;
  background: var(--forest-deep);
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  line-height: 1.45;
}
.footer a { color: rgba(255,255,255,.72); text-decoration: none; }
.footer a:hover { color: #E5A85C; }
.footer h4 { color: var(--white); font-size: 14px; margin-bottom: 8px; }
.footer p { margin: 0 0 8px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 5px; }
.footer__cols { display: grid; gap: 18px 28px; }

/* Адреса площадок — мельче основного текста, это справочная информация */
.footer__site { font-size: 12.5px; opacity: .85; }

/* Восемь ссылок «по задаче» в один столбец растягивали подвал по высоте —
   на десктопе раскладываем их в две колонки внутри своей ячейки. */
@media (min-width: 700px) {
  .footer__cols { grid-template-columns: 1.25fr .8fr 1fr 1.15fr; }
  .footer__tasks { columns: 2; column-gap: 18px; }
  .footer__tasks li { break-inside: avoid; }
}

.footer__bottom {
  margin-top: 18px;
  padding: 12px 0 84px;   /* нижний отступ — под плавающие кнопки на моб. */
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  opacity: .65;
}
.footer__bottom p { margin: 0 0 4px; }
@media (min-width: 900px) { .footer__bottom { padding-bottom: 16px; } }


/* ==========================================================================
   БАННЕР СОГЛАСИЯ НА COOKIE
   (без сквозного номера раздела: в нумерации ниже по файлу уже есть
   пропуск на 27, порядок и так не строго последовательный — проще
   вынести этот блок за скобки нумерации, чем ради него переставлять
   код и рисковать зацепить соседние правила)
   --------------------------------------------------------------------------
   z-index: 70 — выше мобильного меню (60) и его подложки (55), баннер
   должен быть виден и поверх открытого меню, а не потеряться под ним.
   ========================================================================== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--forest);
  color: rgba(255,255,255,.9);
  padding: 16px var(--pad-x);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  transform: translateY(100%);
  transition: transform var(--t);
}
.cookie-banner.is-visible { transform: translateY(0); }

.cookie-banner__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}
.cookie-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.cookie-banner__text a { color: var(--resin); text-decoration: underline; }

.cookie-banner__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
}
/* Обе кнопки — btn--light. Одинаковый вес специально: выбор
   не должен визуально подталкиваться в одну сторону. */
.cookie-banner .btn { min-height: 40px; padding: 0 18px; }

@media (max-width: 480px) {
  .cookie-banner__actions { width: 100%; }
  .cookie-banner .btn { flex: 1 1 0; }
}


/* ==========================================================================
   18. ПЛАВАЮЩИЕ КНОПКИ (только телефон)
   ========================================================================== */
.float {
  position: fixed;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 10px;
  z-index: 45;
}
.float a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--white);
  box-shadow: var(--shadow-up);
  transition: transform var(--t);
}
.float a:active { transform: scale(.94); }
.float svg { flex: 0 0 auto; width: 26px; height: 26px; }
.float__max { background: #6E3AE8; }   /* фирменный фиолетовый MAX */

/* Нижняя полоса «Позвонить» — самое частое действие с телефона */
.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 46;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  box-shadow: 0 -2px 14px rgba(22,25,27,.10);
  /* На iPhone с домашним индикатором снизу есть системная полоса —
     без этого отступа кнопки могли бы оказаться слишком близко к ней. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.callbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  background: var(--white);
  color: var(--forest);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.callbar a.is-accent { background: var(--resin); color: var(--white); }
.callbar svg { width: 19px; height: 19px; }

@media (min-width: 900px) {
  .float, .callbar { display: none; }
}


/* ==========================================================================
   19. СЛУЖЕБНЫЕ КЛАССЫ
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.center      { text-align: center; }
.muted       { color: var(--ink-soft); }
.nowrap      { white-space: nowrap; }
.mt-0  { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hide-mob { display: none; }
@media (min-width: 700px) {
  .hide-mob  { display: block; }
  .hide-desk { display: none; }
}
.lead { font-size: 17px; color: var(--ink-soft); max-width: 66ch; }

/* Текстовые страницы: О компании, Доставка, Политика */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.1em; }
.prose li::marker { color: var(--resin); }


/* ==========================================================================
   20. ПЕЧАТЬ
   Нужна для прайса: «Сохранить как PDF» из браузера даёт чистый документ.
   ========================================================================== */
@media print {
  .header, .footer, .float, .callbar, .filters, .btn, .crumbs { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .section { padding: 0; }
  .table th, .table td { padding: 5px 7px; border-color: #999; }
  a { text-decoration: none; color: #000; }
}


/* ==========================================================================
   21. ПЕРЕКЛЮЧАТЕЛЬ СЕЧЕНИЯ (карточка товара)
   ========================================================================== */
.swatch-picker {
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.swatch-label {
  font-size: 14px;
  color: var(--ink-soft);
  min-width: 64px;
  flex-shrink: 0;
}
.swatch-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 7px 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 14px/1 inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.swatch:hover {
  border-color: var(--forest);
}
.swatch.is-active {
  border-color: var(--resin);
  background: var(--resin);
  color: #fff;
  font-weight: 700;
}
button.swatch {
  border: 1.5px solid var(--line);
}
/* Подпись над переключателем */
.swatch-picker-title {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
/* Кнопки +1м³ в карточках похожих товаров */
.card__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}


/* ==========================================================================
   22. ГЛАВНЫЙ ЭКРАН В ДВЕ КОЛОНКИ + ФОТО
   ========================================================================== */
.hero--split .hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;   /* текст и фото центрируются по своей высоте */
}
.hero__col {
  min-width: 0;   /* чтобы длинные слова не распирали колонку */
}
.hero__media {
  display: none;   /* на телефоне фото прячем — важнее текст и кнопки */
}
.hero__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;   /* шире, чем 4:3 — не так высоко по вертикали */
  max-height: 420px;       /* потолок высоты — фото не вытягивается */
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

/* Заголовок первого экрана — крупный, но с достаточным интерлиньяжем */
.hero--split h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}
.hero--split .hero__lead {
  max-width: 32ch;   /* держим лид не шире заголовка, чтобы колонка была компактной */
  font-size: 17px;
}

@media (min-width: 900px) {
  .hero--split .hero__grid {
    /* Текстовая колонка ровно под текст (max-content), фото занимает весь
       остаток ширины — тогда между текстом и фото нет зелёной полосы. */
    grid-template-columns: minmax(0, max-content) 1fr;
    gap: 32px;
    align-items: stretch;   /* фото на высоту текста, но не выше своего max-height */
  }
  .hero__media {
    display: flex;
    align-items: center;   /* фото по центру высоты текстовой колонки */
  }
  .hero--split .facts { margin-top: 40px; }
}

@media (min-width: 1200px) {
  .hero--split .hero__grid {
    grid-template-columns: minmax(0, max-content) 1fr;
    gap: 40px;
  }
  .hero--split h1 { font-size: clamp(44px, 3.6vw, 56px); }
}

/* --- Кнопка «Посчитать кубы» на первом экране: ghost вместо белой --------
   Белая кнопка спорила с оранжевой «Смотреть каталог». Делаем прозрачной
   с тонкой белой рамкой — второстепенное действие выглядит как второстепенное. */
.hero--split .btn--light {
  background: transparent;
  border-color: rgba(255,255,255,.55);
  color: var(--white);
}
.hero--split .btn--light:hover {
  background: rgba(255,255,255,.12);
  border-color: #fff;
  color: var(--white);
}

/* --- Надпись над заголовком: крупнее, жирнее, шире трекинг -------------- */
.hero--split .eyebrow {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .18em;
}

/* --- Плашка фактов: рамка вокруг каждой ячейки, цифры «смоляные» -------- */
.hero--split .facts {
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 14px;
  overflow: visible;
}
.hero--split .facts div {
  padding: 16px 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);   /* рамка вокруг каждой цифры */
  border-radius: 10px;
}
.hero--split .facts b {
  font-size: 30px;
  color: var(--resin);          /* золотисто-оранжевый — как кнопка каталога */
  letter-spacing: -.01em;
}
.hero--split .facts span {
  font-size: 13px;
  color: #fff;                  /* чисто белый вместо тусклого серого */
  opacity: .92;
}

@media (min-width: 700px) {
  .hero--split .facts b { font-size: 34px; }
}


/* ==========================================================================
   23. ГАЛЕРЕЯ «КАК МЫ РАБОТАЕМ»
   ========================================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}
.gallery__item {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
  aspect-ratio: 4 / 3;
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.gallery__item:hover img {
  transform: scale(1.04);
}
.gallery__item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 12px 9px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.68), transparent);
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .gallery__item figcaption { font-size: 14px; }
}


/* ==========================================================================
   24. ПОЛНОЭКРАННЫЙ ГЛАВНЫЙ ЭКРАН (фото-фон, текст по центру)
   ========================================================================== */
.hero-full {
  position: relative;
  min-height: 100vh;   /* на всю высоту экрана */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;   /* фон и вуаль не вылезают за секцию */
}

/* На телефоне поверх экрана всегда висят плавающая кнопка MAX (свг+52px,
   отступ снизу 78px) и полоса «Корзина / Позвонить» (56px) — вместе они
   занимают нижние ~148px viewport. Без поправки кнопки первого экрана
   при 100vh оказываются ровно под ними и визуально сталкиваются.
   Отступ убирается вместе с плавающими кнопками с 900px. */
@media (max-width: 899.98px) {
  .hero-full {
    min-height: calc(100vh - 148px - env(safe-area-inset-bottom, 0px));
    min-height: calc(100svh - 148px - env(safe-area-inset-bottom, 0px));
  }
  .hero-full__inner {
    padding: 48px 20px 28px;
  }
}
.hero-full__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-full__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
/* Затемняющая вуаль — тёмно-зелёная, держит читаемость текста.
   Снизу плотнее (градиент), чтобы кнопки и переход к factbar были чёткими. */
.hero-full__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(16,32,26,.55) 0%,
      rgba(16,32,26,.48) 45%,
      rgba(16,32,26,.78) 100%);
}
.hero-full__inner {
  width: 100%;
  max-width: 960px;   /* шире — под крупный заголовок */
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
  color: #fff;
}
.hero-full__inner .eyebrow {
  color: var(--resin);
  font-weight: 800;
  letter-spacing: .18em;
  font-size: 14px;
  /* Без тени оранжевый текст терялся на светлых участках фото (брёвна) —
     та же тень, что у заголовка и подзаголовка ниже. */
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
}
.hero-full h1 {
  color: #fff;
  font-size: clamp(44px, 8vw, 104px);   /* максимально крупно, на весь экран */
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 18px 0 22px;
  text-shadow: 0 2px 28px rgba(0,0,0,.4);
}
.hero-full__lead {
  max-width: 54ch;
  margin: 0 auto 34px;
  font-size: clamp(17px, 2.2vw, 21px);
  color: rgba(255,255,255,.94);
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.hero-full__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Ghost-кнопка на светлом фото — белая рамка, прозрачная заливка */
.btn--ghost-light {
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.75);
  color: #fff;
  backdrop-filter: blur(2px);
}
.btn--ghost-light:hover {
  background: rgba(255,255,255,.18);
  border-color: #fff;
  color: #fff;
}


/* ==========================================================================
   25. ПОЛОСА ЦЕНЫ И ФАКТОВ (под первым экраном)
   ========================================================================== */
.factbar {
  background: var(--forest);
  color: #fff;
  padding: 28px 0;
}
.factbar__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.factbar__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.factbar__price b {
  font-size: clamp(30px, 5vw, 42px);
  color: var(--resin);
  letter-spacing: -.01em;
}
.factbar__from { font-size: 18px; color: rgba(255,255,255,.75); }
.factbar__unit { font-size: 18px; color: rgba(255,255,255,.75); }

.facts--bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 0;
  background: transparent;
  border: 0;
}
.facts--bar div {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: transparent;
}
.facts--bar b {
  display: block;
  font-size: 28px;
  color: var(--resin);
  letter-spacing: -.01em;
}
.facts--bar span {
  font-size: 13px;
  color: #fff;
  opacity: .9;
}

@media (min-width: 700px) {
  .hero-full { min-height: 100vh; }
  .facts--bar { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .factbar__inner {
    flex-direction: row;
    align-items: center;
    gap: 40px;
  }
  .factbar__price { flex-shrink: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
  .facts--bar { flex: 1; }
}


/* ==========================================================================
   26. СКРЫТИЕ СТАРОЙ ПОЛОСЫ ЦЕНЫ И ФАКТОВ
   Блок убран из index.php. Это правило — подстраховка на случай, если
   на сервере ещё лежит старый index.php с этим блоком.
   ========================================================================== */
.factbar { display: none !important; }


/* ==========================================================================
   28. АДМИНКА — ОТГРУЗОЧНЫЙ ЛИСТ В СПИСКЕ ЗАЯВОК
   Разбирает строку details на позиции/сводку/доставку —
   см. parse_order_details() в admin/index.php. Не влияет на публичный сайт.
   ========================================================================== */
.pick-list { font-size: 13.5px; }
.pick-list__items { list-style: none; margin: 0 0 8px; padding: 0; }
.pick-list__items li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.pick-list__items li:last-child { border-bottom: 0; }
.pick-list__name {
  font-weight: 600;
  color: var(--forest);
  flex: 1 1 auto;
  min-width: 140px;
}
.pick-list__qty {
  color: var(--ink-soft);
  white-space: nowrap;
  font-size: 12.5px;
}
.pick-list__price {
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}
.pick-list__summary {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--forest);
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.pick-list__delivery {
  margin-top: 6px;
  font-size: 13px;
  color: var(--resin-dark);
  font-weight: 600;
}


/* ==========================================================================
   29. SEO-БЛОК НА ГЛАВНОЙ — текст + карточка фактов
   Раньше текст стоял узкой колонкой (72ch) прямо на фоне страницы и выглядел
   потерянным в пустом пространстве на широких экранах. Теперь секция на
   подложке (.section--panel), а место с боков занято не пустотой, а полезной
   карточкой с фактами — читается как единый, осмысленно свёрстанный блок.
   ========================================================================== */
.seo-block {
  display: grid;
  gap: 28px;
}
/* Базовый .prose ограничивает строку 72 символами — это верно для страниц,
   где текст идёт во всю ширину. Здесь ширину и так задаёт колонка сетки,
   поэтому лимит снимаем: иначе строки обрывались раньше края колонки
   и справа от текста висела пустая полоса. */
.seo-block__text.prose { max-width: none; }

/* Заголовки внутри блока меньше глобальных: h2 по сайту вырастает до 34px,
   и в колонке шириной ~690px он переносится на две строки — блок начинает
   выглядеть громоздким. Здесь заголовок должен помещаться в одну строку. */
.seo-block__text h2 {
  font-size: clamp(22px, 2vw, 27px);
  margin-bottom: 4px;
}
.seo-block__text h3 {
  font-size: 16.5px;
  margin-top: 1.5em;
  margin-bottom: 6px;
}
.seo-block__text p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.seo-block__facts {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  align-self: start;
}
.seo-block__fact {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.seo-block__fact:last-of-type { border-bottom: 0; }
.seo-block__fact b {
  display: block;
  font-size: 22px;
  color: var(--resin);
  letter-spacing: -.01em;
}
.seo-block__fact span {
  font-size: 13px;
  color: var(--ink-soft);
}

@media (min-width: 900px) {
  .seo-block {
    grid-template-columns: 1.45fr 1fr;
    gap: 40px;
    align-items: start;
  }
  /* Карточка следует за прокруткой, пока читается длинный текст —
     так под ней не висит пустое поле, и кнопка всегда на виду. */
  .seo-block__facts {
    position: sticky;
    top: 92px;
  }
}
.seo-block__phone {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.seo-block__phone a {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--forest);
}
