/* ==========================================================================
   СТИЛИ САЙТА МАСТЕРСКОЙ ПЕРЕТЯЖКИ
   Порядок: 1) переменные  2) база  3) общие элементы (кнопки, чипы, поля)
            4) блоки страницы сверху вниз  5) служебные страницы  6) анимации
   Цвета бренда приходят из js/config.js и переопределяют переменные ниже.
   ========================================================================== */

/* ---------- 1. Переменные (дизайн-система) ---------- */
:root {
  /* Цвета */
  --c-primary: #1F4037;
  --c-primary-dark: #16302A;
  --c-accent: #C4902F;
  --c-accent-dark: #B38428;
  --c-accent-text: #7D5410;
  --c-ink: #1A1F1D;
  --c-muted: #5C6661;
  --c-line: #DDD9CF;
  --c-paper: #FBFAF7;
  --c-linen: #EEEBE3;
  --c-white: #FFFFFF;
  --c-success: #2E7D4F;
  --c-error: #B3261E;

  /* Шрифты */
  --f-display: "Montserrat", "Manrope", system-ui, sans-serif;
  --fw-display: 700;
  --f-text: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Шкала размеров текста */
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-22: 1.375rem;
  --fs-28: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  --fs-36: clamp(1.625rem, 1.25rem + 1.7vw, 2.25rem);
  --fs-64: clamp(2rem, 1.1rem + 3.2vw, 3.5rem);

  /* Отступы: шаг 8px */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
  --s-5: 40px; --s-6: 48px; --s-8: 64px; --s-10: 80px;
  --section-y: clamp(48px, 6vw, 80px);
  --gutter: 16px;

  /* Скругления, тени, границы */
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22, 48, 42, .08);
  --shadow-md: 0 16px 40px -16px rgba(22, 48, 42, .28);
  --border: 1px solid var(--c-line);

  /* Анимации */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
  --t-slow: 400ms cubic-bezier(.2, .7, .2, 1);

  /* «Стежок»: пунктирная линия шва, фирменный приём сайта */
  --stitch: repeating-linear-gradient(90deg, var(--c-accent) 0 10px, transparent 10px 17px);

  --header-h: 64px;
}
@media (min-width: 768px) { :root { --gutter: 32px; --header-h: 76px; } }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--c-primary) var(--c-linen); /* scrollbar в цвет бренда */
}
body {
  margin: 0;
  font-family: var(--f-text);
  font-size: var(--fs-16);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--c-linen); }
::-webkit-scrollbar-thumb { background: var(--c-primary); border-radius: 6px; border: 3px solid var(--c-linen); }
::selection { background: var(--c-primary); color: var(--c-white); }

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Единый видимый фокус для клавиатуры */
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: var(--r-sm); }

.container { width: 100%; max-width: calc(1200px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--c-muted); }
.link { color: var(--c-accent-text); text-decoration: underline; text-underline-offset: 3px; transition: color var(--t-fast); }
.link:hover { color: var(--c-primary); }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: 16px; top: -64px; z-index: 200; padding: 12px 16px; background: var(--c-primary); color: var(--c-white); border-radius: var(--r-md); transition: top var(--t-fast); }
.skip-link:focus { top: 16px; }
.noscript { margin: 0; padding: 16px; text-align: center; background: var(--c-linen); }

/* Картинки с отложенной загрузкой: плавно проявляются */
img.lazy { opacity: 0; transition: opacity var(--t-slow); }
img.lazy.is-loaded { opacity: 1; }

/* ---------- 3. Общие элементы ---------- */

/* Секции */
.section { padding-block: var(--section-y); }
.section--linen { background: var(--c-linen); }
.section--dark { background: var(--c-primary); color: var(--c-white); }
.section__head { max-width: 720px; margin-bottom: var(--s-5); }
.section__head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.section__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-36); line-height: 1.2; letter-spacing: 0; text-wrap: balance; }
.section__title::after { content: ""; display: block; width: 88px; height: 2px; margin-top: var(--s-2); background: var(--stitch); }
.section__lead { margin-top: var(--s-2); font-size: var(--fs-18); color: var(--c-muted); max-width: 60ch; }
.section--dark .section__lead { color: rgba(255, 255, 255, .82); }

/* Кнопки: default, hover, active, focus-visible, disabled, loading */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  font-weight: 600; font-size: var(--fs-16); line-height: 1.2; text-align: center;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  cursor: pointer; user-select: none;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--sm { min-height: 44px; padding: 8px 16px; font-size: var(--fs-14); }
.btn--lg { min-height: 56px; padding: 16px 28px; }
.btn--block { width: 100%; }

.btn--accent { background: var(--c-accent); color: var(--c-ink); box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--c-accent-dark); box-shadow: var(--shadow-md); }
.btn--primary { background: var(--c-primary); color: var(--c-white); }
.btn--primary:hover { background: var(--c-primary-dark); }
.btn--outline { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn--outline:hover { background: var(--c-primary); color: var(--c-white); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { border-color: var(--c-ink); }

.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn__spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.btn.is-loading { cursor: progress; opacity: 1; }
.btn.is-loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Круглая кнопка с иконкой */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: none; background: var(--c-white); color: var(--c-primary); border: var(--border); border-radius: 50%; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast); }
.icon-btn:hover { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; background: var(--c-white); color: var(--c-primary); border-color: var(--c-line); }
.slider-nav { display: flex; gap: var(--s-1); }

/* Чипы: переключатели калькулятора и фильтров */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.chip { position: relative; display: inline-flex; padding: 0; background: none; border: 0; cursor: pointer; }
.chip__body {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  font-size: var(--fs-14); font-weight: 600; line-height: 1.2;
  color: var(--c-ink); background: var(--c-white); border: 1.5px solid var(--c-line); border-radius: 999px;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover .chip__body { border-color: var(--c-primary); }
.chip input:checked + .chip__body,
.chip[aria-pressed="true"] .chip__body { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.chip input:focus-visible + .chip__body { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.chip__dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.chip__sub { font-weight: 500; opacity: .75; }

/* Чипы на тёмном фоне калькулятора */
.section--dark .chip__body { color: var(--c-white); background: transparent; border-color: rgba(255, 255, 255, .35); }
.section--dark .chip:hover .chip__body { border-color: var(--c-white); }
.section--dark .chip input:checked + .chip__body { background: var(--c-white); color: var(--c-primary); border-color: var(--c-white); }

/* Всплывающая подсказка: показывается при наведении и фокусе */
@media (hover: hover) {
  [data-tip]::after {
    content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
    width: max-content; max-width: 240px; padding: 8px 12px;
    font-size: 13px; font-weight: 500; line-height: 1.4; text-align: left;
    color: var(--c-white); background: var(--c-ink); border-radius: var(--r-md); box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(4px); pointer-events: none;
    transition: opacity var(--t-fast), transform var(--t-fast);
  }
  [data-tip]:hover::after, [data-tip]:focus-within::after { opacity: 1; transform: none; }
}

/* Пустое состояние фильтров */
.empty { padding: var(--s-6) var(--s-3); text-align: center; background: var(--c-white); border: 1.5px dashed var(--c-line); border-radius: var(--r-lg); }
.empty__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); }
.empty__text { max-width: 48ch; margin: var(--s-1) auto var(--s-3); color: var(--c-muted); }

/* ---------- 4.1 Шапка ---------- */
.header { position: sticky; top: 0; z-index: 100; background: var(--c-paper); border-bottom: 1px solid transparent; transition: border-color var(--t-base), box-shadow var(--t-base); }
.header.is-scrolled { border-bottom-color: var(--c-line); box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--c-primary); }
.logo__mark { width: 40px; height: 40px; flex: none; }
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); color: var(--c-ink); }
.logo__desc { display: none; font-size: 12px; color: var(--c-muted); white-space: nowrap; }
@media (min-width: 480px) { .logo__desc { display: block; } }

.header__actions { display: flex; align-items: center; gap: var(--s-1); }
.header__phone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; font-weight: 700; white-space: nowrap; color: var(--c-ink); transition: color var(--t-fast); }
.header__phone:hover { color: var(--c-accent-text); }
.header__phone span { display: none; }
.header__cta { display: none; white-space: nowrap; border-radius: 999px; }
@media (min-width: 768px) { .header__phone span { display: inline; } .header__cta { display: inline-flex; } .header__actions { gap: var(--s-2); } }

/* Бургер с анимацией в крестик */
.burger { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 44px; height: 44px; padding: 0; background: none; border: 0; border-radius: var(--r-md); }
.burger__line { width: 24px; height: 2px; background: var(--c-ink); border-radius: 2px; transition: transform var(--t-base), opacity var(--t-fast); }
.burger[aria-expanded="true"] .burger__line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Меню: на телефоне выезжающая панель, на компьютере строка */
.nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-3) var(--gutter) var(--s-4);
  background: var(--c-paper); overflow-y: auto;
  visibility: hidden; opacity: 0; transform: translateY(-8px);
  transition: opacity var(--t-base), transform var(--t-base), visibility 0s linear 250ms;
}
.nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity var(--t-base), transform var(--t-base); }
.nav__link { display: flex; align-items: center; min-height: 52px; font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); border-bottom: var(--border); transition: color var(--t-fast); }
.nav__link:hover { color: var(--c-accent-text); }
.nav__extra { display: grid; gap: var(--s-2); margin-top: auto; }
.nav__phone { display: flex; align-items: center; min-height: 44px; font-size: var(--fs-22); font-weight: 700; }
body.is-locked { overflow: hidden; }

@media (min-width: 1280px) {
  .burger, .nav__extra { display: none; }
  .nav { position: static; inset: auto; flex-direction: row; padding: 0; background: none; overflow: visible; visibility: visible; opacity: 1; transform: none; transition: none; }
  /* Меню-«таблетка» */
  .nav__list { display: flex; gap: 2px; padding: 5px; background: var(--c-linen); border-radius: 999px; transition: background-color var(--t-base); }
  .nav__link { min-height: 40px; padding: 0 14px; font-family: var(--f-text); font-size: 14px; font-weight: 600; white-space: nowrap; border: 0; border-radius: 999px; transition: background-color var(--t-fast), color var(--t-fast); }
  .nav__link:hover { color: var(--c-ink); background: rgba(0, 0, 0, .07); }
  .nav__link.is-active { color: var(--c-white); background: var(--c-primary); }
}

/* Шапка главной лежит поверх цветного первого экрана: прозрачная, пока страница не прокручена */
.header--overlay { position: fixed; left: 0; right: 0; background: transparent; transition: background-color var(--t-base), border-color var(--t-base), box-shadow var(--t-base); }
.header--overlay.is-scrolled, .header--overlay.is-menu-open { background: var(--c-paper); }
.header--overlay:not(.is-scrolled):not(.is-menu-open) .logo,
.header--overlay:not(.is-scrolled):not(.is-menu-open) .logo__name,
.header--overlay:not(.is-scrolled):not(.is-menu-open) .header__phone { color: var(--c-white); }
.header--overlay:not(.is-scrolled):not(.is-menu-open) .logo__desc { color: rgba(255, 255, 255, .8); }
.header--overlay:not(.is-scrolled):not(.is-menu-open) .burger__line { background: var(--c-white); }
.header--overlay:not(.is-scrolled):not(.is-menu-open) .header__cta { background: var(--c-white); color: var(--c-ink); }
@media (min-width: 1280px) {
  .header--overlay:not(.is-scrolled) .nav__list { background: rgba(0, 0, 0, .22); }
  .header--overlay:not(.is-scrolled) .nav__link { color: var(--c-white); }
  .header--overlay:not(.is-scrolled) .nav__link:hover { background: rgba(255, 255, 255, .16); color: var(--c-white); }
  .header--overlay:not(.is-scrolled) .nav__link.is-active { background: var(--c-white); color: var(--c-ink); }
}

/* ---------- 4.2 Главный экран (по референсу: цветная сцена, предмет по центру) ---------- */
.hero { position: relative; color: var(--c-white); background: var(--c-primary-dark); }
.hero__slides { display: grid; }
/* Все слайды лежат в одной ячейке, виден только активный */
.hero-slide { grid-area: 1 / 1; display: flex; min-height: min(100svh, 860px); padding-top: var(--header-h);
  background: radial-gradient(ellipse 70% 75% at 56% 46%, var(--hero-c), var(--hero-d));
  opacity: 0; visibility: hidden; transition: opacity 400ms ease, visibility 0s linear 400ms; }
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity 400ms ease; }
.hero-slide__inner { display: grid; gap: var(--s-3); align-content: center; padding-block: var(--s-3) var(--s-4);
  grid-template-areas: "text" "media" "side"; }
.hero-slide__text { grid-area: text; }
.hero-slide__media { grid-area: media; display: flex; align-items: center; justify-content: center; min-width: 0; }
.hero-slide__side { grid-area: side; display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s-2); align-items: end; }

.hero__arrows { display: flex; gap: var(--s-1); margin-bottom: var(--s-2); }
.hero__arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: var(--c-white); background: rgba(0, 0, 0, .22); border: 0; border-radius: 50%; transition: background-color var(--t-fast), color var(--t-fast); }
.hero__arrow:hover { background: var(--c-white); color: var(--c-ink); }
.hero__arrow .icon { width: 20px; height: 20px; stroke-width: 2; }
.hero__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-64); line-height: 1.12; letter-spacing: 0; text-wrap: balance; }
.hero__subtitle { margin-top: var(--s-2); max-width: 44ch; font-size: var(--fs-16); line-height: 1.65; color: rgba(255, 255, 255, .88); }
.hero__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin-top: var(--s-3); }
.hero__link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--c-white); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(255, 255, 255, .5); transition: text-decoration-color var(--t-fast); }
.hero__link:hover { text-decoration-color: var(--c-white); }
.btn--white { background: var(--c-white); color: var(--c-ink); border-radius: 999px; }
.btn--white:hover { background: var(--c-ink); color: var(--c-white); }
.btn--white .icon { width: 18px; height: 18px; stroke-width: 2.2; }

/* Вырезанное фото мебели: JPG обрезается по PNG-маске, под ним тень на «полу» */
.cutout { position: relative; width: 100%; max-width: 560px; }
.cutout__img { display: block; width: 100%; height: 100%; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; }
.cutout::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -5%; height: 12%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), transparent 68%); z-index: -1; }
.hero-slide__media .cutout { z-index: 0; }
.hero-slide.is-active .cutout { animation: hero-in 600ms cubic-bezier(.2, .7, .2, 1); }
@keyframes hero-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.hero__price-label { grid-column: 1 / -1; font-size: var(--fs-14); color: rgba(255, 255, 255, .8); }
.hero__price { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); line-height: 1.1; white-space: nowrap; }
.hero__price-old { font-size: var(--fs-16); color: rgba(255, 255, 255, .8); white-space: nowrap; }
.hero__price-old s { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-22); }
.hero__choose { grid-column: 1 / -1; margin-top: var(--s-2); font-size: var(--fs-14); color: rgba(255, 255, 255, .8); }
.hero__dots { grid-column: 1 / -1; display: flex; gap: var(--s-1); }
.hero__dot { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; color: var(--c-white); background: rgba(0, 0, 0, .22); border: 0; border-radius: 50%; transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.hero__dot:hover { transform: translateY(-2px); }
.hero__dot[aria-pressed="true"] { background: var(--c-white); color: var(--c-ink); }
.hero__caption, .hero__social, .hero__next { display: none; }

@media (min-width: 768px) {
  .hero-slide__inner { grid-template-columns: 1fr auto; grid-template-areas: "text text" "media side"; align-items: center; }
  .hero-slide__side { grid-template-columns: auto; justify-items: end; text-align: right; }
  .hero__dots { justify-content: flex-end; }
}
@media (min-width: 1100px) {
  .hero-slide__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(170px, auto); grid-template-rows: 1fr auto; gap: var(--s-4) var(--s-5); width: 100%;
    grid-template-areas: "text media side" "social caption next"; padding-block: var(--s-5) var(--s-4); }
  .hero-slide__text { align-self: center; }
  .cutout { max-width: 640px; }
  .cutout--tall { max-width: 420px; }
  .hero__caption { grid-area: caption; display: block; align-self: end; text-align: center; font-family: var(--f-display); font-weight: 600; font-size: var(--fs-18); line-height: 1.3; text-wrap: balance; }
  .hero__social { grid-area: social; display: flex; gap: var(--s-1); align-self: end; }
  .hero__social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--c-white); border-radius: 50%; transition: background-color var(--t-fast); }
  .hero__social a:hover { background: rgba(0, 0, 0, .25); }
  .hero__social .icon { width: 22px; height: 22px; }
  /* Миниатюра следующего слайда, как в референсе */
  .hero__next { grid-area: next; display: block; justify-self: end; align-self: end; width: 96px; padding: 0; background: none; border: 0; border-radius: var(--r-md); opacity: .9; transition: transform var(--t-base), opacity var(--t-fast); }
  .hero__next:hover { transform: translateY(-4px) scale(1.04); opacity: 1; }
  .hero__next .cutout { animation: none; }
}

/* Доверительные факты */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); padding-block: var(--s-5); }
.facts__value { display: block; font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-28); line-height: 1.1; color: var(--c-primary); }
.facts__label { display: block; margin-top: 4px; font-size: var(--fs-14); color: var(--c-muted); }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); } }

/* ---------- Слайдер сравнения «до/после» ---------- */
.compare { --pos: 50%; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-lg); background: var(--c-linen); box-shadow: var(--shadow-md); cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare__layer { position: absolute; inset: 0; }
.compare__layer > img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare__layer > .stage { pointer-events: none; }
.compare__layer--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__tag { position: absolute; top: 16px; z-index: 2; padding: 4px 12px; font-size: 13px; font-weight: 700; color: var(--c-white); background: rgba(26, 31, 29, .72); border-radius: 999px; pointer-events: none; }
.compare__tag--before { left: 16px; }
.compare__tag--after { right: 16px; }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 3; width: 2px; margin-left: -1px; background: var(--c-white); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); pointer-events: none; }
/* Ручка в виде обивочной пуговицы */
.compare__knob { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: -24px 0 0 -24px; color: var(--c-primary); background: var(--c-white); border-radius: 50%; box-shadow: 0 4px 16px rgba(0, 0, 0, .28), inset 0 0 0 4px var(--c-white), inset 0 0 0 5.5px var(--c-accent); transition: transform var(--t-fast); }
.compare:hover .compare__knob, .compare.is-dragging .compare__knob { transform: scale(1.08); }
.compare__knob .icon { width: 22px; height: 22px; }
/* Невидимый ползунок: управление с клавиатуры (стрелки) */
.compare__range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.compare:has(.compare__range:focus-visible) { outline: 3px solid var(--c-accent); outline-offset: 3px; }

/* ---------- Сцена для фото работ: вырезанная мебель на цветном фоне ---------- */
.stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; background: radial-gradient(ellipse 75% 80% at 50% 48%, var(--stage-c), var(--stage-d)); }
.stage .cutout { display: block; flex: none; max-width: none; z-index: 0; transition: transform var(--t-slow); }
/* Мебель, обрезанная на фото снизу, прижимается к нижнему краю */
.stage--bleed { align-items: flex-end; }
.stage--bleed .cutout::after { display: none; }
/* Состояние «до»: фон тот же, меняется только сама мебель (выцветшая, с пятнами) */
.stage--before .cutout__img { filter: grayscale(.85) sepia(.3) brightness(.68) contrast(.85); }
.cutout__wear { position: absolute; inset: 0; mix-blend-mode: multiply; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat;
  background: radial-gradient(ellipse 18% 16% at 30% 60%, rgba(46, 32, 16, .6), transparent 70%), radial-gradient(ellipse 11% 12% at 68% 38%, rgba(46, 32, 16, .45), transparent 70%), radial-gradient(ellipse 24% 10% at 58% 82%, rgba(46, 32, 16, .5), transparent 70%); }

/* Вкладки (цены) */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-3); }
.chip[aria-selected="true"] .chip__body { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.price-panel { animation: fade-in 250ms ease; }
.price-panel:focus-visible { outline-offset: 6px; }

/* ---------- 4.3 Услуги ---------- */
.services { display: grid; gap: 0 var(--s-5); }
.service { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-1) var(--s-2); padding-block: var(--s-3); background: var(--stitch) bottom left / 100% 2px no-repeat; }
.service__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; color: var(--c-primary); background: var(--c-paper); border-radius: 50%; grid-row: span 2; transition: background-color var(--t-base), color var(--t-base); }
.service__icon .icon { width: 28px; height: 28px; }
.service:hover .service__icon { background: var(--c-primary); color: var(--c-white); }
.service__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); line-height: 1.2; align-self: center; }
.service__text { color: var(--c-muted); font-size: 15px; }
.service__foot { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-2); margin-top: var(--s-1); }
.service__price { font-weight: 700; font-size: var(--fs-18); white-space: nowrap; }
.service__link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; font-weight: 700; font-size: 15px; color: var(--c-accent-text); background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; transition: color var(--t-fast); }
.service__link:hover { color: var(--c-primary); }
@media (min-width: 768px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 4.4 Калькулятор ---------- */
.calc { display: grid; gap: var(--s-5); align-items: start; }
.calc .section__title::after { background: repeating-linear-gradient(90deg, var(--c-accent) 0 10px, transparent 10px 17px); }
.calc__group { margin-top: var(--s-4); }
.calc__legend { margin-bottom: 12px; font-weight: 700; font-size: var(--fs-16); }
.calc__hint { min-height: 1.4em; margin-top: var(--s-1); font-size: var(--fs-14); color: rgba(255, 255, 255, .78); }
.calc__result { padding: var(--s-4) var(--s-3); color: var(--c-ink); background: var(--c-paper); border-radius: var(--r-lg); box-shadow: var(--shadow-md); outline: 1.5px dashed var(--c-accent); outline-offset: -10px; }
.calc__result-label { font-size: var(--fs-14); font-weight: 600; color: var(--c-muted); }
.calc__price { margin-top: 4px; font-family: var(--f-display); font-weight: var(--fw-display); font-size: clamp(1.625rem, 1.2rem + 2vw, 2.25rem); line-height: 1.2; color: var(--c-primary); }
.calc__price.is-updated { animation: bump 300ms ease; }
@keyframes bump { 40% { transform: scale(1.03); } }
.calc__breakdown { display: grid; gap: var(--s-1); margin-block: var(--s-3); padding-block: var(--s-2); border-block: var(--border); }
.calc__breakdown div { display: flex; justify-content: space-between; gap: var(--s-2); font-size: 15px; }
.calc__breakdown dt { color: var(--c-muted); }
.calc__breakdown dd { font-weight: 700; white-space: nowrap; }
.calc__note { margin-top: var(--s-2); font-size: 13px; color: var(--c-muted); }
@media (min-width: 1024px) {
  .calc { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: var(--s-8); }
  .calc__result { position: sticky; top: calc(var(--header-h) + 24px); padding: var(--s-5); }
}

/* ---------- 4.5 До и после ---------- */
.ba { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.ba > * { min-width: 0; }
.ba__info { display: grid; gap: var(--s-1); justify-items: start; }
.ba__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); line-height: 1.25; }
.ba__text { color: var(--c-muted); }
.ba__meta { display: flex; flex-wrap: wrap; gap: 4px var(--s-2); font-weight: 700; color: var(--c-accent-text); }
.ba__info .btn { margin-top: var(--s-1); }
/* Миниатюры работ */
.ba__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-1); margin-top: var(--s-3); }
.ba__thumb { display: block; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; background: var(--c-linen); border: 0; border-radius: var(--r-md); opacity: .72; transition: opacity var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.ba__thumb:hover { opacity: 1; transform: translateY(-2px); }
.ba__thumb[aria-selected="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--c-paper), 0 0 0 4px var(--c-primary); }
.ba__thumb .cutout::after { display: none; }
@media (min-width: 1024px) {
  .ba { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-5); align-items: center; }
}
.more-btn { display: flex; margin: var(--s-3) auto 0; }

/* ---------- 4.6 Каталог тканей ---------- */
.filters { display: grid; gap: var(--s-2); }
.filters__row { display: grid; gap: var(--s-1); }
.filters__label { font-weight: 700; font-size: var(--fs-14); color: var(--c-muted); }
.filters__count { margin-block: var(--s-3) var(--s-2); font-size: var(--fs-14); color: var(--c-muted); }
@media (min-width: 768px) { .filters__row { grid-template-columns: 56px 1fr; align-items: center; } }

.fabrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); }
@media (min-width: 768px) { .fabrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); } }
@media (min-width: 1100px) { .fabrics { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fabric { display: flex; flex-direction: column; }
/* Образец ткани с зубчатым краем, как вырезанный ножницами «зигзаг» */
.swatch {
  --tooth: 7px;
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; background-color: var(--swatch, #999);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  transition: transform var(--t-base);
}
.fabric:hover .swatch { transform: translateY(-4px) rotate(-1deg); }
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.swatch::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
/* Фактуры по типам ткани (пока нет фото образца) */
.swatch--velour::before { background: linear-gradient(115deg, rgba(255,255,255,.22), transparent 35%, rgba(0,0,0,.18) 70%, rgba(255,255,255,.1)); }
.swatch--rogozhka::before { background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 5px), repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 2px, transparent 2px 5px); }
.swatch--microfiber::before { background: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.4px) 0 0 / 5px 5px, linear-gradient(160deg, rgba(255,255,255,.12), rgba(0,0,0,.1)); }
.swatch--eco::before { background: radial-gradient(rgba(0,0,0,.16) 1px, transparent 1.6px) 0 0 / 7px 7px, radial-gradient(rgba(255,255,255,.12) 1px, transparent 1.6px) 3px 4px / 7px 7px; }
.swatch--leather::before { background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.2), transparent 55%), radial-gradient(rgba(0,0,0,.2) 1px, transparent 1.8px) 0 0 / 9px 8px, radial-gradient(rgba(0,0,0,.12) 1px, transparent 1.8px) 4px 5px / 11px 9px; }
.fabric__body { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.fabric__type { font-size: 13px; color: var(--c-muted); }
.fabric__name { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-18); line-height: 1.25; }
.fabric__desc { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--c-muted); }
.fabric__price { margin-top: var(--s-1); font-weight: 700; }
.fabric__btn { margin-top: auto; }
.fabric__btn .btn { margin-top: 12px; padding-inline: 8px; }
.fabric.is-selected .btn { background: var(--c-primary); color: var(--c-white); }

/* ---------- 4.7 Как мы работаем ---------- */
.steps { display: grid; gap: var(--s-4); counter-reset: step; }
.step { position: relative; padding-left: 72px; }
.step__num { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); color: var(--c-primary); background: var(--c-paper); border: 1.5px dashed var(--c-accent); border-radius: 50%; }
/* Вертикальный «шов» между шагами на телефоне */
.step:not(:last-child)::before { content: ""; position: absolute; left: 25px; top: 60px; bottom: -24px; width: 2px; background: repeating-linear-gradient(180deg, var(--c-accent) 0 10px, transparent 10px 17px); }
.step__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); line-height: 1.2; padding-top: 10px; }
.step__text { margin-top: var(--s-1); color: var(--c-muted); font-size: 15px; }
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
  .step { padding: 76px 0 0; }
  .step:not(:last-child)::before { left: 60px; right: -16px; top: 25px; bottom: auto; width: auto; height: 2px; background: var(--stitch); }
}

/* ---------- 4.8 Преимущества и гарантия ---------- */
.benefits { display: grid; gap: var(--s-4) var(--s-5); }
.benefit { display: grid; grid-template-columns: 32px 1fr; gap: 4px var(--s-2); }
.benefit .icon { width: 32px; height: 32px; color: var(--c-accent-text); grid-row: span 2; }
.benefit__title { font-weight: 700; font-size: var(--fs-18); line-height: 1.3; }
.benefit__text { color: var(--c-muted); font-size: 15px; }
@media (min-width: 768px) { .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.guarantee { display: grid; gap: var(--s-3); margin-top: var(--s-5); padding: var(--s-4) var(--s-3); color: var(--c-white); background: var(--c-primary); border-radius: var(--r-lg); outline: 1.5px dashed var(--c-accent); outline-offset: -10px; }
.guarantee__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-28); line-height: 1.2; }
.guarantee__text { margin-top: var(--s-2); color: rgba(255, 255, 255, .85); max-width: 56ch; }
.guarantee__points { display: grid; gap: 12px; align-content: center; }
.guarantee__points li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.guarantee__points .icon { color: var(--c-accent); }
@media (min-width: 900px) { .guarantee { grid-template-columns: 1.4fr 1fr; gap: var(--s-6); padding: var(--s-6); } }

/* ---------- 4.9 Портфолио ---------- */
.portfolio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
@media (min-width: 768px) { .portfolio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); } }
@media (min-width: 1100px) { .portfolio { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.work { position: relative; display: block; width: 100%; padding: 0; text-align: left; background: none; border: 0; border-radius: var(--r-md); cursor: zoom-in; }
.work__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-md); background: var(--c-linen); }
.work__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.work:hover .work__media > img, .work:hover .cutout { transform: scale(1.06); }
.work__title { display: block; margin-top: var(--s-1); font-weight: 600; font-size: var(--fs-14); line-height: 1.35; }
.work__meta { display: block; font-size: 13px; color: var(--c-muted); }

/* Окно просмотра */
.lightbox { width: min(1040px, 100vw - 24px); max-width: none; max-height: calc(100dvh - 24px); padding: 0; color: var(--c-white); background: transparent; border: 0; overflow: visible; }
.lightbox::backdrop { background: rgba(16, 24, 21, .9); }
.lightbox[open] { display: grid; grid-template-columns: 1fr; animation: fade-in 250ms ease; }
.lightbox__figure { min-width: 0; }
.lightbox__media { aspect-ratio: 4 / 3; max-height: calc(100dvh - 200px); margin-inline: auto; overflow: hidden; border-radius: var(--r-lg); background: var(--c-linen); }
.lightbox__media > img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__caption { padding: var(--s-2) 4px 0; }
.lightbox__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); line-height: 1.25; }
.lightbox__text { margin-top: 4px; color: rgba(255, 255, 255, .82); font-size: 15px; }
.lightbox__counter { margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.lightbox__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.lightbox__arrow { position: absolute; top: 34%; z-index: 2; }
.lightbox__arrow--prev { left: 12px; }
.lightbox__arrow--next { right: 12px; }
@media (min-width: 1200px) {
  .lightbox__close { top: 0; right: -64px; }
  .lightbox__arrow { top: 40%; }
  .lightbox__arrow--prev { left: -64px; }
  .lightbox__arrow--next { right: -64px; }
}
@keyframes fade-in { from { opacity: 0; transform: scale(.98); } }

/* ---------- 4.10 Отзывы ---------- */
.reviews { display: flex; gap: var(--s-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); scrollbar-width: thin; border-radius: var(--r-md); }
.review { flex: 0 0 min(86%, 380px); scroll-snap-align: start; display: flex; flex-direction: column; padding: var(--s-3); background: var(--c-linen); border-radius: var(--r-lg); }
.review__stars { display: flex; gap: 2px; color: var(--c-accent); }
.review__stars .icon { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.review__stars .icon.is-empty { fill: var(--c-line); }
.review__text { margin-block: var(--s-2) var(--s-3); font-size: 15px; }
.review__foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: var(--s-2); background: var(--stitch) top left / 100% 2px no-repeat; }
.review__avatar { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-18); color: var(--c-white); background: var(--c-primary); border-radius: 50%; }
.review__name { font-weight: 700; line-height: 1.3; }
.review__meta { font-size: 13px; color: var(--c-muted); }
.review__source { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- 4.11 Цены ---------- */
.prices { max-width: 820px; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table caption { padding-bottom: var(--s-2); font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); text-align: left; }
.price-table th, .price-table td { padding: 14px 0; text-align: left; vertical-align: baseline; border-bottom: var(--border); }
.price-table thead th { padding-block: 0 8px; font-size: 13px; font-weight: 600; color: var(--c-muted); }
.price-table tbody th { font-weight: 500; padding-right: 12px; }
.price-table td { white-space: nowrap; }
.price-table .price-table__term { color: var(--c-muted); font-size: var(--fs-14); padding-right: 12px; }
.price-table .price-table__price { font-weight: 700; text-align: right; }
.price-table thead th:last-child { text-align: right; }
.price-table tbody tr { transition: background-color var(--t-fast); }
.price-table tbody tr:hover { background: rgba(0, 0, 0, .04); }
@media (max-width: 479px) { .price-table .price-table__term, .price-table thead th:nth-child(2) { display: none; } }
.prices__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-4); padding: var(--s-3); background: var(--c-paper); border-radius: var(--r-lg); }
.prices__cta p { font-weight: 600; max-width: 52ch; }

/* ---------- 4.12 Вопросы и ответы ---------- */
.faq { display: grid; gap: var(--s-3); }
@media (min-width: 1024px) { .faq { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-8); align-items: start; } .faq .section__head { margin: 0; } }
.accordion__item { border-bottom: var(--border); }
.accordion__item:first-child { border-top: var(--border); }
.accordion__heading { font: inherit; }
.accordion__button { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); width: 100%; min-height: 64px; padding: 16px 0; font-weight: 700; font-size: var(--fs-18); line-height: 1.35; text-align: left; background: none; border: 0; transition: color var(--t-fast); }
.accordion__button:hover { color: var(--c-accent-text); }
.accordion__button .icon { transition: transform var(--t-base); color: var(--c-accent-text); }
.accordion__button[aria-expanded="true"] .icon { transform: rotate(45deg); }
/* Плавное раскрытие через grid-строку: высоту считать не нужно */
.accordion__panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--t-base), visibility 0s linear 250ms; }
.accordion__panel.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--t-base); }
.accordion__content { overflow: hidden; }
.accordion__content p { padding-bottom: var(--s-3); max-width: 64ch; color: var(--c-muted); }

/* ---------- 4.13 Контакты и форма ---------- */
.contacts { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 1024px) { .contacts { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-8); } }

.form { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 700; font-size: 15px; }
.field__optional { font-weight: 500; font-size: 13px; color: var(--c-muted); }
.field__input { width: 100%; min-height: 52px; padding: 12px 16px; font-size: 16px; background: var(--c-white); border: 1.5px solid var(--c-line); border-radius: var(--r-md); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.field__input::placeholder { color: #6A726E; }
.field__input:hover { border-color: var(--c-muted); }
.field__input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(31, 64, 55, .2); }
.field__input--area { min-height: 96px; resize: vertical; line-height: 1.5; }
.field__input--select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1F1D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; cursor: pointer; }
.field__hint { font-size: 13px; color: var(--c-muted); }
.field__error { display: none; font-size: 13px; font-weight: 600; color: var(--c-error); }
/* Состояния поля: ошибка и успех */
.field.is-invalid .field__input { border-color: var(--c-error); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.field.is-invalid .field__error { display: block; }
.field.is-invalid .field__hint { display: none; }
.field.is-valid .field__input { border-color: var(--c-success); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D4F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; padding-right: 44px; }
.field.is-valid .field__input--area { background-position: right 14px top 14px; }

/* Чекбокс согласия */
.field--check { grid-template-columns: 24px 1fr; gap: 6px 12px; align-items: start; }
.field--check .field__error { grid-column: 1 / -1; }
.check { width: 24px; height: 24px; margin: 10px 0 0; accent-color: var(--c-primary); cursor: pointer; }
.check__label { display: block; padding-block: 11px; font-size: var(--fs-14); color: var(--c-muted); cursor: pointer; }

/* Загрузка фото */
.upload { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; color: var(--c-muted); font-size: var(--fs-14); background: var(--c-white); border: 1.5px dashed var(--c-line); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.upload:hover, .upload.is-dragover { border-color: var(--c-primary); background: var(--c-linen); }
.upload__action { font-weight: 700; color: var(--c-accent-text); text-decoration: underline; text-underline-offset: 3px; }
#f-files:focus-visible + .upload__list, .upload:has(+ #f-files:focus-visible) { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.upload__list { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.upload__item { position: relative; width: 72px; height: 72px; border-radius: var(--r-md); overflow: hidden; background: var(--c-linen); }
.upload__item img { width: 100%; height: 100%; object-fit: cover; }
.upload__remove { position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--c-white); background: rgba(26, 31, 29, .78); border: 0; border-radius: 0 0 0 var(--r-md); }
.upload__remove .icon { width: 16px; height: 16px; }
/* Невидимая увеличенная зона нажатия до 44px */
.upload__remove::after { content: ""; position: absolute; inset: -6px; }

/* Что приложено к заявке: ткань, расчёт */
.form__extras { display: grid; gap: var(--s-1); padding: var(--s-2); background: var(--c-paper); border-radius: var(--r-md); }
.extra { display: flex; align-items: center; gap: 12px; font-size: var(--fs-14); }
.extra__dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.extra__label { color: var(--c-muted); }
.extra__value { font-weight: 700; }
.extra__remove { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -8px -8px auto; flex: none; color: var(--c-muted); background: none; border: 0; border-radius: 50%; transition: color var(--t-fast), background-color var(--t-fast); }
.extra__remove:hover { color: var(--c-error); background: var(--c-white); }
.extra__remove .icon { width: 18px; height: 18px; }

.form__alert { padding: var(--s-2); font-size: var(--fs-14); font-weight: 600; color: var(--c-error); background: #FBECEA; border: 1.5px solid var(--c-error); border-radius: var(--r-md); }
.form__alert a { text-decoration: underline; }

/* Успешная отправка */
.form-success { margin-top: var(--s-4); padding: var(--s-5) var(--s-3); text-align: center; background: var(--c-paper); border-radius: var(--r-lg); animation: fade-in 300ms ease; }
.form-success:focus { outline: none; }
.form-success__icon { width: 64px; height: 64px; margin: 0 auto var(--s-2); color: var(--c-success); }
.form-success__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-28); }
.form-success__text { max-width: 44ch; margin: var(--s-1) auto var(--s-3); color: var(--c-muted); }
.form-success__demo { max-width: 44ch; margin: 0 auto var(--s-3); padding: 8px 12px; font-size: 13px; color: var(--c-accent-text); border: 1px dashed var(--c-accent); border-radius: var(--r-md); }

/* Блок контактов */
.contacts__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); }
.contacts__phone { display: inline-flex; align-items: center; min-height: 48px; margin-top: var(--s-1); font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-28); color: var(--c-primary); transition: color var(--t-fast); }
.contacts__phone:hover { color: var(--c-accent-text); }
.messengers { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-2); }
.messengers .btn { flex: 1 1 140px; }
.contacts__list { display: grid; gap: var(--s-3); margin-block: var(--s-4); }
.contacts__list dt { display: flex; align-items: center; gap: 8px; font-size: var(--fs-14); font-weight: 700; color: var(--c-muted); }
.contacts__list dt .icon { width: 20px; height: 20px; color: var(--c-accent-text); }
.contacts__list dd { margin-top: 4px; padding-left: 28px; }
.schedule__row { display: flex; justify-content: space-between; gap: var(--s-2); max-width: 340px; }
.schedule__row span:last-child { font-weight: 700; white-space: nowrap; }
.map { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-paper); border-radius: var(--r-lg); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map__fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--c-primary); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 4.14 Подвал ---------- */
.footer { padding-block: var(--s-8) calc(var(--s-4) + 72px); color: rgba(255, 255, 255, .82); background: var(--c-primary-dark); font-size: 15px; }
.footer__inner { display: grid; gap: var(--s-5); }
.footer__brand { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-28); color: var(--c-white); }
.footer__text { margin-top: var(--s-1); max-width: 32ch; }
.footer__head { margin-bottom: var(--s-1); font-weight: 700; color: var(--c-white); }
.footer__links a, .footer__links span { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.footer a { transition: color var(--t-fast); }
.footer a:hover { color: var(--c-accent); text-decoration: underline; text-underline-offset: 4px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-3); margin-top: var(--s-5); padding-top: var(--s-3); font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .16); }
.footer__bottom a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.footer__bottom p:first-child { padding-block: 12px; }
@media (min-width: 768px) { .footer { padding-bottom: var(--s-4); } .footer__inner { grid-template-columns: 1.4fr 1fr 1fr; } }

/* ---------- Плавающие элементы ---------- */
/* Панель звонка и мессенджеров: только на телефоне */
.mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; gap: 1px; background: var(--c-line); box-shadow: 0 -4px 16px rgba(22, 48, 42, .14); padding-bottom: env(safe-area-inset-bottom); }
.mobile-bar__btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; font-size: 13px; font-weight: 700; color: var(--c-primary); background: var(--c-white); }
.mobile-bar__btn .icon { width: 20px; height: 20px; }
.mobile-bar__btn--call { flex: 1.3; color: var(--c-ink); background: var(--c-accent); }
@media (min-width: 768px) { .mobile-bar { display: none; } }

.to-top { position: fixed; right: 16px; bottom: 72px; z-index: 80; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; color: var(--c-white); background: var(--c-primary); border: 0; border-radius: 50%; box-shadow: var(--shadow-md); transition: background-color var(--t-fast), transform var(--t-fast); animation: fade-in 250ms ease; }
.to-top:hover { background: var(--c-primary-dark); transform: translateY(-2px); }
@media (min-width: 768px) { .to-top { right: 24px; bottom: 24px; } }

/* ---------- 5. Служебные страницы: политика и 404 ---------- */
.page { padding-block: var(--s-6) var(--s-10); }
.page__title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-36); line-height: 1.15; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--s-5); font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-22); line-height: 1.25; }
.prose p, .prose ul { margin-top: var(--s-2); }
.prose ul { padding-left: 20px; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose__meta { color: var(--c-muted); font-size: var(--fs-14); }
.prose__warn { padding: var(--s-2); background: var(--c-linen); border-left: 3px solid var(--c-accent); border-radius: var(--r-sm); font-size: var(--fs-14); }

.notfound { display: grid; place-items: center; min-height: calc(100dvh - var(--header-h)); padding-block: var(--s-6); text-align: center; }
.notfound__code { font-family: var(--f-display); font-weight: var(--fw-display); font-size: clamp(5rem, 22vw, 11rem); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--c-accent); }
.notfound__title { margin-top: var(--s-2); font-family: var(--f-display); font-weight: var(--fw-display); font-size: var(--fs-36); line-height: 1.15; }
.notfound__text { max-width: 44ch; margin: var(--s-2) auto var(--s-4); color: var(--c-muted); font-size: var(--fs-18); }
.notfound__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }

/* ---------- 6. Появление блоков при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-slow), transform var(--t-slow); }
.reveal.is-in { opacity: 1; transform: none; }

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

/* Печать: без плавающих элементов */
@media print { .header, .mobile-bar, .to-top, .burger { display: none !important; } .reveal { opacity: 1; transform: none; } }
