/* ==========================================================================
   gsk.center — главная / посадочная
   Токены, база, секции, квиз. Логика — assets/js: main.js (шапка, анимации,
   счётчики, моб. панель), calc.js (калькулятор), quiz.js (квиз).
   ========================================================================== */

/* ---------- Дизайн-токены (ТЗ, раздел 3) ---------- */
:root {
  /* цвета */
  --c-accent: #C03217;
  --c-accent-hover: #A62A12;
  --c-accent-tint: #FCEEEA;
  --c-dark: #2B1D6E;
  --c-dark-muted: #CFC8EE;
  --c-dark-accent: #FF8A73;
  --c-ink: #0E1630;
  --c-text-2: #3A4460;
  --c-muted: #4A5470;
  --c-line: #E3E7EF;
  --c-input-line: #CDD3E0;
  --c-surface: #F4F5F8;
  --c-white: #FFFFFF;

  /* производные (полупрозрачные) — только от токенов выше */
  --c-dark-card: rgba(255, 255, 255, .07);
  --c-dark-line: rgba(255, 255, 255, .16);
  --focus-ring: rgba(192, 50, 23, .35);
  --c-success: #1E7A3C; /* статус «заявка принята», контраст на белом 5.6:1 */

  /* типографика */
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-h1: clamp(34px, 4.4vw, 58px);
  --fs-h2: clamp(28px, 3vw, 42px);
  --fs-h3: 20px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-caption: 13px;
  --fs-stat: 44px;

  /* скругления */
  --r-input: 999px;
  --r-card: 24px;
  --r-section: 32px;
  --r-tile: 16px;

  /* отступы */
  --container: 1240px;
  --gutter: 24px;
  --section-y: 80px;
  --shadow-header: 0 6px 24px rgba(14, 22, 48, .12);
  --shadow-header-dense: 0 8px 28px rgba(14, 22, 48, .2);
  --shadow-card: 0 4px 16px rgba(14, 22, 48, .08);
  --mobile-bar-h: 72px;

  interpolate-size: allow-keywords;
}

@media (max-width: 759.98px) {
  :root {
    --gutter: 16px;
    --section-y: 56px;
    --fs-stat: 36px;
    /* заголовок первого экрана: «ковров для бизнеса» помещается в одну строку от 360 px */
    --fs-h1: clamp(28px, 8vw, 34px);
  }
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-white);
  overflow-x: clip;
}

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

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

button,
input,
select { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---------- Типографика ---------- */
/* переносы: заголовки — ровными строками, абзацы — без одинокого слова в последней строке
   (предлоги и тире приклеивает неразрывными пробелами t() в lib/render.php) */
h1, h2, h3, .h1, .h2, .h3, summary, legend, .badge, .quiz__q, .network__title { text-wrap: balance; }
p, li, dd, label, .lead { text-wrap: pretty; }

.h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.25;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--c-text-2);
}

.caption {
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.accent { color: var(--c-accent); }

/* ---------- Секции ---------- */
.section { padding-block: var(--section-y); }

/* скруглённая подложка-«панель» */
.section--surface,
.section--dark {
  margin-inline: 12px;
  border-radius: var(--r-section);
}

.section--surface { background: var(--c-surface); }

.section--dark {
  background: var(--c-dark);
  color: var(--c-white);
}

.section--dark .lead { color: var(--c-dark-muted); }

@media (max-width: 759.98px) {
  .section--surface,
  .section--dark {
    margin-inline: 6px;
    border-radius: var(--r-card);
  }
}

.section-head {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin-bottom: 40px;
}

.section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
}

@media (max-width: 759.98px) {
  .section-head { margin-bottom: 28px; }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-input);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}

.btn--lg { min-height: 56px; padding-inline: 28px; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--c-accent);
  color: var(--c-white);
}
.btn--primary:hover { background: var(--c-accent-hover); }

.btn--secondary {
  background: var(--c-white);
  border-color: var(--c-input-line);
  color: var(--c-ink);
}
.btn--secondary:hover { border-color: var(--c-ink); }

.btn--dark {
  background: var(--c-ink);
  color: var(--c-white);
}
.btn--dark:hover { background: var(--c-dark); }

.btn__icon { width: 20px; height: 20px; flex: none; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: var(--r-input);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-text-2);
}

.badge--tint {
  background: var(--c-accent-tint);
  border-color: transparent;
  color: var(--c-accent);
}

.badge-sale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--r-input);
  background: var(--c-accent);
  color: var(--c-white);
  font-weight: 800;
  font-size: var(--fs-small);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ---------- Поля форм ---------- */
.field { display: grid; gap: 8px; }

.field__label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-text-2);
}

.input {
  width: 100%;
  min-height: 56px;
  padding: 14px 22px;
  border: 1px solid var(--c-input-line);
  border-radius: var(--r-input);
  background: var(--c-white);
  font-size: var(--fs-body);
  color: var(--c-ink);
}

.input::placeholder { color: var(--c-muted); }

.input:focus-visible {
  border-color: var(--c-accent);
  outline-offset: 0;
}

select.input {
  appearance: none;
  padding-right: 52px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1.5l6 6 6-6' stroke='%230E1630' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
}

/* галочка согласия на обработку ПД (templates/partials/common.php) */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--c-muted);
  cursor: pointer;
}

.consent a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 2px; }
.consent a:hover { color: var(--c-accent); }

.consent__box {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.consent.is-invalid { color: var(--c-accent); }
.consent.is-invalid .consent__box { outline: 2px solid var(--c-accent); outline-offset: 1px; }

/* ошибка в поле телефона и статус отправки (forms.js) */
.input.is-invalid { border-color: var(--c-accent); }

.form-status {
  margin-top: 10px;
  font-size: var(--fs-small);
  font-weight: 600;
}

.form-status--ok { color: var(--c-success); }
.form-status--error { color: var(--c-accent); }
.form-status a { color: inherit; white-space: nowrap; }

/* сообщение после отправки без JS: /?sent=1#sent → :target */
.notice {
  position: fixed;
  top: 88px;
  left: 50%;
  z-index: 60;
  display: none;
  width: min(560px, 100% - 32px);
  padding: 16px 20px;
  border-radius: var(--r-tile);
  background: var(--c-white);
  box-shadow: var(--shadow-header-dense);
  font-weight: 600;
  transform: translateX(-50%);
}

.notice:target { display: block; }
.notice--ok { border-left: 4px solid var(--c-success); }
.notice--error { border-left: 4px solid var(--c-accent); }
.notice a { color: var(--c-accent); }

/* honeypot: скрыт визуально, но не display:none (ТЗ, раздел 7) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   1. Шапка-«таблетка»
   ========================================================================== */
.header {
  position: sticky;
  top: 12px;
  z-index: 50;
  padding-inline: 12px;
  margin-top: 12px;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--container);
  margin-inline: auto;
  padding: 8px 8px 8px 24px;
  border-radius: var(--r-input);
  background: var(--c-white);
  box-shadow: var(--shadow-header);
  transition: padding .3s, box-shadow .3s;
}

.header__logo { flex: none; }

.header__logo img {
  width: auto;
  height: 46px;
  transition: height .3s;
}

/* сжатое состояние — класс ставит main.js */
.header.is-compact .header__inner {
  padding-block: 4px;
  box-shadow: var(--shadow-header-dense);
}
.header.is-compact .header__logo img { height: 40px; }

/* через 25 с на странице — один «пульс» тенью (main.js) */
.header__cta.is-pulse { animation: cta-pulse 1.2s ease-out 1; }

@keyframes cta-pulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 50, 23, .55); }
  100% { box-shadow: 0 0 0 16px rgba(192, 50, 23, 0); }
}

.header__nav { margin-inline: auto; }

/* обычный межсловный пробел между «Рассчитать» и «стоимость» */
.header__cta { gap: .3em; }

.header__menu {
  display: flex;
  gap: 4px;
}

.header__menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: var(--r-input);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--c-text-2);
  white-space: nowrap;
  transition: color .2s, background-color .2s;
}

.header__menu a:hover {
  color: var(--c-ink);
  background: var(--c-surface);
}

.header__contact {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}

.header__phone {
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.header__email {
  font-size: 15px;
  color: var(--c-muted);
  text-decoration: none;
}

.header__email:hover { color: var(--c-accent); }

/* зона нажатия телефона и почты выше самой строки — по ним проще попасть пальцем */
.header__phone,
.header__email { padding-block: 4px; margin-block: -4px; }

/* до 1200: почта в шапке шире «Круглосуточно» — ужимаем меню, чтобы пункты не переносились */
@media (max-width: 1199.98px) {
  .header__inner { gap: 12px; padding-left: 16px; }
  .header__menu a { padding-inline: 8px; font-size: 14px; }
  .header__cta { padding-inline: 18px; }
}

/* планшет: на узкой части диапазона места на всё не хватает */
@media (min-width: 760px) and (max-width: 979.98px) {
  .header__inner { gap: 8px; }
  .header__logo img { height: 40px; }
  .header__menu { gap: 0; }
  .header__menu a { padding-inline: 6px; }
  .header__email { display: none; }
  .header__phone { font-size: 15px; }
  .header__cta-long { display: none; }
}

/* 760–880: кнопка не помещается рядом с меню и телефоном; расчёт доступен в hero и ниже */
@media (min-width: 760px) and (max-width: 879.98px) {
  .header__cta { display: none; }
  .header__inner { padding-right: 20px; }
}

@media (max-width: 759.98px) {
  .header { top: 8px; margin-top: 8px; padding-inline: 8px; }
  .header__inner { padding: 6px 6px 6px 16px; justify-content: space-between; }
  .header__logo img { height: 40px; }
  .header__nav,
  .header__cta { display: none; }
  .header__phone { font-size: 16px; }
}

/* ==========================================================================
   2. Hero
   ========================================================================== */
.hero {
  margin-top: -40px; /* подложка заходит под шапку */
  padding-top: calc(var(--section-y) + 40px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.hero__content {
  display: grid;
  gap: 24px;
  justify-items: start;
}

.hero .lead { font-size: 19px; max-width: 560px; }

.promo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px 8px 8px;
  border-radius: var(--r-tile);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  font-weight: 600;
}

.promo__value {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.promo__text { display: grid; gap: 2px; }
.promo__cond { font-size: var(--fs-caption); font-weight: 500; color: var(--c-muted); }

.lead-form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 560px;
}

.lead-form__label {
  font-weight: 600;
  color: var(--c-ink);
}

.lead-form__row {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--c-input-line);
  border-radius: var(--r-input);
  background: var(--c-white);
}

.lead-form__row:focus-within { border-color: var(--c-accent); }

.lead-form__row .input {
  min-height: 48px;
  border: 0;
  padding-inline: 16px;
}

.lead-form__row .input:focus-visible { outline: none; }

.lead-form__alt {
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.lead-form__alt a { font-weight: 600; color: var(--c-ink); }

/* иконки мессенджеров (lib/render.php → messenger_links); здесь, а не ниже — первый экран без скачков */
.msg-icon { flex: none; width: 20px; height: 20px; }

/* мессенджеры строчными ссылками: первый экран, подвал, квиз */
.msg-link { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.msg-link .msg-icon { width: 16px; height: 16px; }

.hero__media {
  position: relative;
  margin: 0;
}

.hero__img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  object-position: 70% 50%;
  border-radius: var(--r-card);
}

/* параллакс: main.js пишет --parallax (≤ 20px), запас по краям даёт scale */
@media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
  .js .hero__media {
    overflow: hidden;
    border-radius: var(--r-card);
  }
  .js .hero__img {
    transform: translate3d(0, var(--parallax, 0px), 0) scale(1.1);
    will-change: transform;
  }
}

.hero__chips {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--r-input);
  background: var(--c-white);
  box-shadow: var(--shadow-card);
  font-size: var(--fs-small);
  font-weight: 600;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
}

@media (max-width: 1099.98px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__content { max-width: 680px; }
}

@media (max-width: 759.98px) {
  .hero { margin-top: -32px; padding-top: calc(var(--section-y) + 16px); }
  .hero__content { gap: 18px; }
  .hero .lead { font-size: 17px; }
  .lead-form__row {
    flex-direction: column;
    padding: 0;
    border: 0;
    background: none;
  }
  .lead-form__row .input {
    min-height: 56px;
    border: 1px solid var(--c-input-line);
    padding-inline: 22px;
  }
  .lead-form__row .input:focus-visible { outline: 3px solid var(--focus-ring); }
  .lead-form__row .btn { min-height: 56px; }
  .hero__img { height: 260px; }
  .hero__chips { left: 10px; right: 10px; bottom: 10px; gap: 6px; }
  .chip { min-height: 32px; padding: 6px 12px; font-size: var(--fs-caption); }
}

/* ==========================================================================
   3. Цифры компании
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
}

.stats__item {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 20px;
  border-top: 2px solid var(--c-ink);
}

.stats__num {
  font-size: var(--fs-stat);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}

.stats__text { color: var(--c-text-2); }

@media (max-width: 759.98px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .stats__text { font-size: var(--fs-small); }
}

/* ==========================================================================
   4. Логотипы клиентов
   ========================================================================== */
.clients { padding-top: 0; }

.clients__label { margin-bottom: 20px; }

.clients__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.clients__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  padding: 10px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-tile);
  background: var(--c-white);
}

.clients__tile img {
  width: auto;
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

@media (hover: hover) {
  .clients__tile img {
    filter: grayscale(1);
    opacity: .75;
    transition: filter .3s, opacity .3s;
  }
  .clients__tile:hover img {
    filter: none;
    opacity: 1;
  }
}

@media (max-width: 759.98px) {
  .clients__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .clients__tile { height: 72px; padding: 6px; }
  .clients__tile img { max-height: 56px; }
}

/* ==========================================================================
   Общие карточки
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
}

.card__text { color: var(--c-text-2); }

@media (max-width: 759.98px) {
  .cards { gap: 12px; }
  .card { padding: 22px; }
}

/* ==========================================================================
   5. Для каких объектов
   ========================================================================== */
.segment {
  position: relative;
  height: 100%; /* карточки в ряду одной высоты — кнопки «Расчёт со скидкой» на одном уровне */
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow .25s, transform .25s;
}

.segment:hover { box-shadow: var(--shadow-card); }

/* ссылка на статью в заголовке растянута на всю карточку; кнопка квиза лежит поверх */
.segment__link { color: inherit; text-decoration: none; }
.segment__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.segment:hover .segment__link { color: var(--c-accent); }

/* от планшета все карточки «Для каких объектов» одной высоты — по самой высокой, во всех рядах;
   на мобиле карточки идут столбиком, там одинаковая высота дала бы только пустоты */
@media (min-width: 760px) {
  #segments .cards { grid-auto-rows: 1fr; }
}

.segment__img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.segment__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 24px;
}

.segment__more {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 6px;
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
}

.segment__more:hover { text-decoration: underline; }

/* ==========================================================================
   6. Как мы работаем
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  counter-reset: step;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}

.num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-white);
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.num--outline {
  background: var(--c-white);
  color: var(--c-ink);
  border: 2px solid var(--c-ink);
}

.step__text { color: var(--c-text-2); font-size: 15px; }

/* ==========================================================================
   7. Цены + калькулятор
   ========================================================================== */
.prices__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.price {
  display: grid;
  gap: 6px;
  padding: 22px 24px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
}

.price__size {
  font-weight: 700;
  color: var(--c-text-2);
}

.price__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.price__note {
  font-size: var(--fs-small);
  color: var(--c-muted);
}

@media (max-width: 759.98px) {
  .prices__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .price { padding: 16px 14px; }
  .price__value { font-size: 22px; white-space: nowrap; }
  .price__note { font-size: 12px; line-height: 1.35; }
}

/* плашка «Сеть» */
.network {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 20px;
  padding: 24px 28px;
  border-radius: var(--r-card);
  background: var(--c-accent-tint);
}

.network__text { display: grid; gap: 2px; }
.network__title { font-size: var(--fs-h3); font-weight: 700; }
.network__sub { color: var(--c-text-2); }

/* --- калькулятор --- */
.calc {
  margin-top: 56px;
  padding: 40px;
  border-radius: var(--r-section);
  background: var(--c-surface);
  scroll-margin-top: 100px;
}

.calc__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.calc__intro { display: grid; gap: 8px; }
.calc__intro p { color: var(--c-text-2); }

.calc__note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--r-card);
  background: var(--c-white);
  font-size: var(--fs-small);
  color: var(--c-text-2);
}

/* мобила: бейдж над текстом — иначе текст зажат в узкую колонку */
@media (max-width: 759.98px) {
  .calc__note { flex-direction: column; gap: 10px; padding: 16px; }
}

.calc__note .badge-sale { flex: none; }
.calc__note strong { color: var(--c-ink); }

.calc__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: start;
}

.calc__config { display: grid; gap: 28px; }

.calc__group { display: grid; gap: 12px; }

.calc__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.calc__tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc__tile {
  display: grid;
  gap: 2px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-tile);
  background: var(--c-white);
  text-align: left;
  transition: border-color .2s, background-color .2s;
}

.calc__tile:hover { border-color: var(--c-input-line); }

.calc__tile-size {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.calc__tile-price {
  font-size: var(--fs-caption);
  color: var(--c-muted);
}

.calc__tile--active,
.calc__tile[aria-pressed="true"] {
  border-color: var(--c-accent);
  background: var(--c-accent-tint);
}

.calc__tile[aria-pressed="true"] .calc__tile-price { color: var(--c-accent); }

.calc__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--c-input-line);
  border-radius: var(--r-input);
  background: var(--c-white);
  font-weight: 600;
  font-size: 15px;
  transition: border-color .2s, background-color .2s, color .2s;
}

.pill:hover { border-color: var(--c-ink); }

.pill[aria-pressed="true"] {
  border-color: var(--c-accent);
  background: var(--c-accent);
  color: var(--c-white);
}

.calc__hint {
  font-size: var(--fs-small);
  color: var(--c-muted);
}

/* иконка «i» с подсказкой: hover + фокус (тап) */
.tip {
  position: relative;
  display: inline-flex;
}

.tip__btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -12px -10px;
  border: 0;
  background: none;
  padding: 0;
}

.tip__btn::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--c-muted);
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
}

.tip__bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 12px 14px;
  border-radius: var(--r-tile);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-small);
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity .2s, transform .2s, visibility .2s;
  pointer-events: none;
}

/* hover — только у мыши (на тач-экранах :hover «залипает»); тап — .is-open из main.js, без JS — :focus */
@media (hover: hover) {
  .tip:hover .tip__bubble {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

.tip__btn:focus-visible + .tip__bubble,
html:not(.js) .tip__btn:focus + .tip__bubble,
.tip.is-open .tip__bubble {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (max-width: 759.98px) {
  .tip__bubble { left: 0; transform: translate(-30%, 4px); }
  .tip__btn:focus-visible + .tip__bubble,
  html:not(.js) .tip__btn:focus + .tip__bubble,
  .tip.is-open .tip__bubble { transform: translate(-30%, 0); }
}

/* степпер */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  padding: 4px;
  border: 1px solid var(--c-input-line);
  border-radius: var(--r-input);
  background: var(--c-white);
}

.stepper__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--c-surface);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.stepper__btn:hover { background: var(--c-line); }

.stepper__btn:disabled {
  color: var(--c-input-line);
  background: var(--c-surface);
  cursor: default;
}

.stepper__value {
  min-width: 48px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.calc__add {
  justify-self: start;
  min-height: 48px;
  padding: 10px 22px;
  border: 1.5px dashed var(--c-input-line);
  border-radius: var(--r-input);
  background: none;
  font-weight: 600;
  color: var(--c-text-2);
  transition: border-color .2s, color .2s;
}

.calc__add:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* «Ваш набор» */
.calc__set {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--r-card);
  background: var(--c-white);
}

.calc__items { display: grid; gap: 8px; }

.calc__item {
  position: relative;
  border: 1px solid var(--c-line);
  border-radius: var(--r-tile);
}

/* вся позиция — кнопка «сделать редактируемой» */
.calc__item-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  padding: 14px 52px 14px 16px;
  border: 0;
  border-radius: inherit;
  background: none;
  text-align: left;
}

.calc__item:not(.calc__item--editing):hover { border-color: var(--c-input-line); }

.calc__item--editing {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent);
}

.calc__item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.calc__item-meta {
  grid-column: 1;
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.calc__item-sum {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc__item-badge {
  padding: 2px 8px;
  border-radius: var(--r-input);
  background: var(--c-accent-tint);
  color: var(--c-accent);
  font-size: 12px;
  font-weight: 600;
}

.calc__item-remove {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--c-muted);
  transform: translateY(-50%);
}

.calc__item-remove:hover { color: var(--c-accent); }

/* итоговая полоса */
.calc__total {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 24px;
  padding: 22px 28px;
  border-radius: var(--r-card);
  background: var(--c-dark);
  color: var(--c-white);
}

.calc__total-info { display: grid; gap: 4px; }

.calc__total-label {
  font-size: var(--fs-small);
  color: var(--c-dark-muted);
}

.calc__total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.calc__sum {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.calc__total-row .badge-sale { align-self: center; }

/* бейдж −50% «прыгает» при переходе через 5 000 ₽ (класс ставит calc.js) */
.calc__total-row .badge-sale.is-pop {
  animation: calc-pop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}

@keyframes calc-pop {
  from { opacity: 0; transform: scale(.3); }
  to { opacity: 1; transform: scale(1); }
}

/* зачёркнутая цена: линия рисуется через background-size */
.calc__old.is-strike { animation: calc-strike .45s ease-out both; }

@keyframes calc-strike {
  from { background-size: 0 2px; }
  to { background-size: 100% 2px; }
}

.calc__old {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-dark-muted);
  background: linear-gradient(var(--c-dark-accent), var(--c-dark-accent)) no-repeat 0 55% / 100% 2px;
  font-variant-numeric: tabular-nums;
}

.calc__total-sub {
  font-size: var(--fs-small);
  color: var(--c-dark-muted);
}

/* «Расчёт ориентировочный…» — отдельной строкой во всю ширину итога */
.calc__disclaimer {
  flex-basis: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--c-dark-line);
  font-size: var(--fs-caption);
  color: var(--c-dark-muted);
}

.calc__progress {
  width: min(100%, 360px);
  height: 8px;
  border-radius: var(--r-input);
  background: var(--c-dark-line);
  overflow: hidden;
}

.calc__progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--c-dark-accent);
  transition: width .45s;
}

@media (max-width: 1099.98px) {
  .calc__head,
  .calc__body { grid-template-columns: 1fr; }
}

@media (max-width: 759.98px) {
  .calc { margin-top: 40px; padding: 20px 14px; border-radius: var(--r-card); }
  .calc__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .calc__set { padding: 16px; }
  /* на мобиле полоса компактная, чтобы не закрывать настройки калькулятора */
  .calc__total {
    bottom: calc(var(--mobile-bar-h) + 6px);
    gap: 10px;
    margin-inline: -6px;
    padding: 12px 14px;
    border-radius: var(--r-tile);
  }
  .calc__total-info { gap: 2px; }
  .calc__disclaimer { padding-top: 6px; font-size: 12px; line-height: 1.35; }
  .calc__total-label,
  .calc__total-sub { font-size: 12px; line-height: 1.35; }
  .calc__total-row { gap: 4px 10px; }
  .calc__sum { font-size: 26px; }
  .calc__old { font-size: 16px; }
  .calc__total .btn { width: 100%; min-height: 44px; padding-block: 8px; }
}

/* ==========================================================================
   8. Ковры нужны круглый год (тёмная)
   ========================================================================== */
.seasons__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.seasons__content { display: grid; gap: 20px; }

.seasons .h2 em {
  font-style: normal;
  color: var(--c-dark-accent);
}

.seasons__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.season {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--c-dark-line);
  border-radius: var(--r-card);
  background: var(--c-dark-card);
}

.season__name {
  font-size: var(--fs-caption);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-dark-accent);
}

.season__text { color: var(--c-white); }

.seasons__media { position: relative; margin: 0; }

.seasons__img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: var(--r-card);
}

.seasons__card {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 4px;
  max-width: 360px;
  padding: 18px 22px;
  border-radius: var(--r-tile);
  background: var(--c-white);
  color: var(--c-ink);
  box-shadow: var(--shadow-card);
}

.seasons__card p { color: var(--c-text-2); font-size: 15px; }

@media (max-width: 1099.98px) {
  .seasons__grid { grid-template-columns: 1fr; gap: 32px; }
  .seasons__img { height: 360px; }
}

@media (max-width: 759.98px) {
  .seasons__cards { gap: 8px; }
  .season { padding: 16px; }
  .season__text { font-size: 15px; }
  .seasons__img { height: 280px; }
  .seasons__card { left: 12px; right: 12px; bottom: 12px; padding: 14px 16px; }
}

/* ==========================================================================
   9. Аренда или покупка
   ========================================================================== */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

.compare__card {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 32px;
  border-radius: var(--r-card);
}

.compare__card--own { background: var(--c-surface); }

.compare__card--rent {
  background: var(--c-white);
  border: 2px solid var(--c-accent);
}

.checklist { display: grid; gap: 14px; }

.checklist li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.checklist__icon {
  width: 24px;
  height: 24px;
  margin-top: 0;
}

.checklist--muted li { color: var(--c-text-2); }
.checklist--muted .checklist__icon { color: var(--c-muted); }
.checklist--accent .checklist__icon { color: var(--c-accent); }
.checklist--dark .checklist__icon { color: var(--c-dark-accent); }

@media (max-width: 759.98px) {
  .compare__card { padding: 22px; }
}

/* ==========================================================================
   10. 3 уровня грязезащиты
   ========================================================================== */
.levels__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
}

.levels__img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--r-card);
}

.levels__content { display: grid; gap: 20px; }

.levels__list { display: grid; gap: 12px; margin-top: 8px; }

.level {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
}

.level__body { display: grid; gap: 4px; }
.level__text { color: var(--c-text-2); }

.level--main {
  border: 2px solid var(--c-accent);
}

@media (max-width: 1099.98px) {
  .levels__grid { grid-template-columns: 1fr; gap: 32px; }
  .levels__img { min-height: 0; height: 320px; }
}

@media (max-width: 759.98px) {
  .levels__img { height: 240px; }
  .level { padding: 16px; gap: 12px; }
}

/* ==========================================================================
   11. Без посредников
   ========================================================================== */
.feature__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: var(--r-tile);
  background: var(--c-accent-tint);
  color: var(--c-accent);
}

.feature__icon svg { width: 26px; height: 26px; }

/* ==========================================================================
   12. Кейсы (секция скрыта до получения данных)
   ========================================================================== */
.case__type { margin-bottom: -4px; }

.case__client { margin-bottom: 6px; }

.case__row {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
}

.case__row dt {
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.case__row dd { margin: 0; color: var(--c-text-2); }

/* ==========================================================================
   13. Для бухгалтерии и закупок
   ========================================================================== */
.docs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
}

.docs__text { display: grid; gap: 12px; max-width: 640px; }

.docs__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   14. FAQ
   ========================================================================== */
.faq__list {
  display: grid;
  gap: 10px;
  max-width: 900px;
}

.faq__item {
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-white);
  transition: border-color .2s;
}

.faq__item[open] { border-color: var(--c-input-line); }

.faq__q {
  position: relative;
  display: block;
  min-height: 44px;
  padding: 22px 72px 22px 28px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker { display: none; }

/* плюс → крестик */
.faq__q::before,
.faq__q::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 30px;
  width: 16px;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: var(--c-accent);
  transition: transform .3s;
}

.faq__q::after { transform: rotate(90deg); }
.faq__item[open] .faq__q::after { transform: rotate(0deg); }

.faq__a {
  padding: 0 28px 24px;
  color: var(--c-text-2);
}

/* плавное раскрытие: interpolate-size + ::details-content; где не поддерживается — мгновенно */
.faq__item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .35s ease, content-visibility .35s allow-discrete;
}

.faq__item[open]::details-content { block-size: auto; }

@media (max-width: 759.98px) {
  .faq__q { padding: 18px 56px 18px 20px; font-size: 16px; }
  .faq__q::before,
  .faq__q::after { right: 22px; }
  .faq__a { padding: 0 20px 20px; }
}

/* ==========================================================================
   15. Финальная форма (тёмная)
   ========================================================================== */
.final__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.final__content { display: grid; gap: 20px; }

.final__phone {
  justify-self: start;
  margin-top: 8px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  color: var(--c-white);
}

.final__phone-note {
  margin-top: -14px;
  color: var(--c-dark-muted);
  font-size: var(--fs-small);
}

.form-card {
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-card);
  background: var(--c-white);
  color: var(--c-ink);
}

/* кнопки мессенджеров: две — пополам, одна — во всю ширину */
.messengers { display: flex; gap: 8px; }
.messengers > * { flex: 1 1 0; min-width: 0; padding-inline: 12px; }

.footer__msg,
.quiz__msg { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.quiz__msg { margin-top: 6px; }
.quiz__msg a { font-weight: 600; color: var(--c-ink); }

@media (max-width: 1099.98px) {
  .final__grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 759.98px) {
  .form-card { padding: 20px; }
}

/* ==========================================================================
   16. Подвал
   ========================================================================== */
.footer {
  padding-block: 56px 40px;
  font-size: var(--fs-small);
  color: var(--c-text-2);
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
}

.footer__col { display: grid; gap: 8px; align-content: start; }

.footer__logo img { width: auto; height: 46px; }

.footer__phone {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ink);
  text-decoration: none;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: var(--fs-caption);
}

.footer a { color: inherit; }

@media (max-width: 759.98px) {
  .footer { padding-bottom: 96px; }
  .footer__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   Мобильная нижняя панель (< 760px)
   ========================================================================== */
.mobile-bar { display: none; }

@media (max-width: 759.98px) {
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--c-white);
    box-shadow: 0 -6px 24px rgba(14, 22, 48, .12);
    transition: transform .3s;
  }
  /* с JS панель прячется до прокрутки за hero (класс .is-visible ставит main.js) */
  .js .mobile-bar:not(.is-visible) { transform: translateY(110%); }
}

/* ==========================================================================
   Квиз-попап (<dialog>, quiz.js)
   ========================================================================== */
html.is-locked { overflow: hidden; }

.quiz {
  width: min(880px, 100% - 32px);
  max-width: none;
  max-height: min(720px, 100% - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--r-card);
  background: var(--c-white);
  color: var(--c-ink);
  box-shadow: 0 24px 64px rgba(14, 22, 48, .3);
  overflow: hidden;
}

.quiz::backdrop { background: rgba(14, 22, 48, .55); }

.quiz[open] { animation: quiz-in .3s ease-out; }

@keyframes quiz-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.quiz__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  max-height: inherit;
}

.quiz__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 520px;
  padding: 28px 32px 32px;
  overflow-y: auto;
  overflow-x: hidden;
}

.quiz__top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quiz__progress { flex: 1; display: grid; gap: 8px; }

.quiz__progress-text {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.quiz__bar {
  display: block;
  height: 6px;
  border-radius: var(--r-input);
  background: var(--c-surface);
  overflow: hidden;
}

.quiz__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c-accent);
  transition: width .4s;
}

.quiz__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--c-surface);
}

.quiz__close:hover { background: var(--c-line); }

.quiz__step { display: grid; gap: 20px; align-content: start; }

/* вопрос въезжает справа (вперёд) или слева (назад) */
.quiz__step.is-next { animation: quiz-next .32s ease-out; }
.quiz__step.is-prev { animation: quiz-prev .32s ease-out; }

@keyframes quiz-next {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes quiz-prev {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: none; }
}

.quiz__q {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.quiz__q:focus { outline: none; }

.quiz__text { color: var(--c-text-2); }

/* окно открыто из калькулятора: вопросов нет — шкалу прогресса не показываем */
.quiz.is-direct .quiz__progress { visibility: hidden; }

/* состав набора, когда окно открыто из калькулятора */
.quiz__calc {
  padding: 12px 16px;
  border-radius: var(--r-tile);
  background: var(--c-surface);
  font-size: var(--fs-small);
  line-height: 1.5;
  white-space: pre-line;
}

.quiz__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quiz__option {
  min-height: 56px;
  padding: 12px 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-tile);
  background: var(--c-white);
  font-weight: 600;
  text-align: left;
  transition: border-color .2s, background-color .2s;
}

.quiz__option:hover { border-color: var(--c-input-line); background: var(--c-surface); }

.quiz__option[aria-pressed="true"] {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent);
  background: var(--c-accent-tint);
}

.quiz__fields { display: grid; gap: 16px; }

.quiz__methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz__methods legend { width: 100%; margin-bottom: 8px; padding: 0; }

.quiz__method { position: relative; }

.quiz__method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz__method span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--c-input-line);
  border-radius: var(--r-input);
  font-weight: 600;
  cursor: pointer;
}

.quiz__method input:checked + span {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-white);
}

.quiz__method input:focus-visible + span {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.quiz__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.quiz__next { margin-left: auto; padding-inline: 28px; }

.quiz__back {
  padding: 10px 0;
  border: 0;
  background: none;
  font-weight: 600;
  color: var(--c-muted);
}

.quiz__back:hover { color: var(--c-ink); }

/* успех: кружок «прыгает», затем рисуется галочка */
.quiz__success { justify-items: start; }

.quiz__check-circle { fill: var(--c-accent-tint); }

.quiz__check-mark {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.quiz__success.is-shown .quiz__check { animation: calc-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.quiz__success.is-shown .quiz__check-mark { animation: quiz-check .4s .35s ease-out forwards; }

@keyframes quiz-check { to { stroke-dashoffset: 0; } }

.quiz__success .quiz__text a { font-weight: 700; color: var(--c-ink); white-space: nowrap; }

/* правая серая колонка */
.quiz__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  background: var(--c-surface);
  overflow-y: auto;
}

.quiz__logo img { width: auto; height: 40px; }

.quiz__card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: var(--r-tile);
  background: var(--c-white);
}

.quiz__card-label {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--c-accent);
}

.quiz__card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.3;
}

.quiz__card-text {
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.quiz__contacts {
  display: grid;
  gap: 2px;
  margin-top: auto;
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.quiz__phone {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-ink);
  text-decoration: none;
}

/* мобила: на весь экран, колонка уходит под вопросы и сворачивается до строки с бонусом */
@media (max-width: 759.98px) {
  .quiz {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .quiz__layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
  }
  .quiz__main {
    min-height: 0;
    gap: 20px;
    padding: 16px 16px 20px;
  }
  .quiz__options { grid-template-columns: 1fr; gap: 8px; }
  .quiz__option { min-height: 52px; }
  .quiz__aside {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .quiz__aside > :not(.quiz__card--bonus) { display: none; }
  .quiz__card--bonus {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    background: none;
    min-width: 0;
  }
  .quiz__card--bonus .quiz__card-label { flex: none; }
  /* бонус целиком, без многоточия: на узких экранах переносится на вторую строку */
  .quiz__card--bonus .quiz__card-title {
    display: block;
    min-width: 0;
    font-size: var(--fs-small);
  }
  .quiz__card--bonus .quiz__card-text { display: none; }
}

/* ==========================================================================
   Страница согласия
   ========================================================================== */
.legal {
  max-width: 860px;
  padding-block: 48px var(--section-y);
}

.legal .h1 { font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 28px; }

.legal p,
.legal li { margin-bottom: 10px; color: var(--c-text-2); }

.legal h2 { margin: 28px 0 12px; font-size: var(--fs-h3); line-height: 1.3; }

.legal ul { padding-left: 20px; list-style: disc; }

/* ==========================================================================
   6а. Наши ковры — карусель фото с объектов
   ========================================================================== */
.gallery__head { align-items: flex-end; }
.gallery__intro { display: grid; gap: 16px; max-width: 760px; }

.carousel__nav { display: flex; gap: 8px; }

.carousel__btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--c-input-line);
  border-radius: 50%;
  background: var(--c-white);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transition: border-color .2s, color .2s, opacity .2s;
}

.carousel__btn:hover:not(:disabled) { border-color: var(--c-accent); color: var(--c-accent); }
.carousel__btn:disabled { opacity: .35; cursor: default; }

/* лента одной высоты: фото разной ориентации без обрезки, следующий кадр выглядывает справа */
.carousel__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--r-tile);
}

.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline-offset: 4px; }

.carousel__slide {
  flex: none;
  scroll-snap-align: start;
}

.carousel__img {
  width: auto;
  max-width: none;
  height: 420px;
  border-radius: var(--r-tile);
  background: var(--c-line);
}

@media (max-width: 759.98px) {
  .carousel__nav { display: none; }
  .carousel__track {
    gap: 10px;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    border-radius: 0;
    align-items: center;
  }
  /* горизонтальные фото не шире 82% экрана — следующий кадр всегда выглядывает, видно, что ленту листают */
  .carousel__img {
    height: auto;
    max-height: 320px;
    max-width: 82vw;
  }
}

/* ==========================================================================
   Отраслевые статьи (templates/article.php)
   ========================================================================== */
.article-hero {
  margin-top: -40px; /* подложка заходит под шапку, как у первого экрана главной */
  padding-top: calc(48px + 40px);
  padding-bottom: 48px;
}

.article-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.article-hero__content { display: grid; gap: 24px; }

.article-hero__title { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.1; }

.article-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.article-hero__img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--r-card);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.crumbs a { color: inherit; }
.crumbs a:hover { color: var(--c-accent); }
.crumbs [aria-current] { color: var(--c-ink); font-weight: 600; }

.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 56px;
  padding-block: 56px var(--section-y);
}

/* текст статьи: строка ~70 знаков, отступы между блоками */
.prose { max-width: 760px; font-size: 17px; line-height: 1.65; color: var(--c-text-2); }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 44px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; line-height: 1.2; color: var(--c-ink); }
.prose h3 { margin-top: 28px; font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; color: var(--c-ink); }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 600; color: var(--c-ink); }
.prose > ul,
.prose > ol { display: grid; gap: 10px; padding-left: 24px; }
.prose > ul { list-style: disc; }
.prose > ol { list-style: decimal; }
.prose > :is(ul, ol) > li::marker { color: var(--c-accent); font-weight: 700; }

.article__photos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-block: 32px; }
.article__photos .carousel__nav { justify-content: flex-end; order: 2; }
.article__photos .carousel__img { height: 340px; }

.article__aside { position: sticky; top: 120px; }

.article__cta {
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}

.article__cta-text { color: var(--c-text-2); }

.article__cta-phone {
  justify-self: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-ink);
  text-decoration: none;
}

.related { padding-top: 0; }
.related .h2 { margin-bottom: 28px; }

.related__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.related__card {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 12px 12px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  color: var(--c-ink);
  text-decoration: none;
  transition: box-shadow .25s;
}

.related__card:hover { box-shadow: var(--shadow-card); }
.related__card picture { display: contents; } /* сетка карточки раскладывает само фото */
.related__img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--r-tile); margin-bottom: 6px; }
.related__label { padding-inline: 8px; font-size: var(--fs-caption); font-weight: 600; color: var(--c-accent); }
.related__title { padding-inline: 8px; font-weight: 600; line-height: 1.35; }

@media (max-width: 1099.98px) {
  .article { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .article__aside { position: static; }
  .article__cta { max-width: 760px; }
}

@media (max-width: 759.98px) {
  .article-hero { padding-top: calc(28px + 40px); padding-bottom: 28px; }
  .article-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-hero__title { font-size: clamp(26px, 7.4vw, 32px); }
  .article-hero__actions .btn { width: 100%; }
  .article-hero__img { height: 220px; }
  .article { padding-top: 36px; }
  .prose { font-size: 16px; }
  .prose h2 { margin-top: 36px; }
  .article__photos .carousel__img { height: auto; max-height: 260px; }
  .article__cta { padding: 22px; }
  /* на мобиле другие статьи — компактный список: фото слева, текст справа */
  .related__list { gap: 10px; }
  .related__card { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 10px; border-radius: var(--r-tile); }
  .related__img { grid-column: 1; grid-row: 1 / span 2; align-self: center; height: 72px; margin: 0; border-radius: 12px; }
  .related__label,
  .related__title { grid-column: 2; padding-inline: 0; }
  .related__label { grid-column: 2; align-self: end; }
  .related__title { align-self: start; font-size: 15px; }
}

/* ==========================================================================
   Страница 404 (templates/notfound.php)
   ========================================================================== */
.notfound { display: grid; justify-items: start; gap: 20px; padding-block: 64px var(--section-y); }
.notfound__code { font-size: clamp(72px, 12vw, 140px); font-weight: 800; line-height: 1; color: var(--c-accent); }
.notfound .lead { max-width: 640px; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.notfound__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.notfound__links a { color: var(--c-ink); font-weight: 600; }
.notfound__links a:hover { color: var(--c-accent); }

@media (max-width: 759.98px) {
  .notfound { padding-top: 40px; }
  .notfound__actions .btn { width: 100%; }
}

/* ==========================================================================
   Плашка о cookie (main.js снимает hidden, пока не нажали «Понятно»)
   ========================================================================== */
.cookie {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(480px, 100% - 40px);
  padding: 16px 16px 16px 20px;
  border-radius: var(--r-card);
  background: var(--c-white);
  box-shadow: var(--shadow-header-dense);
  animation: cookie-in .35s ease-out;
  transition: opacity .25s, transform .25s;
}

.cookie__text {
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--c-text-2);
}

.cookie__text a { color: var(--c-ink); font-weight: 600; }

.cookie__btn { flex: none; min-height: 44px; padding: 10px 20px; }

.cookie.is-hiding { opacity: 0; transform: translateY(12px); }

@keyframes cookie-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* мобила: над нижней панелью «Позвонить / Расчёт», во всю ширину */
@media (max-width: 759.98px) {
  .cookie {
    left: 8px;
    right: 8px;
    bottom: calc(var(--mobile-bar-h) + 8px + env(safe-area-inset-bottom));
    width: auto;
    padding: 12px 12px 12px 16px;
    border-radius: var(--r-tile);
  }
}

/* ==========================================================================
   Появление при скролле: .reveal прячется только при JS (класс .js на <html>)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease-out, transform .5s ease-out;
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Меньше движения
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html,
  .carousel__track { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
