/* ==========================
   ТЕМА И БАЗА
   ========================== */
:root {
  --header-bottom-h: 50px;
  --header-h: 146px;
  --header-h-compact: 96px;
  --header-h-mobile: 128px;
  --hero-pad-top: 108px;
  --hero-pad-bottom: 70px;
  --hero-pad-top-mobile: 56px;
  --hero-pad-bottom-mobile: 28px;
  --hero-min-h: 820px;
  --hero-min-h-mobile: 600px;
  --bg: radial-gradient(ellipse at center, #0d2f1a 0%, #1a2d3a 25%, #0f1419 50%, #0a0d14 75%, #000000 100%);
  --bg-solid: #0a0d14;
  --panel: rgba(23, 26, 32, 0.85);
  --muted: #8b93a7;
  --text: #eef2ff;
  --brand: #6aa7ff;
  --ok: #3ddc97;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --sp: 20px;
  --wrap-pad-x: 20px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  /* скрыть горизонтальный скролл от редких «широких» дочерних блоков (grid/flex min-width:auto) */
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  /* блокируем горизонтальные свайпы/панораму viewport */
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

a {
  color: var(--brand);
  text-decoration: none
}

a:hover {
  opacity: .9
}

/* КАРТОЧКИ/ОБЩЕЕ */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: max(var(--wrap-pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--wrap-pad-x), env(safe-area-inset-right, 0px));
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.muted {
  color: var(--muted)
}

h2 {
  font-size: 28px;
  margin: 0 0 14px
}

section {
  padding: 40px 0
}

/* КНОПКИ (cta / pill) */
:is(button, a).cta,
:is(button, a).pill {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

:is(button, a).cta {
  background: var(--brand);
  color: #fff
}

:is(button, a).cta:hover {
  background: #4c8dff
}

:is(button, a).pill {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .12)
}

:is(button, a).pill:hover {
  background: rgba(255, 255, 255, .18)
}

/* ИКОНКИ */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: 18px;
  transition: background .2s ease, color .2s ease;
}

.icon-link:hover {
  background: rgba(255, 255, 255, .18);
  color: var(--brand)
}

.icon-max {
  display: block;
  flex-shrink: 0;
}

.contact-channel .icon-max {
  width: 20px;
  height: 20px;
}

/* компактная круглая иконка для строк контактов */
.icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .12);
}

/* УТИЛИТЫ СЕТОК */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

@media (max-width:880px) {
  .grid-2 {
    grid-template-columns: 1fr
  }
}

/* ==========================
   ХЕДЕР
   ========================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  /* якорь для мобильной панели (.mobile-nav-panel, top: 100%) */
  isolation: isolate;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.header-top {
  backdrop-filter: saturate(180%) blur(15px);
  background: radial-gradient(ellipse at center, rgba(13, 47, 26, .9) 0%, rgba(26, 45, 58, .85) 25%, rgba(15, 20, 25, .8) 50%, rgba(10, 13, 20, .75) 75%, rgba(0, 0, 0, .7) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 0
}

.brand-title {
  font-weight: 700;
  letter-spacing: .4px
}

/* Регион с гербом */
.region {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.city-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.city {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.region-sub {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
  color: var(--muted);
}

nav a {
  margin: 0 12px;
  padding: 10px 8px;
  border-radius: 10px;
  color: #dce3ff
}

nav a:hover {
  background: rgba(255, 255, 255, .06)
}

.burger {
  display: none;
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #cfe2ff;
  padding: 8px 10px;
  border-radius: 10px
}

.contacts-block {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto
}

.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

#phoneTop {
  white-space: nowrap
}

/* «и Самарская область» */
header .brand .region .city {
  font-size: .8em;
  opacity: .95;
  margin-top: 2px
}

header .brand .region .region-sub {
  font-size: .6em;
  opacity: .75;
  margin-top: 2px
}

/* ==========================
   HERO
   ========================== */
.hero-section {
  position: relative;
  isolation: isolate;
  background: url("/static/img/ceilings/main_picture.JPG") center/cover no-repeat;
}

body:has(.hero-section) .hero-section {
  min-height: max(var(--hero-min-h), 72vh);
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(13, 47, 26, .32) 0%, rgba(26, 45, 58, .38) 25%, rgba(15, 20, 25, .45) 50%, rgba(10, 13, 20, .52) 75%, rgba(0, 0, 0, .58) 100%);
}

@media (min-width:881px) {
  .hero-section {
    background-attachment: fixed
  }

  /* На главной: фон hero заходит под прозрачный ряд навигации */
  body:has(.hero-section) .hero-section {
    margin-top: calc(-1 * var(--header-bottom-h));
  }

  body:has(.hero-section) .hero {
    padding-top: calc(var(--hero-pad-top) + var(--header-bottom-h));
  }
}

.hero {
  position: relative;
  z-index: 1;
  padding-top: var(--hero-pad-top);
  padding-bottom: var(--hero-pad-bottom);
}

/* Hero layout without fixed inline flex-basis on mobile */
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}

.hero-main,
.hero-aside {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 640px) {
  .hero-main {
    flex: 1 1 420px;
  }

  .hero-aside {
    flex: 1 1 320px;
  }
}

.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 10px 0 14px;
  font-weight: 700;
}

.hero p.lead {
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
}

.hero .hero-cta {
  margin-top: 22px
}

.hero .cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.hero .card strong {
  font-weight: 700;
}

/* ==========================
   ОТЗЫВЫ
   ========================== */
.reviews {
  position: relative
}

.slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  overflow: hidden
}

.review {
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 160px;
  backdrop-filter: blur(8px);
}

.review .who {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #222;
  overflow: hidden
}

.nav-btns {
  display: flex;
  gap: 10px;
  margin-left: auto
}

.review .text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.8em;
}

.review.expanded .text {
  -webkit-line-clamp: unset;
  max-height: none
}

.nav-btns button {
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #cfe2ff;
  padding: 10px 12px;
  border-radius: 10px
}

/* ==========================
   КОНТАКТЫ
   ========================== */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px
}

@media (max-width:880px) {
  .contact {
    grid-template-columns: 1fr
  }
}

.contact-card {
  padding: 18px
}

.contact-title {
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 10px
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-top: 8px
}

.contact-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center
}

.contact-row .ico {
  composes: icon-circle;
}

/* если PostCSS нет — просто оставьте класс .icon-circle на элементе */
.contact-row .val a {
  color: var(--brand)
}

.contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 420px) {
  .contact-actions {
    grid-template-columns: 1fr;
  }
}

/* Единый вид: мессенджеры и соцсети — одна сетка, одинаковые «плитки» */
.contact-channel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

.contact-channel:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .2);
  opacity: 1;
}

.contact-channel i {
  font-size: 18px;
  flex-shrink: 0;
}

.contact-channel span {
  line-height: 1.25;
}

.contact-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px
}

/* Поля формы контактов (локально для секции #contact, чтобы не конфликтовать с калькулятором) */
#contact .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px
}

#contact .field input,
#contact .field textarea {
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  outline: none;
  font-size: 15px;
  min-height: 40px;
}

#contact .field :is(input, textarea):focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 167, 255, .20);
}

/* пара inputs в две колонки */
#contact .grid-two {
  composes: grid-2;
}

#contact .agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 4px 0 0;
}

#contact .agree input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

#contact .agree a {
  color: var(--brand);
  text-decoration: underline;
}

/* ==========================
   ПОДВАЛ
   ========================== */
footer {
  padding: 28px 0;
  color: #b7c3e6
}

/* === НАЧАЛО: СТИЛИ ДЛЯ БЛОКА "НАШИ ПРЕИМУЩЕСТВА" === */
#advantages {
  padding-top: 20px;
}

.adv-intro {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.adv-intro p {
  margin: 0 0 12px;
}

/* Горизонтальная сетка преимуществ — 6 колонок на ПК */
.adv-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

/* Каждый элемент преимущества */
.adv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.adv-item:hover {
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .05));
}

/* Иконка преимущества */
.adv-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: 24px;
  color: var(--brand);
}

/* Текст преимущества */
.adv-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 400;
}

.adv-title strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
}

/* Адаптив: 3 колонки на планшетах */
@media (max-width: 1024px) {
  .adv-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Адаптив: 2 колонки на мобильных */
@media (max-width: 600px) {
  .adv-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .adv-item {
    padding: 16px 10px;
  }

  .adv-ico {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-bottom: 10px;
  }

  .adv-title {
    font-size: 12px;
  }

  .adv-title strong {
    font-size: 14px;
  }
}

/* === КОНЕЦ: СТИЛИ ДЛЯ БЛОКА "НАШИ ПРЕИМУЩЕСТВА" === */

/* ==========================
   АДАПТИВ (общий)
   ========================== */
@media (max-width:880px) {
  :root {
    --header-h: var(--header-h-mobile);
    --wrap-pad-x: 24px;
  }

  body:has(.hero-section) .hero-section {
    min-height: max(var(--hero-min-h-mobile), 62vh);
  }

  .hero .cards {
    grid-template-columns: 1fr
  }

  .slider {
    grid-template-columns: 1fr
  }

  header .cta {
    display: none
  }

  .hero {
    padding-top: var(--hero-pad-top-mobile);
    padding-bottom: var(--hero-pad-bottom-mobile);
  }

  .hero p.lead {
    font-size: 16px
  }

  .card {
    padding: 14px
  }

  /* калькулятор адаптируется в своём calc.css */
}

/* Toast — всплывашку делаем аккуратной и скрытой по умолчанию */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: none;
  /* показывается через JS showToast() */
  padding: 10px 14px;
  background: radial-gradient(ellipse at center, rgba(13, 47, 26, .95) 0%, rgba(26, 45, 58, .9) 25%, rgba(15, 20, 25, .95) 50%, rgba(10, 13, 20, .95) 75%, rgba(0, 0, 0, .95) 100%);
  color: #eef2ff;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  z-index: 1001;
}

.header-bottom .wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.header-bottom nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

/* === Верхняя строка: центрируем бренд, слева контакты/cta, справа иконки === */
.header-top {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Левый блок (телефон + кнопка) */
.left-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  /* подстраивается под содержимое */
}

.phone-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* Ссылка телефона */
.phone-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Акцентная кнопка "Вызвать замерщика" */
.cta-measurer {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(106, 167, 255, 0.12);
  transition: transform .12s ease, box-shadow .12s ease;
}

.cta-measurer:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(106, 167, 255, 0.14);
}

/* Бренд по центру: используем auto margin для надёжного центрирования */
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}

/* Правая часть — иконки (оставляем поведение прежним) */
.contacts-block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

/* === Фон и оформление нижней строки (header-bottom) === */

.header-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width:881px) {
  html.header-nav-compact .header-bottom,
  header.header-scrolled .header-bottom {
    display: none !important;
  }

  html.header-nav-compact,
  html:has(header.header-scrolled) {
    scroll-padding-top: var(--header-h-compact);
  }

  html.header-nav-compact body,
  html:has(header.header-scrolled) body {
    padding-top: var(--header-h-compact);
  }

  body:has(.hero-section) header.header-scrolled .header-top,
  html.header-nav-compact body:has(.hero-section) .header-top {
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
}

/* На внутренних страницах — привычная подложка */
body:not(:has(.hero-section)) .header-bottom {
  background: radial-gradient(ellipse at center, rgba(13, 47, 26, 0.7) 0%, rgba(26, 45, 58, 0.5) 25%, rgba(15, 20, 25, 0.4) 50%, rgba(10, 13, 20, 0.6) 75%, rgba(0, 0, 0, 0.8) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* На главной — прозрачный ряд, виден верх hero-картинки */
body:has(.hero-section) .header-bottom {
  background: transparent;
  border-top: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body:has(.hero-section) .header-top {
  border-bottom: none;
  box-shadow: none;
}

body:has(.hero-section) .header-bottom nav a {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
}

/* Ограничение содержимого так же, как .wrap */
.header-bottom .wrap {
  padding: 8px max(var(--wrap-pad-x), env(safe-area-inset-right, 0px)) 8px max(var(--wrap-pad-x), env(safe-area-inset-left, 0px));
}

/* Сами ссылки внутри нижней строки */
.header-bottom nav a {
  color: #e8efff;
  padding: 8px 10px;
  border-radius: 8px;
}

.header-bottom nav a:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* === Адаптив: шапка — верхний ряд: бургер | бренд | тема; ниже телефон и CTA === */
@media (max-width:880px) {
  .header-bottom {
    display: none;
  }

  .wrap.row.header-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 12px;
    align-items: center;
    justify-items: stretch;
  }

  .header-top .burger {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
  }

  .header-top .burger svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .header-top .brand {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    margin-right: 0;
    justify-self: center;
    text-align: center;
    padding: 4px 0;
    max-width: 100%;
    min-width: 0;
  }

  .header-top .brand>a {
    flex-shrink: 0;
  }

  .header-top .region {
    align-items: center;
    text-align: center;
    min-width: 0;
  }

  .header-top .city-row {
    justify-content: center;
  }

  .header-top .contacts-block {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin-left: 0;
    padding-bottom: 0;
  }

  .contacts-block>* {
    flex-shrink: 0;
  }

  /* Соцсети в шапке — только в выезжающем меню */
  .contacts-block .header-social {
    display: none;
  }

  .left-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
  }

  .phone-link {
    white-space: normal;
    word-break: break-word;
    padding: 4px 6px;
    font-size: 0.95rem;
    text-align: center;
  }

  .cta-measurer {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
  }

  .header-top .contacts-block .icon-link {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 19px;
  }

  .header-top .contacts-block #themeToggle {
    display: inline-flex;
    margin-left: 0;
  }

  /* Затемнение контента; ниже шапки (header z-index: 50) */
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1;
    background: radial-gradient(ellipse at center, rgba(13, 47, 26, 0.96) 0%, rgba(26, 45, 58, 0.92) 35%, rgba(10, 13, 20, 0.96) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-panel__nav {
    display: flex;
    flex-direction: column;
    padding: 12px 20px 16px;
    gap: 4px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .mobile-nav-panel__nav a {
    display: block;
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #e8efff;
    text-decoration: none;
  }

  .mobile-nav-panel__nav a:hover,
  .mobile-nav-panel__nav a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
  }

  .mobile-nav-panel__social {
    padding: 0 20px 18px;
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-panel__social-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 14px 0 10px;
  }

  .mobile-nav-panel__social-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .mobile-nav-panel__social-icons .icon-link {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 20px;
  }

  .burger[aria-expanded="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(106, 167, 255, 0.35);
  }

  /* Пока открыто меню: шапка над затемнением — второй клик по бургеру доходит до кнопки */
  html.is-mobile-nav-open header {
    z-index: 60;
  }

  html.is-mobile-nav-open .mobile-nav-backdrop {
    z-index: 55;
  }
}

@media (min-width: 881px) {

  .mobile-nav-backdrop,
  .mobile-nav-panel {
    display: none !important;
  }
}

/* При очень узком экране — уменьшаем размер логотипа */
@media (max-width:420px) {
  #logo {
    height: 48px !important;
  }

  .region .city {
    font-size: 0.75rem;
  }
}

/* Кнопка "Наверх" — фиксируется по центру внизу экрана */
.back-to-top {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  /* изначально скрыта (см. .visible ниже) */
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(106, 167, 255, 0.15));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform .28s cubic-bezier(.2, .9, .2, 1), opacity .18s ease, background .12s ease;
  opacity: 0;
  z-index: 1200;
  /* выше хедера при необходимости */
  pointer-events: none;
  /* пока скрыта */
  backdrop-filter: blur(8px);
}

/* видимая */
.back-to-top.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* hover / focus */
.back-to-top:hover,
.back-to-top:focus {
  transform: translateX(-50%) translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(106, 167, 255, 0.25));
  outline: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* маленькая адаптация для узких экранов */
@media (max-width:480px) {
  .back-to-top {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
}

/* Тёмная/светлая тема — тонкая адаптация цвета фона кнопки */
:root[data-theme="light"] .back-to-top {
  background: rgba(15, 17, 21, 0.06);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ==========================
   ЛАЙТБОКС (разметка в base.html; на главной раньше не было CSS — блок «тянул» высоту внизу страницы)
   ========================== */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .88);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox-modal .lightbox-content {
  max-width: min(90vw, 1200px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.lightbox-modal .close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: color .2s ease;
}

.lightbox-modal .close:hover,
.lightbox-modal .close:focus {
  color: #ccc;
}

.lightbox-modal .lightbox-navigation .prev,
.lightbox-modal .lightbox-navigation .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 36px;
  user-select: none;
  z-index: 2;
  transition: color .2s ease;
}

.lightbox-modal .lightbox-navigation .prev {
  left: 12px;
}

.lightbox-modal .lightbox-navigation .next {
  right: 12px;
}

.lightbox-modal .lightbox-navigation .prev:hover,
.lightbox-modal .lightbox-navigation .next:hover {
  color: #ccc;
}

.lightbox-modal .lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 16px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, .5);
  border-radius: 8px;
  z-index: 2;
}

.container.blurred {
  filter: blur(5px);
  transition: filter .3s ease;
}

@media (max-width: 600px) {
  .lightbox-modal .lightbox-content {
    max-width: 94vw;
    max-height: 65vh;
  }

  .lightbox-modal .close {
    font-size: 28px;
    top: 10px;
    right: 14px;
  }

  .lightbox-modal .lightbox-navigation .prev,
  .lightbox-modal .lightbox-navigation .next {
    font-size: 28px;
    padding: 8px 12px;
  }
}