/* ============================================================
   Дом Абхазия — продажа домов у моря
   Стиль: Exaggerated Minimalism (маркетплейс недвижимости)
   Палитра: trust-teal #0F766E + professional-blue #0369A1 + amber
   Шрифты: Playfair Display (дисплей) / Manrope (текст) — с кириллицей
   ============================================================ */

:root {
  --teal-900: #0c3a36;
  --teal-800: #0d4f49;
  --teal: #0f766e;
  --teal-500: #14b8a6;
  --teal-300: #5fd6c6;
  --blue: #0369a1;
  --blue-600: #075e8c;
  --amber: #e0a52a;
  --amber-600: #c4880f;
  --ink: #0e2a27;
  --muted: #4f6a64;
  --bg: #f3fbf8;
  --bg-2: #e8f5f0;
  --card: #ffffff;
  --line: #d6e8e2;
  --white: #ffffff;
  --shadow: 0 22px 48px -22px rgba(12, 58, 54, .45);
  --shadow-sm: 0 10px 24px -14px rgba(12, 58, 54, .45);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.1;
  color: var(--teal-900);
  margin: 0;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }

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

.skip-link {
  position: absolute; left: -999px; top: 12px;
  background: var(--teal-900); color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 16px;
  padding: 12px 22px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn--lg { padding: 15px 30px; font-size: 17px; }
.btn--sm { padding: 9px 16px; font-size: 14.5px; }
.btn--block { width: 100%; }

.btn--cta { background: var(--blue); color: #fff; }
.btn--cta:hover { background: var(--blue-600); box-shadow: 0 10px 22px -12px rgba(3,105,161,.8); }

.btn--gold { background: var(--amber); color: #2a1d05; }
.btn--gold:hover { background: var(--amber-600); color: #fff; }

.btn--outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn--outline:hover { background: var(--teal); color: #fff; }

.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px;
}

/* ---------- Eyebrow / sections ---------- */
.eyebrow {
  display: inline-block; font-weight: 800; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--amber);
}
.eyebrow--dark { color: var(--teal); }

.section { padding: 92px 0; }
.section--tint { background: var(--bg-2); }

/* Faint image backdrops for content sections */
#why, #how { position: relative; isolation: isolate; overflow: hidden; }
#why::before, #how::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .11;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
#why::before {
  background: url("../img/panorama.jpg") center bottom / cover no-repeat;
  background: image-set(url("../img/panorama.webp") type("image/webp"), url("../img/panorama.jpg") type("image/jpeg"))
              center bottom / cover no-repeat;
}
#how::before {
  background: url("../img/beach.jpg") center center / cover no-repeat;
  background: image-set(url("../img/beach.webp") type("image/webp"), url("../img/beach.jpg") type("image/jpeg"))
              center center / cover no-repeat;
}
.section__head { max-width: 640px; margin: 0 auto 50px; text-align: center; }
.section__title { font-size: clamp(30px, 5vw, 50px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 12px; }
.section__sub { color: var(--muted); font-size: 18px; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 16px 0; transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease;
}
.navbar.is-scrolled {
  background: rgba(243, 251, 248, .92); backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px -16px rgba(12,58,54,.6); padding: 10px 0;
}
.navbar__inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand__mark { color: var(--amber); }
.brand__text { font-family: "Playfair Display", serif; font-size: 21px; color: var(--teal-900); }
.brand--light .brand__text { color: #fff; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-weight: 600; font-size: 15.5px; color: var(--teal-900); transition: color .2s ease; }
.nav a:not(.nav__cta):hover { color: var(--blue); }
.nav__cta { color: #fff !important; }

/* Navbar sits over the photo hero: light text until scrolled */
.navbar:not(.is-scrolled) .brand__text { color: #fff; }
.navbar:not(.is-scrolled) .nav a:not(.nav__cta) { color: #fff; }
.navbar:not(.is-scrolled) .nav a:not(.nav__cta):hover { color: var(--amber); }
.navbar:not(.is-scrolled) .nav-toggle { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.42); }
.navbar:not(.is-scrolled) .nav-toggle span { background: #fff; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  width: 44px; height: 44px; align-items: center; justify-content: center;
  background: rgba(12,58,54,.06); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--teal-900); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }

/* ---------- Hero (aerial map as background) ---------- */
.hero {
  position: relative; display: flex; align-items: flex-end; isolation: isolate;
  /* Высота следует пропорции фона (1920×1080): картинка видна целиком и
     «растягивается вниз» вместе с шириной, без обрезки и без искажения.
     min-height — страховка для узких экранов, чтобы текст помещался. */
  aspect-ratio: 1920 / 1080; min-height: 560px;
  padding: 150px 0 7vh;
  background: var(--teal-900);
}
/* Бокс на весь hero: фон показывается полностью (без cover-обрезки).
   Точки в % внутри привязаны к изображению целиком. */
.hero__map {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0;
}
/* Холст с самой картой. На десктопе совпадает с .hero__map; на узких экранах
   становится шире экрана и превращает .hero__map в область свайпа (см. ниже). */
.hero__canvas { position: absolute; inset: 0; }
/* Layer stack (bottom → top): aerial photo · dark scrim · markers */
.hero__bg, .hero__scrim {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.hero__bg {
  z-index: 0;
  background: url("../img/back2.png") top center / 100% auto no-repeat;
  background: image-set(url("../img/back2.webp") type("image/webp"), url("../img/back2.png") type("image/png"))
              top center / 100% auto no-repeat;
}
/* No dark wash — only a soft blend into the page below (see ::after) */
.hero__scrim {
  z-index: 1;
  background: none;
}
.hero__scrim::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5.5%;
  background: linear-gradient(180deg, transparent, var(--bg));
}
.hero__labels {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__map-label {
  position: absolute;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(12px, 1.2vw, 18px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(168, 186, 178, .6);
  text-shadow:
    0 0 10px rgba(6, 24, 23, .6),
    0 1px 3px rgba(6, 24, 23, .55),
    1px 1px 0 rgba(10, 33, 31, .38),
    6px 8px 16px rgba(6, 24, 23, .36);
  -webkit-text-stroke: .3px rgba(233, 243, 239, .28);
}
.hero__map-label--stavropol {
  top: 9%;
  right: 2%;
}
.hero__map-label--krasnodar {
  top: 6%;
  left: 3%;
}
.hero__map-label--karachay {
  top: 6%;
  left: 30%;
}
.hero__map-label--georgia {
  right: 6%;
  bottom: 8%;
  color: rgba(152, 170, 162, .62);
}
/* Крупная разреженная надпись «АБХАЗИЯ», изогнутая дугой по верху кадра */
.hero__wordmark {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; overflow: visible;
  filter: drop-shadow(0 2px 7px rgba(6, 24, 23, .5));
  /* Ручная настройка надписи «АБХАЗИЯ» — крутите эти значения в DevTools:
     translate(X, Y) = положение · rotate(deg) = наклон (+ по часовой) · scale() = масштаб */
  transform: translate(-27%, 0%) rotate(16deg) scale(1.1);
  transform-origin: center center;
}
.hero__wordmark text {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  font-size: 34px;            /* единицы viewBox 1920 — чуть крупнее подписей */
  letter-spacing: 116px;      /* разреженные буквы на всю длину подсвеченной области */
  fill: rgba(240, 248, 244, .5);
}
/* Ориентир на карте: иконка + маленькая подпись (напр. Новый Афон) */
.hero__landmark {
  position: absolute; z-index: 2; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(6, 24, 23, .55));
}
.hero__landmark img { display: block; width: 46px; height: 46px; }
.hero__landmark__t {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(10px, .95vw, 13px); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  color: rgba(236, 245, 241, .95);
  text-shadow: 0 0 8px rgba(6, 24, 23, .75), 0 1px 2px rgba(6, 24, 23, .6);
}
.hero__landmark--athos { left: 46%; top: 44%; }

/* Города на карте: точка/кружок + подпись, цвет = амбра текста «Виллы…» */
/* Выше маркеров (2) и активного маркера (3): подписи городов не перекрываются домиками */
.hero__cities { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.hero__city {
  position: absolute; transform: translateY(-50%);
  display: flex; align-items: center; gap: 7px; color: var(--amber);
}
.hero__dot {
  flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 1px 3px rgba(6, 24, 23, .65);
}
.hero__dot--ring {
  position: relative; background: transparent;
  border: 2.5px solid var(--amber); box-shadow: 0 1px 3px rgba(6, 24, 23, .5);
}
.hero__dot--ring::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; border-radius: 50%; background: var(--amber);
  transform: translate(-50%, -50%);
}
.hero__dot--pt { width: 7px; height: 7px; }
.hero__airport { color: var(--amber); filter: drop-shadow(0 1px 2px rgba(6, 24, 23, .7)); }
.hero__city__t {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(10px, .9vw, 13px); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(6, 24, 23, .85), 0 1px 2px rgba(6, 24, 23, .7);
}
.hero__city--sochi  { left: 0%;  top: 14%; }
.hero__city--adler  { left: 2%;  top: 18%; }
.hero__city--gagra  { left: 8%;  top: 22%; }
.hero__city--sukhum { left: 49%; top: 48%; }
.hero__city--sukhum .hero__city__t { font-size: clamp(14px, 1.35vw, 18px); }
/* ---------- Hero markers (объекты на карте) ---------- */
.hero__markers {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
}
/* Маркер: якорится нижним «остриём» точно в заданную % точку фото */
.hmk {
  position: absolute; transform: translate(-50%, -100%);
  padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: auto; -webkit-tap-highlight-color: transparent;
  /* Лёгкая тень, повторяющая контур домика (без бейджа) */
  filter: drop-shadow(0 1px 1.5px rgba(6, 24, 23, .55)) drop-shadow(0 0 2px rgba(6, 24, 23, .45));
}
/* Внутренний слой — лёгкий 3D-разворот фасадом к наблюдателю */
.hmk__body {
  transform: perspective(360px) rotateY(-22deg) rotateX(7deg);
  transform-origin: bottom center;
  transition: transform .2s ease;
}
.hmk:hover .hmk__body,
.hmk:focus-visible .hmk__body,
.hmk.is-active .hmk__body {
  transform: perspective(360px) rotateY(0deg) rotateX(0deg) scale(1.09);
}
.hmk:focus-visible { outline: none; }
/* Только контур дома (тонкая линия №16): без фона, рамки и заливки */
.hmk__badge {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; /* −20% к прежнему размеру */
  color: var(--amber); /* цвет линий = цвет текста «Виллы, коттеджи…» */
}
.hmk__badge svg { width: 27px; height: 27px; display: block; }
.hmk__badge img { width: 42px; height: 42px; display: block; } /* +25% */
.hmk__badge:has(img) { width: 42px; height: 42px; }
/* Готовая изометрия дома — без доп. 3D-наклона, чтобы картинка не искажалась */
.hmk__body:has(img) { transform: none; }
.hmk:hover .hmk__body:has(img),
.hmk:focus-visible .hmk__body:has(img),
.hmk.is-active .hmk__body:has(img) { transform: scale(1.09); }

/* Тонкое мерцание: лёгкое изменение оттенка линий, строго в границах иконки */
.hmk.is-shimmer .hmk__badge { animation: hmkShimmer 1.5s ease-in-out; }
@keyframes hmkShimmer {
  0%, 100% { color: var(--amber); }
  50%      { color: #ffdf9e; }
}
@media (prefers-reduced-motion: reduce) { .hmk.is-shimmer .hmk__badge { animation: none; } }
.hmk.is-active { z-index: 3; }

/* Всплывающая карточка объекта.
   Координаты ставит JS (positionHeroPopup): он же решает, показать её над
   маркером или под ним, и не даёт ей вылезти за края героя и под шапку. */
.hero__popup {
  position: absolute; z-index: 6; width: 236px;
  background: var(--card); border-radius: 16px; padding: 7px;
  box-shadow: 0 20px 46px rgba(6, 24, 23, .42);
  animation: popIn .16s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(6px); } }
.hero__popup.is-below { animation-name: popInBelow; }
@keyframes popInBelow { from { opacity: 0; transform: translateY(-6px); } }
/* Хвостик: --arrow-x держит его под маркером, даже если карточку прижало к краю */
.hero__popup::after {
  content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -8px;
  transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 9px solid var(--card);
}
.hero__popup.is-below::after {
  bottom: auto; top: -8px;
  border-top: 0; border-bottom: 9px solid var(--card);
}
/* Фото вложено в белую карточку: по краям остаётся белая рамка, к которой
   и примыкает хвостик — и сверху, и снизу. Обрезка контейнера (overflow)
   его бы съедала, поэтому скругление задано самому фото. */
.hero__popup img {
  width: 100%; height: 128px; object-fit: cover; display: block;
  border-radius: 11px;
}
.hero__popup__x {
  position: absolute; top: 14px; right: 14px; width: 26px; height: 26px;
  border: 0; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1;
  background: rgba(14, 42, 39, .62); color: #fff;
}
.hero__popup__b { padding: 10px 6px 5px; }
/* Булавка рядом с городом, а не строкой выше: глобальное svg { display: block } */
.hero__popup__loc {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .02em;
}
.hero__popup__loc svg { flex: 0 0 auto; }
.hero__popup__t { font-size: 14px; margin: 3px 0 6px; color: var(--ink); line-height: 1.25; }
.hero__popup__price { color: var(--teal); font-weight: 800; font-size: 15px; }
.hero__popup__more {
  display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700;
  color: var(--blue); text-decoration: none;
}
.hero__popup__more:hover { text-decoration: underline; }
@media (max-width: 640px) { .hero__badge, .hmk__badge { width: 36px; height: 36px; } }

/* Узкий экран: карточка становится панелью у нижнего края карты.
   Пузырь у маркера тут не помещается — карта всего 560px в высоту, а карточка
   288px, и для маркеров в середине места не остаётся ни над, ни под ними.
   Панель заодно не уезжает вместе с картой, когда её листают свайпом. */
.hero__popup--sheet {
  left: 12px; right: 12px; bottom: auto;   /* top ставит JS — см. positionHeroPopup */
  width: auto; max-width: 460px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 14px;
  animation-name: popSheet;
}
@keyframes popSheet { from { opacity: 0; transform: translateY(10px); } }
.hero__popup--sheet::after { display: none; }
.hero__popup--sheet img { width: 92px; height: 92px; flex: none; border-radius: 10px; }
/* padding-right — место под кнопку закрытия, чтобы заголовок не лез под неё */
.hero__popup--sheet .hero__popup__b { padding: 0 30px 0 0; min-width: 0; flex: 1; }
.hero__popup--sheet .hero__popup__t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Кнопка закрытия уходит из угла фото на белый фон панели */
.hero__popup--sheet .hero__popup__x {
  top: 50%; right: 8px; transform: translateY(-50%);
  background: rgba(14, 42, 39, .1); color: var(--muted);
}

.hero__inner { position: relative; z-index: 1; width: 100%; max-width: none; padding-left: clamp(24px, 5vw, 72px); }
.hero__copy { max-width: 600px; }
.hero__title {
  color: #fff; font-size: clamp(44px, 7vw, 86px); font-weight: 900;
  letter-spacing: -.03em; margin: 0 0 18px; text-shadow: 0 2px 34px rgba(4,26,25,.4);
}
.hero__lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--amber); max-width: 480px; }

/* Search bar */
.search {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 30px 0;
  box-shadow: var(--shadow);
}
.search__field { display: grid; gap: 5px; flex: 1 1 130px; }
.search__field label { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.search select {
  font-family: inherit; font-size: 15.5px; font-weight: 600;
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); width: 100%; cursor: pointer;
}
.search__btn { flex: 1 1 130px; }
/* Виджет поиска временно скрыт */
.search { display: none; }


/* ---------- Catalog ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.chip {
  font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  padding: 9px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--teal-900);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }

.catalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  cursor: pointer; transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.card__media { position: relative; height: 210px; background: var(--bg-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(12,58,54,.42)); }
.card__loc {
  position: absolute; bottom: 12px; left: 14px; z-index: 2;
  color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.card__count {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  color: #fff; font-weight: 700; font-size: 12.5px;
  background: rgba(12,58,54,.5); padding: 3px 9px; border-radius: 999px;
}
.card__type {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--teal-900);
  font-weight: 800; font-size: 12px; padding: 4px 11px; border-radius: 999px;
}
.card__body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-size: 21px; }
.card__price { font-family: "Playfair Display", serif; font-weight: 800; font-size: 23px; color: var(--teal); }
.card__specs { display: flex; flex-wrap: wrap; gap: 12px 16px; list-style: none; margin: 2px 0 0; color: var(--ink); }
.card__specs li { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.card__specs svg { color: var(--teal); }
.catalog__empty { text-align: center; color: var(--muted); margin-top: 30px; }

/* ---------- Detail mode: hide the list, show only the object ---------- */
#catalog { scroll-margin-top: 84px; }
.section.is-detail .section__head,
.section.is-detail .chips,
.section.is-detail .catalog { display: none; }

/* ---------- Detail panel ---------- */
.detail[hidden] { display: none; }
.detail { margin-top: 24px; }
.detail__bar { margin-bottom: 16px; }
.detail__close {
  font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  color: var(--teal-900); background: var(--card); border: 1.5px solid var(--line);
  padding: 9px 16px; border-radius: 999px; transition: border-color .2s ease, color .2s ease;
}
.detail__close:hover { border-color: var(--teal); color: var(--teal); }
.detail__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: start; }
.detail__grid > * { min-width: 0; }
.detail:not([hidden]) .detail__grid { animation: detailIn .45s ease; }
@keyframes detailIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Gallery */
/* grid-template-columns: minmax(0,1fr) не даёт вложенному гриду «раздуться»
   по max-content содержимого (фото/карта) и наехать на колонку описания. */
.detail__media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.detail__media > * { min-width: 0; }
.gallery { position: static; }
.gallery__stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b3c4f; box-shadow: var(--shadow-sm); }
.gallery__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.gallery__video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0b3c4f; }
/* [hidden] по умолчанию скрывает, но display:block выше его перебивает — гасим явно */
.gallery__img[hidden], .gallery__video[hidden] { display: none; }
/* Крупная кнопка «play» по центру кадра: видна, пока видео на паузе */
.play-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; width: 76px; height: 76px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(15, 118, 110, .85);
  display: grid; place-items: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .4);
  transition: background-color .2s ease, transform .2s ease;
}
.play-overlay:hover { background: var(--teal); transform: translate(-50%, -50%) scale(1.06); }
.play-overlay::before {
  content: ''; width: 0; height: 0; margin-left: 5px;
  border-style: solid; border-width: 14px 0 14px 23px;
  border-color: transparent transparent transparent #fff;
}
.play-overlay[hidden] { display: none; }
.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.9); color: var(--teal-900); font-size: 24px; line-height: 1;
  display: grid; place-items: center; transition: background-color .2s ease;
}
.gallery__nav:hover { background: #fff; }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }
.gallery__counter {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(12,58,54,.6); color: #fff; font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.gallery__thumb {
  flex: 0 0 auto; width: 78px; height: 58px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb.is-active { border-color: var(--teal); }
/* Превью видео: затемняем кадр и рисуем поверх треугольник «play» */
.gallery__thumb--video { position: relative; }
.gallery__thumb--video img { filter: brightness(.68); }
.gallery__thumb--video::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}

/* Detail info */
.detail__region {
  display: inline-block; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--teal); padding: 5px 12px; border-radius: 999px;
}
.detail__region--mountain { background: #3f7d52; }
.detail__type {
  display: inline-block; font-weight: 800; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--teal-900); background: #fff;
  border: 1.5px solid var(--line); padding: 4px 12px; border-radius: 999px; margin-right: 8px;
}
.detail__title { font-size: clamp(24px, 3vw, 34px); margin: 14px 0 8px; }
.detail__price { font-family: "Playfair Display", serif; font-weight: 800; font-size: 30px; color: var(--teal); }
.detail__addr { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15.5px; margin: 10px 0 16px; }
.detail__addr svg { color: var(--teal); flex: 0 0 auto; }
.detail__specs { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 18px; }
.detail__specs li {
  font-size: 14.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-2); color: var(--teal-900); padding: 8px 14px; border-radius: 10px;
}
.detail__specs svg { color: var(--teal); }
.detail__features { list-style: none; margin: 0 0 20px; display: grid; gap: 9px; }
.detail__features li { position: relative; padding-left: 26px; color: var(--ink); font-size: 15.5px; }
.detail__features li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal); box-shadow: inset 0 0 0 3px rgba(255,255,255,.92);
}
.detail__desc { color: var(--muted); font-size: 15.5px; line-height: 1.7; margin-bottom: 22px; }
.detail__desc p { margin: 0 0 12px; }
.detail__info .btn { width: 100%; }

/* Object map (Yandex) */
.detail__map { margin-top: 0; }
.detail__map-title { font-size: 22px; margin-bottom: 14px; }
.detail__map-frame {
  width: 100%; height: 380px; display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.detail__map-note { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- Lightbox (fullscreen photo viewer) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 5vh 5vw;
  background: rgba(4, 20, 19, .93); animation: lbFade .2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__img {
  max-width: 94vw; max-height: 88vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.55); cursor: zoom-out;
}
.lightbox__video {
  max-width: 94vw; max-height: 88vh; background: #000;
  border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.lightbox__img[hidden], .lightbox__video[hidden] { display: none; }
.lightbox__close, .lightbox__nav {
  position: absolute; border: 0; cursor: pointer; color: #fff;
  background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  display: grid; place-items: center; line-height: 1; transition: background-color .2s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.32); }
.lightbox__close { top: 18px; right: 22px; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; font-size: 34px; }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }
.lightbox__counter {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #fff; font-weight: 700; font-size: 15px;
  background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 999px;
}
@media (max-width: 560px) {
  .lightbox__nav { width: 46px; height: 46px; font-size: 28px; }
  .lightbox__nav--prev { left: 10px; }
  .lightbox__nav--next { right: 10px; }
  .lightbox__close { top: 12px; right: 12px; }
}

@media (max-width: 760px) {
  .detail__grid { grid-template-columns: 1fr; gap: 20px; }
  .gallery { position: static; }
}

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.feature { padding: 4px 28px; border-left: 1px solid var(--line); }
.feature:first-child { border-left: 0; padding-left: 0; }
.feature:last-child { padding-right: 0; }
.feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 13px; margin-bottom: 16px;
  background: linear-gradient(140deg, rgba(15,118,110,.12), rgba(20,184,166,.18)); color: var(--teal);
}
.feature h3 { font-size: 19px; margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 15px; }

/* ---------- Steps (timeline) ---------- */
.steps {
  list-style: none; position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.steps::before {
  content: ""; position: absolute; top: 24px; left: 12.5%; right: 12.5%; height: 2px;
  background: linear-gradient(90deg, var(--teal-300), var(--teal)); z-index: 0;
}
.step { position: relative; z-index: 1; text-align: center; padding: 0 6px; }
.step__num {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; margin: 0 auto 18px; border-radius: 50%;
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 22px;
  color: #fff; background: var(--teal); box-shadow: 0 10px 22px -10px rgba(15,118,110,.75);
}
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- CTA ---------- */
.cta {
  background:
    radial-gradient(120% 100% at 90% 0%, rgba(20,184,166,.4), transparent 50%),
    linear-gradient(150deg, var(--teal-900), var(--teal));
  color: #fff; padding: 84px 0;
}
.cta__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.cta__text h2 { color: #fff; font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 14px; }
.cta__text p { color: rgba(255,255,255,.9); font-size: 18px; }
.cta__perks { list-style: none; margin: 24px 0 0; display: grid; gap: 12px; }
.cta__perks li { position: relative; padding-left: 30px; color: rgba(255,255,255,.92); }
.cta__perks li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--amber); box-shadow: inset 0 0 0 4px rgba(12,58,54,.5);
}
.cta__perks li.is-shimmer { font-weight: 700; animation: perk-shimmer 2.8s ease-in-out infinite; }
@keyframes perk-shimmer {
  0%, 100% { color: rgba(255,255,255,.92); }
  50% { color: var(--amber); }
}
@media (prefers-reduced-motion: reduce) { .cta__perks li.is-shimmer { animation: none; color: var(--amber); } }
.cta__form { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field label { font-size: 14px; font-weight: 700; color: var(--teal-900); }
.cta__form input, .cta__form select {
  font-family: inherit; font-size: 16px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); width: 100%;
}
.cta__form input:focus, .cta__form select:focus { border-color: var(--teal); background: #fff; }
.cta__note { font-size: 14.5px; min-height: 1px; margin: 0; }
.cta__note.is-ok { color: #b6f0d8; font-weight: 700; }
.cta__note.is-err { color: #ffd1c9; font-weight: 700; }

/* ---------- Footer ---------- */
.footer { background: var(--teal-900); color: rgba(255,255,255,.78); padding: 64px 0 26px; }
.footer__inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer__brand p { margin-top: 14px; max-width: 340px; font-size: 15.5px; }
.footer__legal { margin-top: 12px; font-size: 13.5px; color: rgba(255,255,255,.55); }
.footer h4 { color: #fff; font-size: 18px; margin-bottom: 14px; }
.footer__col p { margin-bottom: 8px; font-size: 15.5px; overflow-wrap: anywhere; }
.footer__col a:hover { color: var(--amber); }
.footer__ico { display: inline-flex; align-items: center; gap: 6px; }
.footer__ico svg { color: #25D366; flex: 0 0 auto; }
.footer__ico:hover svg { color: var(--amber); }
/* Строка телефона: иконка, номер и имя в один ряд, выровнены по центру. */
.footer__phone { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.footer__name { color: inherit; }
.footer__nav { display: grid; gap: 8px; }
.footer__bottom { display: flex; justify-content: center; text-align: center; flex-wrap: wrap; gap: 8px; padding-top: 22px; font-size: 14px; color: rgba(255,255,255,.6); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1040px) {
  .features, .steps { grid-template-columns: repeat(2, 1fr); }
  .catalog { grid-template-columns: repeat(2, 1fr); }
  /* Ribbon: vertical dividers become row dividers in a 2x2 grid */
  .features { gap: 26px 28px; }
  .feature { padding: 0; border-left: 0; }
  /* Timeline collapses to a plain 2x2 of numbered steps */
  .steps { gap: 32px 24px; }
  .steps::before { display: none; }
}

/* Карта листается свайпом — до 996px (= 560px × 16/9).
   Ниже этой ширины aspect-ratio и min-height героя дают разный результат:
   высоту держит min-height, а из неё выводилась ширина 996px, и всё лишнее
   (правый край карты, конец описания) обрезал overflow-x: clip у body.
   Здесь aspect-ratio снимаем: герой шириной ровно с экран, а карту во всю
   его высоту показывает холст — он шире экрана и его можно листать. */
@media (max-width: 995px) {
  .hero { aspect-ratio: auto; }
  .hero__map {
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain;          /* свайп по карте не листает страницу вбок */
    scrollbar-width: none;
  }
  .hero__map::-webkit-scrollbar { display: none; }
  .hero__canvas {
    position: relative; inset: auto;
    height: 100%; width: auto; min-width: 100%;
    aspect-ratio: 1920 / 1080;
  }
}

@media (max-width: 760px) {
  .hero__map-label {
    font-size: clamp(11px, 2.4vw, 14px);
    letter-spacing: .06em;
    color: rgba(168, 186, 178, .55);
  }
  .hero__map-label--krasnodar,
  .hero__map-label--karachay {
    display: none;
  }
  .hero__map-label--stavropol {
    top: 7.5%;
  }
  .hero__map-label--georgia {
    right: 5%;
    bottom: 10%;
  }
  .nav {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(80vw, 320px);
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 16px;
    background: var(--teal-900); padding: 92px 30px 30px;
    transform: translateX(100%); transition: transform .3s ease;
    box-shadow: -10px 0 40px -10px rgba(0,0,0,.4);
  }
  .nav.is-open { transform: translateX(0); }
  .nav a { color: #fff !important; font-size: 18px; }
  .nav__cta { width: 100%; margin-top: 8px; }
  .nav-toggle { display: flex; }
  .nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .cta__inner { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .hero { padding: 120px 0 60px; }
  /* «АБХАЗИЯ» целиком в кадре телефона: при разрядке 116px надпись растянута
     на 554px — шире экрана. Сжимаем её и сдвигаем к центру карты (текст висит
     на конце дуги, поэтому от одной разрядки правый край не двигается). */
  .hero__wordmark { transform: translate(-39%, 0%) rotate(16deg) scale(1.1); }
  .hero__wordmark text { letter-spacing: 56px; }
  .hero__map-label--georgia {
    right: 4%;
    bottom: 12%;
  }
  .features, .steps, .catalog { grid-template-columns: 1fr; }
  .search { padding: 14px; }
  .search__field, .search__btn { flex: 1 1 100%; }
  .footer__inner { grid-template-columns: 1fr; gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
