/* Hurma Lombard — публичный сайт. Палитра и раскладка шапки/футера — с
   докс/figma/contacts-28087-3916.png (правка координатора от 2026-08-28,
   Figma MCP недоступен по лимиту тарифа). Шрифт Inter (Google Fonts) — как в
   админке, server/public/admin/index.html. */
:root {
  --color-primary: #E8500A;
  --color-primary-hover: #F07048;
  --color-cream: #F6F1E8;
  --color-cream-deep: #EFE6D6;
  /* Тёплый жёлтый — акцент для мелких элементов (номера шагов CTA) поверх
     оранжевого фона .cta-section, где кремовый (--color-cream-deep) тонет
     в контрасте (докс/figma/sections/28058-674.txt). */
  --color-accent-soft: #FFD79A;
  --color-footer: #1C1C1A;
  --color-footer-text: #C9C2B8;
  --color-footer-muted: #8F887F;
  --color-ink: #2C211D;
  /* Бренд-коричневый заголовков — тот же цвет, что и --brown в server/public/calc/styles.css
     («снято с оригинального CSS сервиса»), выведен в отдельный токен для h1/h2 главной. */
  --color-brown: #783017;
  --color-muted: #786B65;
  --color-line: #E6DBCB;
  --color-card: #FFFFFF;
  --color-success: #2E9E5B;
  --color-success-bg: #E8F6EC;
  --color-warning: #B98900;
  --color-warning-bg: #FBF1D8;
  --color-danger: #C23B2A;
  --color-danger-bg: #FBEAE6;
  --color-neutral: #8A8078;
  --color-neutral-bg: #F0ECE6;
  --container: 1720px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* [hidden] должен побеждать любой display, который задаёт класс (например
   .btn { display: inline-flex } на кнопках «Показать ещё») — без этого при
   равной специфичности с UA-стилем побеждает автор-стиль по порядку каскада. */
[hidden] { display: none !important; }
body {
  min-height: 100vh; margin: 0;
  color: var(--color-ink); background: var(--color-cream);
  font-family: Inter, Arial, sans-serif; font-size: 15px; line-height: 1.5;
}
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

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

/* Каркасы страниц (Task 8): <main> с одним <h1>, наполнение — Tasks 9-10. */
main { min-height: 40vh; padding: 48px 0; }
main > h1 { max-width: var(--container); margin: 0 auto; padding: 0 20px; font-size: 30px; font-weight: 700; }
main > p { max-width: var(--container); margin: 14px auto 0; padding: 0 20px; color: var(--color-muted); }

/* --- Кнопки --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { color: var(--color-primary); background: #fff; border: 1px solid var(--color-primary); }
.btn-secondary:hover { background: #fff3ec; }

/* --- Карточка --- */
.card { background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius); box-shadow: 0 5px 18px #37221809; }

/* --- Поля форм --- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 12px; font-weight: 650; color: var(--color-muted); }
.field input, .field select, .field textarea {
  padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--color-ink);
  background: #fff; border: 1px solid var(--color-line); border-radius: 8px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.field-checkbox { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; font-size: 12px; color: var(--color-muted); }
.field-checkbox input { margin-top: 3px; }

/* --- Статус филиала: цветная точка + подпись (карта филиалов, docs/figma/sections/28058-532.txt) --- */
.badge-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; }
.badge-status::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-status.free { color: var(--color-success); }
.badge-status.queue { color: var(--color-warning); }
.badge-status.busy { color: var(--color-danger); }
.badge-status.closed { color: var(--color-neutral); }

/* ============================= Шапка ============================= */
.site-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--color-line); transition: box-shadow .22s ease; }
.topbar-inner { display: flex; align-items: center; gap: 20px; padding: 14px 20px; transition: padding .22s ease; }
.logo img { height: 60px; width: auto; }
.logo { transition: transform .22s ease; transform-origin: left center; }

/* --- Shrinking sticky header (superdesign): скролл вниз > 80px — шапка
   «подбирается» (меньше паддинг topbar, логотип scale .88, тень снизу);
   класс .is-compact ставит site.js (scroll + rAF-троттлинг), вся анимация — CSS.
   Скролл вверх/возврат в самый верх — снимается, тени нет. --- */
.site-header.is-compact { box-shadow: 0 6px 18px #37221818; }
.site-header.is-compact .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
.site-header.is-compact .logo { transform: scale(.88); }
.site-header.is-compact .nav-inner { padding-top: 8px; padding-bottom: 8px; }
.quote-widget { display: flex; align-items: center; gap: 8px; margin: 0 auto; padding: 7px 14px; background: #fff; border: 1px solid var(--color-line); border-radius: 99px; font-size: 12px; }
.quote-select { position: relative; }
/* --- Проба: кнопка-дропдаун (шеврон вращается на 180° при открытии) --- */
.quote-toggle { display: flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--color-muted); font-weight: 650; cursor: pointer; }
.quote-toggle:hover, .quote-toggle[aria-expanded="true"] { color: var(--color-ink); }
.quote-chevron { flex: none; transition: transform .15s ease; }
.quote-toggle[aria-expanded="true"] .quote-chevron { transform: rotate(180deg); }
.quote-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 84px; padding: 6px; margin: 0;
  background: #fff; border: 1px solid var(--color-line); border-radius: 10px; box-shadow: 0 10px 26px #37221826;
}
.quote-dropdown li { padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 650; color: var(--color-ink); cursor: pointer; }
.quote-dropdown li:hover { background: var(--color-cream-deep); }
.quote-dropdown li[aria-selected="true"] { color: #fff; background: var(--color-primary); }
.quote-price { font-weight: 700; color: var(--color-primary); }
/* --- «+12%»: мини-треугольник тренда перед процентом (currentColor = зелёный/красный) --- */
.quote-change { display: inline-flex; align-items: center; font-weight: 650; }
.quote-change::before { content: ''; display: inline-block; width: 0; height: 0; margin-right: 3px; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.quote-change.up { color: var(--color-success); }
.quote-change.up::before { border-bottom: 6px solid currentColor; }
.quote-change.down { color: var(--color-danger); }
.quote-change.down::before { border-top: 6px solid currentColor; }
/* --- ⓘ: подсказка по фокусу/наведению (source + дата котировки) --- */
.quote-info { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--color-muted); cursor: pointer; }
.quote-info:hover, .quote-info:focus-visible { color: var(--color-primary); }
.quote-tooltip {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: max-content; max-width: 230px; padding: 8px 10px;
  background: var(--color-ink); color: #fff; font-size: 11px; font-weight: 500; line-height: 1.4; border-radius: 8px;
  opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease;
}
.quote-info:hover .quote-tooltip, .quote-info:focus-visible .quote-tooltip { opacity: 1; transform: translateY(0); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
/* --- Язык: флаг текущего языка + код + шеврон (клик — существующая логика L(path)/?setlang=1) --- */
.lang-switch { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--color-line); border-radius: 6px; font-size: 12px; font-weight: 700; background: #fff; }
.lang-switch .flag { display: none; flex: none; border-radius: 2px; overflow: hidden; line-height: 0; }
.lang-switch .flag-ru { display: inline-flex; }
html[lang="uz"] .lang-switch .flag-ru { display: none; }
html[lang="uz"] .lang-switch .flag-uz { display: inline-flex; }
.lang-chevron { flex: none; color: var(--color-muted); }
/* Выпадающий список языков — тот же вид, что у дропдауна проб рядом. */
.lang-select { position: relative; }
.lang-switch { cursor: pointer; font-family: inherit; }
.lang-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 72px; padding: 6px; margin: 0;
  list-style: none; background: #fff; border: 1px solid var(--color-line); border-radius: 10px; box-shadow: 0 10px 26px #37221826;
}
.lang-dropdown li { padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 650; color: var(--color-ink); cursor: pointer; }
.lang-dropdown li:hover { background: var(--color-cream-deep); }
.lang-dropdown li[aria-selected="true"] { color: #fff; background: var(--color-primary); }
.topbar-phone { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.phone-icon { flex: none; color: var(--color-primary); }
/* Кабинет пока скрыт (правка 25.09: «ещё не готов»); display у ссылки
   перебивает атрибут hidden, поэтому отдельное правило. */
.topbar-cabinet[hidden] { display: none; }
.topbar-social, .topbar-cabinet {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #fff; border: 1px solid var(--color-line); font-size: 12px;
}

.site-nav { background: var(--color-cream); border-top: 1px solid var(--color-line); }
.nav-inner { display: flex; justify-content: space-between; gap: 22px; padding: 12px 20px; overflow-x: auto; font-size: 13px; font-weight: 600; color: var(--color-muted); transition: padding .22s ease; }
.nav-inner a:hover { color: var(--color-primary); }

/* --- Модал заявки --- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay { position: absolute; inset: 0; background: #1c1c1acc; }
.modal-card { position: relative; width: 100%; max-width: 560px; padding: 40px 44px 36px; background: #fff; border-radius: 16px; }
.modal-card h2 { margin-bottom: 8px; font-size: 28px; color: var(--color-brown); }
.modal-card > p { margin-bottom: 24px; color: var(--color-muted); font-size: 15px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--color-muted); cursor: pointer; }
.form-note { min-height: 16px; margin-top: 6px; font-size: 12px; color: var(--color-muted); }
.form-note.error { color: var(--color-danger); }
.form-note.success { color: var(--color-success); }
/* Согласие под кнопкой (как в макете): не чекбокс, а подпись под кнопкой. */
.form-consent-note { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--color-muted); }
.form-consent-note a { color: var(--color-primary); text-decoration: underline; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ============================= Футер ============================= */
.site-footer { color: var(--color-footer-text); background: var(--color-footer); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; padding: 50px 20px 30px; }
.footer-logo { height: 52px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-requisites { font-size: 12px; line-height: 1.6; color: var(--color-footer-muted); white-space: pre-line; }
.footer-col h3 { margin-bottom: 14px; color: #fff; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a, .footer-col li { font-size: 13px; }
.footer-col a:hover { color: #fff; }
.footer-accepted-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
/* Все филиалы по областям: отдельная полоса под колонками подвала. */
.footer-branches-all { padding: 0 20px 30px; }
.footer-branches-regions { columns: 5 200px; column-gap: 30px; }
.fb-region { break-inside: avoid; margin-bottom: 18px; }
.fb-region h4 { margin-bottom: 6px; color: #fff; font-size: 12px; font-weight: 650; }
.fb-region ul { display: flex; flex-direction: column; gap: 4px; }
.fb-region li { font-size: 12px; color: var(--color-footer-muted); }
.footer-phone { display: block; margin-bottom: 4px; font-size: 16px; font-weight: 700; color: #fff; }
.footer-social { display: flex; gap: 10px; margin: 12px 0; }
.footer-social a {
  width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 0; background: var(--color-primary); color: #fff; font-size: 0;
}
.footer-social a svg { width: 18px; height: 18px; display: block; }
.footer-source { font-size: 11px; color: var(--color-footer-muted); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-top: 1px solid #322f2a; font-size: 11px; color: var(--color-footer-muted); }
.footer-legal { display: flex; gap: 14px; }
.footer-legal a { color: inherit; }
.footer-legal a:hover { color: #fff; }

/* --- Брейкпоинты: 1200 / 768 / 420 --- */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .topbar-inner { flex-wrap: wrap; }
  .quote-widget { order: 3; margin-right: 0; width: 100%; justify-content: center; }
  .nav-inner { gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; padding: 36px 20px 24px; }
  .footer-bottom { flex-direction: column; }
}
@media (max-width: 420px) {
  .topbar-actions { gap: 8px; }
  .topbar-social, .lang-switch { display: none; }
  main > h1 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-accepted-list { grid-template-columns: 1fr 1fr; }
}

/* ======================================================================
   Главная страница (Task 9) — hero, калькулятор, цена золота, филиалы,
   CTA-блоки, «как работает», «безопасно», изделия, погашение, доверие,
   хранение. Референс — docs/figma/overview.png (координатор, 2026-08-28).
   ====================================================================== */
main.home { padding: 0; }

.section { padding: 56px 0; scroll-margin-top: var(--header-h, 120px); }
/* Заголовки секций — слева, коричневые, без подзаголовка (docs/figma/calc-28058-347.png:
   H2-блок 70px высоты на всех секциях главной → font-size 48px, вес 800). */
.section-head { max-width: none; margin: 0 0 28px; text-align: left; }
.section-head h2 { font-size: 48px; font-weight: 800; color: var(--color-brown); line-height: 1.1; }
.section-head p { margin-top: 8px; color: var(--color-muted); font-size: 14px; }

/* --- Hero (docs/figma/sections/28058-325.txt: Frame 2 1920x800, контент 100..1820) --- */
.hero { background: var(--color-cream); padding: 30px 0 56px; }
.hero-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; }
/* Текст — по центру орнамента (правка 25.09). align-self центрует по коробке
   картинки, а она укорочена снизу на 21% (картинка уходит под полосу
   ценностей), поэтому центр коробки выше центра орнамента — добираем отступом. */
.hero-content { align-self: center; margin-top: 47px; }
/* На широком экране высоту первого экрана задаёт уже картинка, а не текст:
   центрирование работает, и отступ сдвигает текст вдвое слабее — нужен больше.
   Подобрано замером: центр текста совпадает с центром орнамента ±5 px. */
@media (min-width: 1600px) { .hero-content { margin-top: 158px; } }
.hero-content { flex: 1 1 49%; max-width: 800px; }
.hero-content h1 { font-size: 92px; line-height: 1.15; font-weight: 800; color: var(--color-brown); }
.hero-accent { color: var(--color-primary); }
.hero-subtitle { margin-top: 40px; font-size: 20px; line-height: 1.55; color: var(--color-muted); }
.hero-actions { display: flex; gap: 20px; margin-top: 80px; flex-wrap: wrap; }
.hero-actions .btn { min-height: 60px; padding: 0 24px; gap: 12px; font-size: 16px; }
.hero-btn-arrow { flex: none; }
.hero-actions .pin-icon-lg { margin-left: 2px; }
.hero-actions .btn { border-radius: 12px; min-height: 56px; padding: 14px 26px; }
.hero-actions .btn-secondary {
  color: var(--color-brown); background: transparent; border: 1.5px solid var(--color-brown);
}
.hero-actions .btn-secondary:hover { background: #fff; color: var(--color-brown); border-color: var(--color-brown); }
.hero-actions .btn-secondary .pin-icon::before { background: var(--color-brown); }
.hero-art { flex: 1 1 51%; display: flex; justify-content: center; }
/* Низ орнамента уходит под белую полосу ценностей, как в макете (Frame 2:
   картинка 829, полоса начинается на 147 px выше её низа — это 17,7% высоты).
   Отдаём эти 17,7% отрицательным отступом: высоту первого экрана тогда задаёт
   та колонка, что выше. Если текст длиннее укороченной картинки (узкий экран,
   узбекский), высоту задаёт он — и полоса не наезжает на кнопки. */
.hero-art img { width: 100%; max-width: 829px; height: auto; margin-top: -18px; margin-bottom: -21%; }

/* --- Полоса ценностей: белая карточка под hero-inner, 5 колонок (Frame 1948759188,
   1720x106, отступ 30px, шаг между колонками 340-300=40px) --- */
.hero-values {
  /* position/z-index: полоса перекрывает орнамент — без них картинка (inline)
     рисуется поверх фона следующего блока. */
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px 40px;
  margin-top: 30px; padding: 30px; background: #fff; border-radius: 16px; box-shadow: 0 12px 30px #37221814;
}
.hero-values li { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* Иконки ценностей — национальные орнаменты 46×46 из архива дизайнера
   (assets/icons/values). Орнамент сам заполняет квадрат, поэтому подложки нет. */
.hero-value-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; }
.hero-value-icon img { display: block; width: 46px; height: 46px; }
.hero-values li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-values b { font-size: 15px; font-weight: 700; color: var(--color-ink); }
.hero-values li > span:last-child > span { font-size: 12px; color: var(--color-muted); }

/* --- Утилита: доступно фокусу, визуально скрыто в покое (кнопка «Рассчитать»
   калькулятора — работает без JS/для скринридеров, но не часть пиксельного макета) --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }

/* --- Часы / источник котировки — переиспользуется калькулятором и ценой золота --- */
.icon-clock { position: relative; width: 13px; height: 13px; flex: none; border: 2px solid var(--color-muted); border-radius: 50%; }
.icon-clock::after { content: ''; position: absolute; left: 50%; top: 50%; width: 1px; height: 4px; background: var(--color-muted); transform: translate(-50%, -100%) rotate(25deg); transform-origin: bottom; }
.calc2-footer-row, .price-tiles-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-line); font-size: 12px; color: var(--color-muted); flex-wrap: wrap; }
.calc-quote-date { display: flex; align-items: center; gap: 7px; }
.calc-source-link { font-weight: 650; color: var(--color-primary); }
.calc-source-link:hover { text-decoration: underline; }

/* --- Калькулятор: верхняя строка инфо-карточек --- */
.calc-info-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.calc-info-card { display: flex; align-items: flex-start; gap: 10px; padding: 21px 16px; }
.calc-info-card .pin-icon { margin-top: 3px; }
.calc-info-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc-info-label { font-size: 12px; color: var(--color-muted); }
.calc-info-value { font-size: 14px; font-weight: 700; color: var(--color-primary); }

/* --- Калькулятор: основной блок (слайдеры слева, суммы справа) --- */
/* Доли из макета (docs/figma/crop-calc-price.png): при контейнере 1339
   левая карточка 888, правая 436, промежуток 15. */
.calc2-grid { display: grid; grid-template-columns: 888fr 436fr; gap: 1.12%; align-items: stretch; }
/* min-width:0 — иначе grid-элемент не сжимается меньше содержимого и распирает страницу */
.calc2-grid > * { min-width: 0; }
.calc2-left { padding: 36px 26px; }
.calc2-row-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 22px; font-size: 14px; }
.calc2-row-head:first-child { margin-top: 0; }
.calc2-row-head span { font-weight: 650; }
.calc2-row-head b { font-size: 17px; font-weight: 800; }

/* --- Слайдеры: оранжевый залитый трек слева от бегунка (--fill управляется JS) --- */
.calc-slider-wrap { margin-top: 10px; }
.calc-slider-wrap input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 8px 0; border-radius: 99px; outline: none;
  background: linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) var(--fill, 0%), var(--color-line) var(--fill, 0%), var(--color-line) 100%);
}
.calc-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  background: var(--color-primary); border: 3px solid #fff; box-shadow: 0 2px 6px #37221840;
}
.calc-slider-wrap input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--color-line); }
.calc-slider-wrap input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--color-primary); }
.calc-slider-wrap input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; background: var(--color-primary); border: 3px solid #fff; box-shadow: 0 2px 6px #37221840; }
.calc-slider-ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--color-muted); }

/* --- Elastic slider (superdesign): захват — бегунок увеличивается и тень мягче;
   перетаскивание за пределы диапазона — трек упруго растягивается (--elastic-scale/
   --elastic-origin выставляет site.js по pointermove, значение остаётся клампленным
   самим input'ом — растяжение чисто визуальное); отпускание — пружинный возврат
   (.is-releasing, cubic-bezier с перелётом). В покое --elastic-scale не задан →
   scaleX(1) = identity, трек выглядит как раньше. */
.calc-slider-wrap input[type="range"] {
  transform: scaleX(var(--elastic-scale, 1));
  transform-origin: var(--elastic-origin, 50%) center;
  transition: transform .15s ease;
}
.calc-slider-wrap.is-releasing input[type="range"] { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.calc-slider-wrap input[type="range"]::-webkit-slider-thumb { transition: transform .15s ease, box-shadow .15s ease; }
.calc-slider-wrap input[type="range"]::-moz-range-thumb { transition: transform .15s ease, box-shadow .15s ease; }
.calc-slider-wrap.is-active input[type="range"]::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 4px 14px #37221833; }
.calc-slider-wrap.is-active input[type="range"]::-moz-range-thumb { transform: scale(1.15); box-shadow: 0 4px 14px #37221833; }

/* --- Значение рядом со слайдером («40 г» / «10 дней») — пружинка при отпускании
   (site.js вешает/снимает класс по событию change, не на каждый input-тик). --- */
.calc-value-pop { animation: calc-value-pop .2s ease; }
@keyframes calc-value-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* --- Проба: 4 кнопки-таба --- */
.calc-purity-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.calc-purity-tab { padding: 12px; background: #fff; border: 1px solid var(--color-line); border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--color-ink); cursor: pointer; transition: background-color .12s ease, color .12s ease, border-color .12s ease; }
.calc-purity-tab:hover { background: #ecdfc7; }
.calc-purity-tab.is-active { background: var(--color-primary); color: #fff; }
.calc-purity-note { margin-top: 8px; font-size: 12px; color: var(--color-muted); }

/* --- Промокод: компактное поле под слайдером срока --- */
.calc-promo-row { margin-top: 8px; }
.calc-promo-input {
  width: 100%; max-width: 220px; padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--color-ink);
  background: #fff; border: 1px solid var(--color-line); border-radius: 8px; text-transform: uppercase;
}
.calc-promo-input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.calc-promo-status { min-height: 15px; margin-top: 6px; font-size: 12px; color: var(--color-muted); }
.calc-promo-status.applied { color: var(--color-success); font-weight: 650; }

/* --- Правая колонка: одно гнездо (белый card + кремовый max + детализация),
   как в Figma 28058-347 — не две отдельные карточки. --- */
.calc2-right { display: flex; flex-direction: column; min-height: 0; }
.calc-result-nest {
  flex: 1; display: flex; flex-direction: column; padding: 0; overflow: hidden;
  border-radius: 16px;
}
.calc-pay-btn { margin-top: auto; }
.calc-max-card {
  margin: 16px 16px 0; padding: 20px 22px; background: var(--color-cream-deep);
  border-radius: 12px; border: 0; box-shadow: none;
}
.calc-max-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.calc-max-label { display: block; font-size: 13px; font-weight: 650; color: var(--color-muted); }
.calc-max-value { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.calc-max-value b { font-size: 34px; font-weight: 800; color: var(--color-primary); }
.calc-max-value .calc-max-unit { font-size: 14px; font-weight: 700; color: var(--color-muted); }
.calc-max-meta { max-width: 180px; margin-top: 2px; font-size: 11px; line-height: 1.5; color: var(--color-muted); text-align: right; }

.calc-detail-card {
  flex: 1; display: flex; flex-direction: column; padding: 18px 24px 24px;
  border: 0; box-shadow: none; background: transparent;
}
.calc-detail-row { display: flex; align-items: baseline; gap: 6px; padding: 7px 0; font-size: 13px; }
.calc-detail-row span { order: 0; color: var(--color-muted); white-space: nowrap; }
.calc-detail-row::after { content: ''; order: 1; flex: 1 1 auto; margin-bottom: 4px; border-bottom: 1px dotted var(--color-line); }
.calc-detail-row b { order: 2; white-space: nowrap; font-weight: 700; }
.calc-detail-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--color-line); font-size: 16px; font-weight: 700; }
.calc-detail-total b { font-size: 21px; color: var(--color-primary); }
.calc-pay-btn { width: 100%; margin-top: 18px; min-height: 52px; border-radius: 12px; }
.calc-pay-btn b { font-weight: 800; }

/* --- Нижняя строка: экономия / рыночная стоимость / акция --- */
.calc-bottom-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.calc-bottom-card { display: flex; align-items: center; gap: 16px; padding: 24px 20px; }
.calc-bottom-sign { flex: none; width: 48px; height: 48px; object-fit: contain; }
.calc-bottom-card p { font-size: 13px; line-height: 1.5; color: var(--color-muted); }
.calc-bottom-card p b { color: var(--color-ink); font-weight: 700; }

/* --- Цена золота: две карточки (плитки проб + график изменения) --- */
.price-cards-row { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
.price-tiles-card, .price-chart-card { padding: 24px; display: flex; flex-direction: column; }
/* minmax(0,1fr), не 1fr — иначе колонка не сжимается уже своего min-content
   (длинная ссылка «График изменения цен» без переноса распирала бы страницу
   на узких экранах), см. также .price-tile-link без white-space:nowrap ниже. */
/* График убран (правка 25.09) — плитки на всю ширину, четыре в ряд. */
.price-tiles-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; flex: 1; }
@media (max-width: 900px) { .price-tiles-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* --- Плитка пробы: кнопка (клик переключает график справа), активная — заливка primary --- */
.price-tile { width: 100%; padding: 16px; background: var(--color-cream-deep); border: 0; border-radius: var(--radius); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background-color .15s ease; }
.price-tile:hover { background: #ecdfc7; }
.price-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; }
.price-tile-purity { font-size: 12px; font-weight: 650; color: var(--color-muted); }
.price-tile-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--color-primary); }
.price-tile-value-row { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }
.price-tile-value { font-size: 22px; font-weight: 800; color: var(--color-primary); }
.price-tile-unit { font-size: 12px; font-weight: 650; color: var(--color-muted); }
.price-tile.is-active { background: var(--color-primary); }
.price-tile.is-active .price-tile-purity, .price-tile.is-active .price-tile-value, .price-tile.is-active .price-tile-unit { color: #fff; }
.price-tile.is-active .price-tile-link { color: #ffffffcc; }
.price-tile.is-active:hover { background: var(--color-primary); }
.price-tiles-empty { grid-column: 1 / -1; align-self: center; padding: 20px; text-align: center; font-size: 13px; color: var(--color-muted); }

.price-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.price-chart-head h3 { font-size: 16px; font-weight: 750; }
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.chart-tabs .city-tab { padding: 7px 12px; font-size: 12px; }
.price-chart-body { flex: 1; min-height: 260px; transition: opacity .15s ease; }
.price-chart-body.is-switching { opacity: 0; }
.price-chart-body svg { display: block; width: 100%; height: auto; }
.price-chart-empty { display: flex; align-items: center; justify-content: center; min-height: 260px; font-size: 13px; color: var(--color-muted); }
.price-chart-axis-label { font-size: 11px; fill: var(--color-muted); }
.price-chart-x-label { font-size: 11px; fill: var(--color-muted); }
.price-chart-tooltip-bg { fill: var(--color-ink); }
.price-chart-tooltip-text { font-size: 11px; fill: #fff; font-weight: 650; }
.price-chart-tooltip-change-up { fill: #8fe0a8; }
.price-chart-tooltip-change-down { fill: #f0a898; }

/* --- Филиалы — список + карточка (без Яндекс.Карт). initBranches() на главной
   и /contacts. .section уже даёт вертикальный паддинг — на главной contacts-
   паддинг обнуляем. --- */
.section .contacts-branches-root { padding: 0; }
.branches-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.branches-toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.branches-search { position: relative; flex: 0 0 auto; }
.branches-search-icon { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.branches-search input { padding-right: 38px; }
/* --- Круглая кнопка-иконка: моё местоположение / маршрут (тулбар главной и
   действия карточки выбранного филиала — тот же класс, разный контекст). --- */
.icon-btn-round { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: var(--color-ink); background: #fff; border: 1px solid var(--color-line); border-radius: 50%; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.icon-btn-round:hover { color: var(--color-primary); border-color: var(--color-primary); }
.branches-note { font-size: 12px; color: var(--color-muted); }
.branches-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.branches-list:hover, .branches-list:focus-within { scrollbar-color: var(--color-line) transparent; }
.branches-list::-webkit-scrollbar { width: 6px; }
.branches-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.branches-list:hover::-webkit-scrollbar-thumb, .branches-list:focus-within::-webkit-scrollbar-thumb { background: var(--color-line); }
.branch-card { padding: 14px 16px; }
.branch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.branch-card-head h3 { font-size: 15px; font-weight: 700; color: var(--color-brown); }
.branch-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.branch-address, .branch-distance { font-size: 13px; color: var(--color-muted); }
/* Карта: MapLibre GL рисует внутрь .branches-map свой canvas; фон-орнамент
   виден, пока карта грузится, и остаётся подложкой у fallback-заглушки. */
.branches-map { min-height: 420px; border-radius: var(--radius); overflow: hidden; background: var(--color-cream-deep) center/220px no-repeat url('/shared/ornament-hurma.png'); border: 1px solid var(--color-line); display: flex; align-items: center; justify-content: center; }
.branches-map-fallback { max-width: 260px; padding: 20px; text-align: center; font-size: 13px; color: var(--color-muted); background: #fffc; border-radius: var(--radius); }
/* Метка филиала — капля: по ней кликают, и она подсвечивается, когда филиал
   выбран (в списке или на самой карте). Точка была плоским кружком 14px —
   заказчик просил каплю с откликом на клик. */
.map-pin {
  padding: 0; border: 0; background: none; line-height: 0; cursor: pointer;
  color: var(--color-primary);
  filter: drop-shadow(0 2px 4px #37221833);
  transition: transform .15s ease, color .15s ease;
  transform-origin: 50% 100%;
}
.map-pin:hover { transform: scale(1.12); }
/* Своя точка на карте — синяя, как принято в картах, чтобы не путать с филиалами. */
.map-user-dot {
  width: 16px; height: 16px; border-radius: 50%; background: #2f6fed;
  border: 3px solid #fff; box-shadow: 0 0 0 4px #2f6fed33, 0 2px 6px #37221833;
}
.map-pin:focus-visible { outline: 2px solid var(--color-brown); outline-offset: 2px; border-radius: 4px; }
.map-pin.is-active { color: var(--color-brown); transform: scale(1.2); z-index: 2; }

/* --- CTA-блоки (оранжевые, с орнаментом) --- */
/* CTA по макету — оранжевая карточка внутри контейнера, не полоса во всю ширину */
.cta-section { padding: 28px 0; }
.cta-section > .container { position: relative; overflow: hidden; padding: 52px 44px; border-radius: 20px; background: var(--color-primary); color: #fff; }
.cta-section > .container::before {
  content: ''; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background: url('/shared/suzani.webp') center/480px repeat; mix-blend-mode: soft-light;
}
.cta-inner { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.cta-text h2 { font-size: 40px; font-weight: 800; line-height: 1.15; }
.cta-text p { margin-top: 12px; max-width: 420px; font-size: 14px; opacity: .92; }
.cta-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.cta-steps li { display: flex; align-items: center; gap: 16px; font-size: 14px; }
/* Жёлтый квадрат номера (docs/figma/sections/28058-674.txt: Frame 1 46x46 →
   пропорция сохранена, у нас 28x28 под текущий межстрочный ритм списка) --- */
.cta-step-num { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: var(--color-primary); font-weight: 800; font-size: 14px; }
.cta-alt-phone { margin-top: 22px; font-size: 13px; line-height: 1.7; }
.cta-alt-phone a { font-size: 26px; font-weight: 800; }
/* --- Форма: белая карточка (не стекло на оранжевом, как раньше) --- */
.cta-form { position: relative; padding: 28px; background: #fff; border-radius: 16px; }
.cta-form .field span { color: var(--color-muted); }
.cta-form .field input, .cta-form .field select, .cta-form .field textarea { background: var(--color-cream-deep); border: 0; border-radius: 8px; }
.cta-form .field textarea { height: 90px; resize: vertical; }
.cta-form .field-checkbox { color: var(--color-muted); }
.cta-form .field-checkbox a { color: var(--color-primary); text-decoration: underline; }
.cta-form .btn-primary { width: 100%; min-height: 56px; border-radius: 12px; font-size: 16px; }
.cta-form .form-note.error { color: var(--color-danger); }
.cta-inner-center { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.cta-inner-center p { max-width: 560px; }
.cta-section-alt > .container { padding: 44px; }

/* --- Как работает ломбард --- */
/* --- Как работает ломбард: 6 белых карточек 3×2, docs/figma/sections/28058-759.txt
   (степпер-линия и стрелки-разделители из прежней 4-шаговой раскладки убраны —
   в макете их нет). --- */
.how-steps-wrap { position: relative; }
/* list-style/padding — global reset снимает их только с ul, не с ol (см. верх
   файла); карточки теперь на белом фоне, дефолтные «1.»/«2.» маркеры браузера
   стали заметны рядом с ними — глушим явно (раньше эта область была не видна
   на фоне страницы, поэтому не мешала). */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; padding: 0; margin: 0; }
.how-step { background: #fff; border: 1px solid var(--color-line); border-radius: 16px; padding: 24px; box-shadow: 0 5px 18px #37221809; text-align: center; }
.how-photo {
  width: 220px; height: 220px; margin: 0 auto 16px; border-radius: 50%; position: relative;
  background: #E4E1DA center/cover no-repeat;
  overflow: visible;
}
.how-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.how-num {
  position: absolute; top: -4px; right: -4px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary); color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px #37221826;
}
.how-step h3 { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--color-brown); }
.how-step p { margin-top: 6px; font-size: 12px; color: var(--color-muted); }
/* hover — та же логика lift+тень, что и у .card:hover, применена к фото (сам
   .how-step несёт .reveal со своим transition на transform для scroll-появления). */
.how-photo { transition: transform .18s ease, box-shadow .18s ease; }
.how-step:hover .how-photo { transform: translateY(-3px); box-shadow: 0 8px 20px #37221826; }
.how-num { transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); }

/* --- Номера шагов: появляются по очереди (задержка 120мс/шаг — site.js), scale(.8)→1 + fade. --- */
html.js-motion .how-num { opacity: 0; transform: scale(.8); }
html.js-motion .how-step.is-visible .how-num { opacity: 1; transform: scale(1); }

/* --- Иконка-плашка: круглый нейтральный символ, переиспользуется в «Вам
   понадобится», «Получение денег» и карточке банковской задолженности. --- */
.icon-plate { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 60px; height: 60px; border-radius: 50%; background: #fff3ec; color: var(--color-primary); font-size: 22px; }
.icon-plate-sm { width: 46px; height: 46px; font-size: 17px; }
/* --- Кремовый квадрат с пином: общий для «Почему это безопасно», «Получение
   денег», «Безопасность хранения» (см. task «ОБЩЕЕ» — единый .icon-tile). --- */
.icon-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; background: var(--color-cream-deep); border-radius: 10px; }
/* Иконка-картинка (блок «Безопасность хранения»): плашка нарисована внутри
   самого SVG, кремовая подложка под ней только вылезала бы по углам. */
img.icon-tile { background: none; }

/* --- Вам понадобится / Получение денег: docs/figma/sections/28058-837.txt --- */
.requirements-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.requirements-col h2 { font-size: 22px; font-weight: 750; margin-bottom: 20px; }
/* Белый кружок 46px с пином — тонкая линия между строками вместо gap (padding
   на самих строках, а не margin, — линия идёт по всей ширине колонки). */
.requirements-list { display: flex; flex-direction: column; }
.icon-plate-white { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px #37221812; }
.requirements-item { display: flex; align-items: center; gap: 18px; padding: 16px 0; }
.requirements-item:first-child { padding-top: 0; }
.requirements-item + .requirements-item { border-top: 1px solid var(--color-line); }
.requirements-item h3 { font-size: 16px; font-weight: 700; color: var(--color-brown); }
.requirements-item p { margin-top: 4px; font-size: 13px; color: var(--color-muted); }
.requirements-note { margin-top: 22px; font-size: 12px; line-height: 1.6; color: var(--color-muted); }

.getmoney-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.getmoney-card { padding: 20px; }
.getmoney-card h3 { margin-top: 14px; font-size: 15px; font-weight: 700; color: var(--color-brown); }
.getmoney-card p { margin-top: 6px; font-size: 13px; color: var(--color-muted); }
.getmoney-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 18px; }
.getmoney-check { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; }
.check-icon { flex: none; color: var(--color-primary); }

/* --- Клиентам с банковской задолженностью --- */
/* --- Клиентам с банковской задолженностью: docs/figma/sections/28058-895.txt —
   оранжевый блок (не кремовая карточка, как раньше) с белой карточкой-формой
   справа, тот же приём орнамента, что и у .cta-section. --- */
/* --- Продукты Hurma (#products) — вместо блока про банковскую задолженность --- */
.section-subtitle { margin-top: 10px; font-size: 15px; color: var(--color-muted); }
.products-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-top: 4px solid var(--color-primary); }
.product-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.product-head h3 { font-size: 20px; font-weight: 800; color: var(--color-brown); }
.product-num { font-size: 14px; font-weight: 700; color: var(--color-primary); }
.product-range { font-size: 14px; color: var(--color-muted); }
.product-rate { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 12px; }
.product-rate b { font-size: 40px; line-height: 1; font-weight: 800; color: var(--color-primary); }
.product-rate span { font-size: 14px; color: var(--color-muted); }
.product-month { margin-top: auto; padding: 10px 14px; border-radius: 10px; background: var(--color-primary); color: #fff; font-weight: 700; text-align: center; }
.products-cta { display: flex; justify-content: center; margin-top: 24px; }
@media (max-width: 1200px) { .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .products-grid { grid-template-columns: 1fr; } }

.debt-card { position: relative; overflow: hidden; padding: 44px; border-radius: 20px; background: var(--color-primary); color: #fff; display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.debt-card::before { content: ''; position: absolute; inset: 0; opacity: .16; pointer-events: none; background: url('/shared/suzani.webp') center/420px repeat; mix-blend-mode: soft-light; }
.debt-content, .debt-action { position: relative; }
.debt-content h2 { font-size: 36px; font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.debt-content p { font-size: 14px; line-height: 1.6; opacity: .92; }
.debt-content p u { text-decoration-color: #fff; }
.debt-action { padding: 24px; border-radius: 16px; }
.debt-info { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; padding: 18px; background: var(--color-cream-deep); border-radius: var(--radius); font-size: 13px; line-height: 1.55; color: var(--color-muted); }
.debt-info-icon { flex: none; font-size: 16px; line-height: 1; color: var(--color-primary); }
.debt-action .btn { width: 100%; }
.debt-consent { margin-top: 12px; font-size: 11px; color: var(--color-muted); }
.debt-consent a { color: var(--color-primary); text-decoration: underline; }

/* --- Почему это безопасно: docs/figma/sections/28058-768.txt --- */
.safety-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.safety-card { padding: 24px; border-radius: 16px; }
.safety-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.safety-num { font-size: 20px; font-weight: 700; color: var(--color-line); }
.safety-card h3 { margin-top: 14px; font-size: 16px; font-weight: 700; color: var(--color-brown); }
.safety-card p { margin-top: 6px; font-size: 12px; color: var(--color-muted); }

/* --- Погашение / получение денег --- */

/* --- Почему нам доверяют: docs/figma/sections/28058-1134.txt — до 5 карточек в
   ряд, но часть скрыта, пока не заполнена настройка (trust_*) — auto-fit сам
   стягивает ряд под то, что реально показано (2–5 карточек), без брейкпоинтов. --- */
.trust-section { padding: 40px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; text-align: center; }
.trust-item { padding: 24px; border-radius: 16px; }
.trust-number { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.trust-number b { font-size: 36px; font-weight: 800; color: var(--color-primary); }
.trust-number small { font-size: 14px; font-weight: 700; color: var(--color-primary); }
.trust-item span { display: block; margin-top: 6px; font-size: 12px; color: var(--color-muted); }

/* --- Безопасность хранения: docs/figma/sections/28058-1142.txt —
   3 колонки: фото | фото | 4 карточки (615+615+450), равная высота ~632. --- */
.storage-grid {
  display: grid; grid-template-columns: 1.37fr 1.37fr 1fr; gap: 20px; align-items: stretch;
}
.storage-photo {
  position: relative; min-height: 520px; border-radius: 16px; overflow: hidden;
  background: var(--color-cream-deep) center/60% no-repeat url('/shared/ornament-hurma.png');
}
.storage-photo.has-photo { background-size: cover; background-position: center; }
.storage-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.storage-cards { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.storage-card {
  flex: 1; display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; border-radius: 16px;
}
.storage-card h3 { font-size: 15px; font-weight: 700; color: var(--color-brown); }
.storage-card p { margin-top: 4px; font-size: 12px; color: var(--color-muted); }

/* --- Брейкпоинты главной: 1200 / 768 / 420 --- */
@media (max-width: 1200px) {
  .section-head h2 { font-size: 40px; }
  .hero-content h1 { font-size: 56px; }
  .hero-actions { margin-top: 40px; }
  .hero-art img { max-width: 420px; }
  .hero-values { grid-template-columns: repeat(3, 1fr); }
  .storage-grid { grid-template-columns: 1fr 1fr; }
  .storage-cards { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .storage-photo { min-height: 360px; }
}
@media (max-width: 900px) {
  .how-grid, .safety-grid { grid-template-columns: repeat(2, 1fr); }
  .how-photo { width: 160px; height: 160px; }
  .branches-map { min-height: 280px; }
  .calc-info-row { grid-template-columns: repeat(2, 1fr); }
  .calc2-grid { grid-template-columns: 1fr; }
  .calc-bottom-row { grid-template-columns: 1fr; }
  .price-cards-row { grid-template-columns: 1fr; }
  .requirements-columns { grid-template-columns: 1fr; gap: 32px; }
  .debt-card { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* На узком экране блоки идут друг под другом — перекрывать нечего. */
  .hero-inner { flex-direction: column-reverse; text-align: center; gap: 24px; }
  .hero-content { margin-top: 0; }
  .hero-content { max-width: none; }
  .hero-content h1 { font-size: 40px; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; margin-top: 28px; }
  .hero-art img { max-width: 300px; margin-top: 0; margin-bottom: 0; }
  .hero-values { grid-template-columns: repeat(2, 1fr); padding: 20px; gap: 18px 20px; }
  .cta-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .cta-text p { margin-left: auto; margin-right: auto; }
  .storage-grid { grid-template-columns: 1fr; }
  .storage-photo { min-height: 260px; height: 260px; }
  .trust-grid { gap: 22px 16px; }
  .getmoney-cards { grid-template-columns: 1fr; }
  .getmoney-checks { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .section { padding: 40px 0; }
  .section-head h2 { font-size: 26px; }
  .hero-content h1 { font-size: 32px; }
  .hero-art img { max-width: 240px; }
  .hero-values { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .how-photo { width: 140px; height: 140px; }
  .safety-grid { grid-template-columns: 1fr; }
  .trust-number b { font-size: 24px; }
  .cta-form { padding: 16px; }
  .calc-info-row { grid-template-columns: 1fr; }
  .calc-purity-tabs { grid-template-columns: 1fr 1fr; }
  .calc-max-top { flex-direction: column; }
  .calc-max-meta { text-align: left; max-width: none; }
  .debt-card { padding: 26px; }
  /* «сум за грамм» на плитке пробы — иначе рвётся по словам на 3 строки
     (тесная плитка 2-в-ряд): не переносим фразу внутри себя и мельче шрифт;
     flex-wrap на строке — запасной путь, если значение+юнит всё же не влезут
     в одну строку, юнит уйдёт целиком на вторую, а не разорвётся сам. */
  .price-tile-value-row { flex-wrap: wrap; }
  .price-tile-unit { font-size: 11px; white-space: nowrap; }
}

/* ======================================================================
   Внутренние страницы (Task 10) — FAQ, отзывы, блог, статья, контакты, 404.
   main.page — как main.home: сам не даёт вертикальный паддинг, спейсинг
   держат вложенные .page-head/.section/.cta-section (тот же приём, что и
   на главной). Референс — docs/figma/contacts-28087-3916.png (контакты,
   детально) и overview.png (FAQ/отзывы/блог, структура), координатор 2026-08-28.
   ====================================================================== */
main.page { padding: 0; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; padding-top: 18px; font-size: 12px; color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

.page-head { padding-top: 22px; padding-bottom: 8px; }
.page-head h1 { font-size: 30px; font-weight: 750; }
.page-head p { margin-top: 10px; max-width: 640px; color: var(--color-muted); font-size: 14px; }

/* --- /accepted «Какие изделия принимаем»: docs/figma/pdf-assets страница 15 —
   5 колонок × 2 ряда, фото + подпись + ссылка «Подробнее», без карточек-рамок. --- */
.items-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 32px 20px; padding: 24px 0 40px; }
.item-card { display: flex; align-items: center; gap: 14px; }
.item-card img { flex: none; width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.item-card-body h3 { font-size: 15px; font-weight: 700; color: var(--color-ink); }
.item-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--color-primary); }
.item-more:hover { text-decoration: underline; }
@media (max-width: 1200px) { .items-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .items-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .items-grid { grid-template-columns: 1fr; } }

/* --- FAQ: pill-табы категорий (реюз .city-tabs/.city-tab контактов) + две
   колонки аккордеона активной категории на нативных <details> --- */
.faq-tabs { margin-bottom: 24px; }
.faq-columns { columns: 2; column-gap: 30px; }
.faq-status { color: var(--color-muted); font-size: 14px; }
.faq-item { break-inside: avoid; border-bottom: 1px solid var(--color-line); padding: 12px 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex: none; font-size: 18px; line-height: 1; color: var(--color-primary); }
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--color-muted); }

/* --- Отзывы --- */
.reviews-status { color: var(--color-muted); font-size: 14px; }
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.review-card { padding: 18px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-author { font-size: 14px; font-weight: 700; }
.review-stars { font-size: 14px; letter-spacing: 1px; color: var(--color-primary); }
.review-text { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--color-ink); }
.review-date { margin-top: 14px; font-size: 11px; color: var(--color-muted); }
.reviews-more-wrap { display: flex; justify-content: center; margin-top: 22px; }
.review-photos-block { margin-top: 40px; }
.review-photos-block h2 { font-size: 20px; font-weight: 750; }
.review-photos-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 16px; }
.review-photo-placeholder { aspect-ratio: 1; border-radius: var(--radius); background: var(--color-cream-deep) center/50% no-repeat url('/shared/ornament-hurma.png'); }

/* --- Блог --- */
.blog-status { color: var(--color-muted); font-size: 14px; }
.blog-status:empty { display: none; }
.blog-featured-card { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-bottom: 22px; }
.blog-featured-cover { aspect-ratio: 16/10; background: var(--color-cream-deep) center/40% no-repeat url('/shared/ornament-hurma.png'); }
.blog-featured-cover img, .blog-card-cover img, .post-cover img, .branch-selected-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-featured-body { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.blog-date { font-size: 12px; font-weight: 650; color: var(--color-muted); }
.blog-featured-body h2 { margin-top: 8px; font-size: 22px; font-weight: 750; }
.blog-featured-body p { margin-top: 10px; font-size: 14px; color: var(--color-muted); }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.blog-card { overflow: hidden; }
.blog-card-cover { aspect-ratio: 16/10; background: var(--color-cream-deep) center/34% no-repeat url('/shared/ornament-hurma.png'); }
.blog-card-body { padding: 16px; }
.blog-card-body h3 { margin-top: 6px; font-size: 15px; font-weight: 700; }
.blog-card-body p { margin-top: 6px; font-size: 13px; color: var(--color-muted); }
.blog-more-wrap { display: flex; justify-content: center; margin-top: 24px; }

/* --- Статья (post.html) --- */
.post-article { max-width: 760px; padding-top: 26px; padding-bottom: 8px; }
.post-date { margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--color-muted); }
.post-cover { margin-top: 18px; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--color-cream-deep) center/30% no-repeat url('/shared/ornament-hurma.png'); }
.post-status { color: var(--color-muted); font-size: 14px; }
.post-body { margin-top: 22px; font-size: 15px; line-height: 1.7; color: var(--color-ink); }
.post-body h2 { margin-top: 28px; margin-bottom: 10px; font-size: 20px; font-weight: 750; }
.post-body p { margin-top: 12px; }
.post-body p:first-child, .post-body h2:first-child { margin-top: 0; }
.post-body ul { margin-top: 12px; padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 6px; }
.post-body a { color: var(--color-primary); text-decoration: underline; }
.post-related { margin-top: 12px; padding-top: 32px; padding-bottom: 24px; border-top: 1px solid var(--color-line); }
.post-related h2 { margin-bottom: 16px; font-size: 20px; font-weight: 750; }

/* --- 404 --- */
main.page-404 { padding: 0; }
.notfound { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 90px 20px; text-align: center; }
.notfound img { width: 120px; height: 120px; opacity: .85; }
.notfound h1 { font-size: 26px; font-weight: 750; }
.notfound p { max-width: 420px; color: var(--color-muted); font-size: 14px; }
.notfound .btn { margin-top: 8px; }

/* --- Контакты: карточки телефоны/мессенджеры/часы --- */
.contacts-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 22px 0 6px; }
.contact-info-card { padding: 20px; }
.contact-info-card h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 14px; font-weight: 700; }
.pin-icon { position: relative; width: 13px; height: 13px; flex: none; }
.pin-icon::before { content: ''; position: absolute; inset: 0; border-radius: 50% 50% 50% 0; background: var(--color-primary); transform: rotate(-45deg); }
.pin-icon-lg { width: 24px; height: 24px; }
.contact-info-item { margin-top: 12px; }
.contact-info-item:first-of-type { margin-top: 0; }
.contact-value { display: block; font-size: 15px; font-weight: 700; color: var(--color-primary); }
.contact-label { display: block; margin-top: 2px; font-size: 12px; color: var(--color-muted); }

/* --- Контакты: поиск + табы городов + список/карта/карточка --- */
.contacts-branches-root { padding: 30px 0 40px; }
/* Тулбар повторяет сетку ряда под ним: поиск над списком, лента регионов над
   картой, кнопки над карточкой филиала (в макете они выровнены по вертикали).
   Высота 39 при контейнере 1324 в макете — это 2.95%, на 1720 даёт 51 px. */
.contacts-branches-root .branches-toolbar { display: grid; grid-template-columns: 363fr 903fr 406fr; gap: 24px; align-items: stretch; height: calc(min(var(--container), 100vw - 40px) * 0.0295); min-height: 44px; }
.contacts-branches-root .branches-search { flex: none; }
.contacts-branches-root .branches-search input { height: 100%; }
.contacts-branches-root .branches-toolbar-actions { margin-left: 0; justify-content: flex-end; }
.contacts-branches-root .branches-toolbar-actions .btn-primary { height: 100%; white-space: nowrap; }
.contacts-branches-root .icon-btn-round { height: 100%; aspect-ratio: 1; width: auto; }
.branches-search input { width: 100%; padding: 10px 14px; font-family: inherit; font-size: 13px; background: #fff; border: 1px solid var(--color-line); border-radius: 8px; }
.branches-search input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
/* Лента регионов: одна строка с горизонтальной прокруткой — регионов 14, в
   несколько рядов они распирают тулбар. Полоса прокрутки скрыта, у правого
   края мягкое затухание — намёк, что лента продолжается. */
/* В макете это один белый блок с сегментами внутри, а не отдельные пилюли:
   активный сегмент залит кремовым. Регионов 14, в ширину карты они не влезают —
   отсюда горизонтальная прокрутка со скрытой полосой и затуханием у края. */
.city-tabs { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 3px; background: #fff; border-radius: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; cursor: grab; }
.city-tabs::-webkit-scrollbar { display: none; }
.city-tabs.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.city-tabs.is-dragging .city-tab { pointer-events: none; }

/* Обёртка держит маску затухания: у самой ленты она уезжала бы вместе со скроллом. */
.city-tabs-wrap { position: relative; min-width: 0; display: flex; }
.city-tabs-wrap .city-tabs { flex: 1; min-width: 0; }
/* Затухание у краёв — тоже по стороне, куда есть ход. */
.city-tabs-wrap.can-right .city-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.city-tabs-wrap.can-left.can-right .city-tabs { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.city-tabs-wrap.can-left:not(.can-right) .city-tabs { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
.city-tab { flex: none; display: inline-flex; align-items: center; white-space: nowrap; padding: 0 13px; font-size: 12.5px; font-weight: 650; color: var(--color-ink); background: transparent; border: 0; border-radius: 8px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.city-tab:hover { background: var(--color-cream); }
.city-tab.active { color: var(--color-brown); background: var(--color-cream-deep); }
/* Три колонки одной высоты (иначе низ секции рваный: у списка, карты и
   карточки филиала своя высота). Высоту ряда задаёт карта, список скроллится
   внутри своей колонки. */
/* Пропорции ряда сняты с макета (docs/figma/crop-map-cta-how.png): при
   контейнере 1324 px список 280, карта 695, карточка 312, промежутки 18,
   высота 436 — то есть 21.1% / 52.5% / 23.6% и высота 32.9% от контейнера.
   На 1720 px это 363 / 903 / 406 при gap 24 и высоте 566. */
.contacts-branches-layout { display: grid; grid-template-columns: 363fr 903fr 406fr; align-items: stretch; gap: 24px; margin-top: 16px; }
/* Высота ряда — те же 32.9% ширины контейнера, что и в макете (436 при 1324).
   Считаем от фактической ширины контейнера (min(--container, вьюпорт минус
   его паддинги)), а не через aspect-ratio на карте: карта — grid-элемент,
   и её пропорция замкнулась бы сама на себя. */
.contacts-branches-layout .branches-map { min-height: 0; }
.contacts-branches-layout .branch-selected-card { height: 100%; }
/* Карточка филиала тянется на всю высоту колонки: фото сверху фиксированной
   пропорции, текстовая часть занимает остаток. */
.contacts-branches-layout .branch-selected { display: flex; flex-direction: column; height: 100%; }
.contacts-branches-layout .branch-selected-photo { flex: none; }
.contacts-branches-layout .branch-selected-body { flex: 1; display: flex; flex-direction: column; }
.contacts-branches-layout .branch-selected-actions { margin-top: auto; }
/* Высоту ряда задаёт список: его пропорция из макета (363 ширина × 566 высота),
   поэтому соотношение держится на любой ширине контейнера. Считать высоту от
   карты нельзя — она grid-элемент с канвасом внутри, пропорция замкнулась бы
   сама на себя. Внутри списка свой скролл: филиалов больше сотни. */
.contacts-branches-layout .branches-list { max-height: none; min-height: 0; aspect-ratio: 363 / 566; }
.contacts-branches-layout .branch-selected-card { min-height: 0; overflow-y: auto; }
.contacts-branches-layout .branch-card.selectable { position: relative; cursor: pointer; transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease, border-color .15s ease, background-color .15s ease; }
/* hover — дополняет (не дублирует) общий .card:hover lift+shadow: тут только
   акцент цветом рамки/фона, существующим primary. */
.contacts-branches-layout .branch-card.selectable:hover { border-color: var(--color-primary); background: #fff8f3; }
/* Левая полоса-акцент у выбранного филиала — псевдоэлемент есть у ВСЕХ selectable
   карточек постоянно (scaleY(0), невидим), .selected лишь меняет transform — так
   переход плавный (см. .selected::before), а не мгновенное появление/исчезновение. */
.contacts-branches-layout .branch-card.selectable::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--color-primary); transform: scaleY(0); transform-origin: center; transition: transform .18s ease;
}
.contacts-branches-layout .branch-card.selected { border-color: var(--color-primary); }
.contacts-branches-layout .branch-card.selected::before { transform: scaleY(1); }

/* --- Главная (docs/figma/sections/28058-532.txt): активная карточка — кремовый
   фон + рамка 1px, без левой полосы-акцента с /contacts (#branchesRoot — выше
   специфичность общих .contacts-branches-layout правил выше). --- */
#branchesRoot .branch-card.selectable::before { display: none; }
#branchesRoot .branch-card.selected { background: var(--color-cream-deep); }

/* --- Animated list (superdesign): stagger-появление карточек (site.js — delay
   70мс/индекс, .branch-card-enter снимается на следующем кадре) при первой
   отрисовке и смене фильтра; уход старых карточек fade+translateY(-6px) перед
   перерисовкой. Транзишен объявлен один раз здесь (opacity/transform/box-shadow —
   box-shadow с тем же таймингом, что и в базовом .card, иначе более специфичный
   селектор ниже перебил бы transition целиком и сломал плавность hover-тени). --- */
.branches-list .branch-card { transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease; }
.branches-list .branch-card.branch-card-enter { opacity: 0; transform: translateY(8px); transition: none; }
.branches-list .branch-card.branch-card-leave { opacity: 0; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease; }
.branch-selected-card:empty { display: none; }
.branch-selected { overflow: hidden; }
.branch-selected-photo { position: relative; aspect-ratio: 16/10; max-height: 280px; background: var(--color-cream-deep) center/34% no-repeat url('/shared/ornament-hurma.png'); }
/* Точки-индикаторы фотокарусели — сейчас всегда одна точка (branches.photo —
   одно поле в схеме, не массив), см. renderSelectedCard/site.js. */
.photo-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.photo-dots span { width: 6px; height: 6px; border-radius: 50%; background: #ffffff80; }
.photo-dots span.is-active { background: #fff; }
.branch-selected-body { padding: 16px; }
.branch-selected-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.branch-selected-head h3 { font-size: 16px; font-weight: 700; color: var(--color-brown); }
/* --- Строки с иконками: часы / телефон / расстояние / статус --- */
.branch-info-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.branch-info-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-ink); }
.branch-info-row .icon-clock, .branch-info-row svg { flex: none; color: var(--color-muted); }
.branch-selected-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.branch-selected-call { flex: 1; text-align: center; }

/* --- Брейкпоинты внутренних страниц: 1200 / 900 / 768 / 420 --- */
@media (max-width: 1200px) {
  .contacts-branches-layout { gap: 16px; }
}
@media (max-width: 900px) {
  .faq-columns { columns: 1; }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .review-photos-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-featured-card { grid-template-columns: 1fr; }
  .contacts-branches-layout { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .contacts-branches-layout .branches-list { height: auto; max-height: 420px; aspect-ratio: auto; }
  .contacts-branches-layout .branches-map { min-height: 280px; }
  .contacts-branches-layout .branch-selected-card:not(:empty) { grid-column: 1 / -1; }
  .branch-selected-card { position: static; }
}
@media (max-width: 768px) {
  .contacts-info-grid { grid-template-columns: 1fr; }
  /* Тулбар филиалов в колонку — и на главной, и на контактах (иначе поиск + табы городов распирают экран) */
  .branches-toolbar { flex-direction: column; align-items: stretch; }
  .branches-search, .city-tabs { width: 100%; }
  .branches-search input { max-width: none; }
  .branches-toolbar-actions { margin-left: 0; }
  .branches-toolbar-actions { flex-wrap: wrap; width: 100%; }
  .branches-toolbar-actions .btn-primary { flex: 1 1 100%; }
  /* Блок про банковскую задолженность: две колонки не влезают на телефон */
  .debt-card { grid-template-columns: 1fr; padding: 28px 20px; gap: 22px; }
  .debt-content h2 { font-size: 26px; }
  .contacts-branches-layout { grid-template-columns: 1fr; }
  .contacts-branches-layout .branch-selected-card:not(:empty) { grid-column: auto; }
}
@media (max-width: 420px) {
  .page-head h1 { font-size: 24px; }
  .reviews-grid { grid-template-columns: 1fr; }
  .review-photos-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   Микроанимации (site-motion) — только transition/animation/opacity/
   transform поверх существующей вёрстки. Цвета/размеры/отступы/порядок
   элементов не трогаем — в покое (после загрузки, без hover) страница
   выглядит как раньше.
   ====================================================================== */

/* --- Появление при скролле: элементы .reveal невидимы ТОЛЬКО когда JS
   поставил <html class="js-motion"> инлайн-скриптом в <head> (см. каждую
   страницу). Без класса (JS выключен/не загрузился) — всё видно сразу. --- */
.reveal { transition: opacity .45s cubic-bezier(.22,.61,.36,1), transform .45s cubic-bezier(.22,.61,.36,1); }
html.js-motion .reveal { opacity: 0; transform: translateY(12px); }
html.js-motion .reveal.is-visible { opacity: 1; transform: none; }

/* --- Отклик на касание --- */
.card { transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #37221818; }

.btn { transition: transform .1s ease; }
.btn:active { transform: scale(.98); }

.city-tab { transition: background-color .12s ease; }
.city-tab:hover:not(.active) { background: var(--color-cream-deep); }

.nav-inner a { position: relative; }
.nav-inner a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--color-primary); transition: width .2s ease;
}
.nav-inner a:hover::after { width: 100%; }

/* --- Скелетоны загрузки: серые плейсхолдеры с shimmer, JS создаёт их до
   ответа API и убирает при отрисовке реальных данных (см. site.js). --- */
.skeleton { position: relative; overflow: hidden; background: var(--color-line); border-radius: 6px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, #ffffff9c 50%, transparent);
  background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.skeleton-text { display: inline-block; width: 60px; height: 12px; vertical-align: middle; }
.skeleton-line { display: block; height: 12px; margin-top: 8px; }
.skeleton-line:first-child { margin-top: 0; }

/* --- Спиннер в кнопке (Рассчитать / Отправить заявку) во время fetch --- */
.btn-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid #ffffff66; border-top-color: #fff;
  animation: btn-spinner-spin .6s linear infinite;
}
.btn-secondary .btn-spinner { border-color: #e8500a55; border-top-color: var(--color-primary); }
@keyframes btn-spinner-spin { to { transform: rotate(360deg); } }
.btn.is-loading { cursor: progress; }

/* --- FAQ: плавное раскрытие (max-height вместо мгновенного show/hide; grid-rows
   0fr→1fr здесь не берём — при auto-высоте контейнера fr-трек не разворачивается
   по контенту во всех окружениях, max-height надёжнее). 300px с запасом на
   самый длинный ответ FAQ (несколько строк текста). --- */
.faq-item-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-item[open] .faq-item-body { max-height: 300px; }

/* --- Кроссфейд контента: смена таба города / категории FAQ --- */
.faq-columns, .branches-list { transition: opacity .15s ease; }
.faq-columns.is-switching, .branches-list.is-switching { opacity: 0; }

/* --- Модал заявки: fade + scale --- */
.modal-overlay { opacity: 0; transition: opacity .2s ease; }
.modal-card { opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .2s cubic-bezier(.22,.61,.36,1); }
.modal.is-open .modal-overlay { opacity: 1; }
.modal.is-open .modal-card { opacity: 1; transform: scale(1); }

/* --- Тост (общий с паттерном admin/cabinet: тёмная плашка снизу по центру) --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; padding: 14px 22px; border-radius: 10px;
  background: var(--color-ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px #00000033;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Статус филиала «свободно»: мягкая пульсация --- */
@keyframes badge-free-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.badge-status.free { animation: badge-free-pulse 2.4s ease-in-out infinite; }

/* --- Фокус с клавиатуры (сейчас колец не было почти нигде) --- */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* --- prefers-reduced-motion: обнуляем анимации, .reveal сразу видим --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  html.js-motion .reveal { opacity: 1 !important; transform: none !important; }
  /* Task 2 (stepper): номера — сразу в конечном виде, не ждём scroll-triggered .is-visible */
  html.js-motion .how-num { opacity: 1 !important; transform: scale(1) !important; }
  /* Task 1 (elastic slider): без пружины/растяжения — обычный range */
  .calc-slider-wrap input[type="range"] { transform: none !important; }
}

/* Иконки в шапке: SVG вместо текстовых заглушек, цвет наследуется */
.topbar-social svg, .topbar-cabinet svg { display: block; }
.topbar-social, .topbar-cabinet { color: var(--color-ink); }
.topbar-social:hover, .topbar-cabinet:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* Мобильный: строки расчёта калькулятора не должны распирать экран — значение переносится на свою строку */
@media (max-width: 520px) {
  .calc-detail-row { flex-wrap: wrap; }
  .calc-detail-row b { white-space: normal; }
}

/* --- Навигация: активный пункт подсвечивается цветом. Треугольник-указатель
   под пунктом убран по просьбе заказчика. Класс .is-active ставит scrollspy
   в site.js. --- */
@media (min-width: 901px) {
  .nav-inner { overflow: visible; }
  .nav-inner a.is-active { color: var(--color-brown); }
}

/* --- Шапка по макету: три колонки (логотип | виджет котировки | действия),
   виджет — строго по центру страницы, а не между соседями. На узких экранах
   остаётся flex с переносом (см. @media 768). --- */
@media (min-width: 901px) {
  .topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .topbar-inner .quote-widget { margin: 0; justify-self: center; }
  .topbar-inner .topbar-actions { justify-self: end; }
}

/* Модал заявки — крупнее по просьбе заказчика: поля 52px, кнопка на всю ширину */
.modal-card label { font-size: 14px; }
.modal-card input:not([type=checkbox]), .modal-card select, .modal-card textarea { min-height: 52px; font-size: 16px; padding: 12px 16px; }
.modal-card .btn { width: 100%; min-height: 52px; font-size: 16px; }
@media (max-width: 600px) { .modal-card { padding: 28px 20px 24px; } .modal-card h2 { font-size: 22px; } }

@media (max-width: 768px) { .cta-section > .container { padding: 32px 20px; border-radius: 16px; } }


#branchesRoot .city-tab.active, .contacts-branches-root .city-tab.active {
  color: var(--color-brown); background: var(--color-cream-deep); border-color: transparent;
}
.branch-selected { animation: branch-selected-in .28s ease; }
@keyframes branch-selected-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nav-inner a { color: var(--color-brown); }
.icon-glyph { width: 20px; height: 20px; display: block; color: var(--color-primary); }
.icon-tile .icon-glyph, .icon-plate-white .icon-glyph { margin: auto; }

/* --- Ссылка на элемент (раздел, вопрос, карточка, отзыв) --------------------
   Кнопка-звено рядом с заголовком: не мозолит глаза, но доступна с клавиатуры
   и на тач-экранах, где наведения нет, — там показываем её всегда. */
.permalink-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: 8px; padding: 0;
  color: var(--color-muted); background: none; border: 0; border-radius: 50%;
  cursor: pointer; opacity: 0; transition: opacity .15s ease, color .15s ease;
}
h2 .permalink-btn, h3 .permalink-btn { vertical-align: middle; }
:is(h2, h3, summary, .review-card-head, .branch-selected-head):hover > .permalink-btn,
.permalink-btn:focus-visible { opacity: 1; }
.permalink-btn:hover { color: var(--color-primary); }
.permalink-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
@media (hover: none) { .permalink-btn { opacity: .55; } }

/* Подсветка блока, на который привела ссылка. */
.permalink-target { animation: permalink-flash 2.2s ease; }
@keyframes permalink-flash {
  0%, 60% { background-color: rgba(120, 48, 23, .07); }
  100% { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) { .permalink-target { animation: none; } }
