/* =================================
   Variables & Basic Styles
   ================================= */

:root {
  --bg: #0e1116;
  --bg-2: #121621;
  --card: #171b26;
  --muted: #9aa3b2;
  --text: #e9edf5;
  --brand: #2ac1ff;
  --brand-2: #7df3a4;
  --accent: #ffd166;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 70px;
}

body {
  padding-top: 72px; /* ИЗМЕНЕНИЕ: Добавляем отступ сверху для компенсации высоты fixed-меню */
}

html,
body {
  margin: 0;
  /* height: 100%; - ИЗМЕНЕНИЕ: Удалена строка для исправления прокрутки */
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", "Arial", "Apple Color Emoji", "Segoe UI Emoji";
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =================================
   Header & Navigation
   ================================= */

/* ИЗМЕНЕНИЕ: Header теперь просто пустой статический блок */
header {}

#main-nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  background: rgba(14, 17, 22, .75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

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

.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #001018;
  font-weight: 900;
}

nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
}

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

.cta {
  display: flex;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #001018;
}

.btn-ghost {
  padding: 18px 16px;

  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .15);
}


/* =================================
   Mobile Menu (Side-in)
   ================================= */

.burger {
  display: none;
  border: 1px solid rgba(255, 255, 255, .15);
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

@media (max-width: 960px) {
  nav ul {
    display: none;
  }
  .burger {
    display: block;
  }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .75);
  backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.mobile-sheet {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-2);
  padding: 20px;
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform .3s ease;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu.open .mobile-sheet {
  transform: translateX(0);
}

.mobile-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, .06);
}


/* =================================
   Hero Section
   ================================= */

.hero{
  position: relative;                /* создаём слой для ::before */
  min-height: 40vh;                  /* чтобы фон было видно */
  background: center/cover no-repeat;
  color: #fff;                       /* текст читаемый на фоне */
}

/* полупрозрачное затемнение, если нужно */
.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);       /* не #000! иначе всё «убьёт» */
  z-index: 0;
  pointer-events: none;
}

/* поднимаем весь контент поверх оверлея */
.hero > *{
  position: relative;
  z-index: 1;
}

.h1 {
  font-size: clamp(28px, 3.6vw, 48px);
  margin: 10px 0 16px;
  line-height: 1.15;
}

.lead {
  font-size: 1.1rem;
  color: #d9e3f0;
  max-width: 820px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.stat {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 16px;
}

.stat b {
  display: block;
  font-size: 1.6rem;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =================================
   Generic Section Styles
   ================================= */

section {
  padding: 64px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 32px);
}

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

/* =================================
   Grid & Card Styles
   ================================= */

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

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #001018;
  font-weight: 900;
  margin-bottom: 8px;
}

/* =================================
   Gallery (Fixed Height Method - Final)
   ================================= */

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

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  cursor: zoom-in;
}

@media (max-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.more-tile {
  width: 100%;
  height: 200px;
  border: 0;
  cursor: pointer;
  position: relative;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), var(--more-bg);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 70px;
}

.more-tile span {
  background: rgba(0, 0, 0, .45);
  padding: 8px 16px;
  border-radius: 12px;
}

/* Адаптивность для планшетов */
@media (max-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Адаптивность для мобильных */
@media (max-width: 720px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item,
  .more-tile {
    height: 180px; /* Уменьшаем высоту для мобильных */
  }
}

/* =================================
   Plan Section
   ================================= */
.plan-image-wrapper {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  overflow: hidden; /* Обрезает углы изображения под рамку */
  box-shadow: var(--shadow);
  line-height: 0; /* Убирает возможный отступ под изображением */
}

.plan-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
}

@media (max-width: 768px) {
  .plan-image {
    max-height: 60vh;
  }
}

/* =================================
   Lightbox
   ================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.lb-btn {
  position: absolute;
  border: 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 28px;
}

.lb-close {
  top: 24px;
  right: 24px;
  font-size: 20px;
}

.lb-prev {
  left: 24px;
}

.lb-next {
  right: 24px;
}

.lb-count {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .45);
  padding: 8px 12px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
}

/* =================================
   Video & Map
   ================================= */

.video,
.map {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
}

.video iframe,
.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =================================
   Lots Section
   ================================= */

.lots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .lots {
    grid-template-columns: 1fr;
  }
}

.lot h3 {
  margin: .2rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 6px 10px;
  border-radius: 999px;
  color: #e3f7ff;
}

/* =================================
   FAQ Section
   ================================= */

.faq-item {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  margin-bottom: 10px;
}

.faq-q {
  background: rgba(255, 255, 255, .04);
  padding: 14px 16px;
  cursor: pointer;
}

.faq-a {
  display: none;
  padding: 14px 16px;
  background: var(--bg-2);
}

/* =================================
   Contact Form
   ================================= */

form {
  display: grid;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #0b0e14;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.notice {
  font-size: .95rem;
  color: #cfe6ff;
}

/* =================================
   Footer
   ================================= */

footer {
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
}

/* =================================
   Back to Top Button
   ================================= */

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: none;
}

.to-top.show {
  display: block;
}

/* =================================
   Top Bar 
   ================================= */

.top-bar {
  background: var(--bg-2);
  padding: 15px 0; /* Немного увеличим отступы */
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.top-bar .container {
  display: flex;
  margin-top: 12px;
  align-items: center;
  justify-content: space-between; /* Размещаем элементы по краям */
}

.top-bar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}

.top-bar nav a {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.top-bar nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

/* Скрываем верхнее меню на мобильных устройствах, чтобы не занимать место */
@media (max-width: 960px) {
  .top-bar {
    display: none;
  }
}

/* =================================
   Contact Modal
   ================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-2);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  position: relative;
  transform: scale(0.95);
  transition: transform .3s ease;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.contact-link {
    display: flex; /* ИЗМЕНЕНИЕ: Используем flexbox для выравнивания */
    align-items: center; /* Выравнивание по центру по вертикали */
    gap: 10px; /* Расстояние между логотипом и текстом */
    padding: 12px;
    margin-top: 10px;
    border-radius: 12px;
    /* text-align: center; - ИЗМЕНЕНИЕ: Удалено, так как теперь flexbox */
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, .15);
    text-decoration: none;
    color: var(--text);
    transition: background-color .2s ease;
}
.contact-link:hover {
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
}
.contact-link.telegram {
    border-color: var(--brand);
    color: var(--brand);
}
.contact-link.telegram:hover {
    background-color: rgba(42, 193, 255, .1);
}

.operator-logo {
    width: 35px; /* Размер логотипа */
    height: 35px;
    object-fit: contain; /* Сохраняем пропорции изображения */
    vertical-align: middle; /* Выравнивание по центру текста */
}


.phone-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.phone-modal-content {
  background: #fff;
  color: #000;
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.phone-modal-content button {
  margin-top: 14px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #2ac1ff;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#phoneModalText {
  color: #F08080; /* твой accent */
  font-weight: 600;
  margin: 8px 0 0;
}

/* Mobile menu groups */
.mobile-menu .mobile-group-title{margin:10px 0 6px;font-weight:700;opacity:.9}
.mobile-menu a{display:block;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.mobile-menu hr{border:0;border-top:1px solid rgba(255,255,255,.08);margin:8px 0}


/* Burger enlarged */
.burger {
  font-size: 28px !important;
  padding: 12px 14px !important;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
}

/* Active menu item highlighting */
.menu a.active {
  color: #fff;
  background-color: #0073e6;
  font-weight: bold;
  border-radius: 5px;
  padding: 5px 10px;
}

/* === Active state for secondary nav (Дополнительное меню) === */
nav[aria-label="Дополнительное меню"] a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,115,230,.28), rgba(0,230,173,.28));
  border-radius: 6px;
  padding: 6px 10px;
}



/* === Smooth animation for active state in Дополнительное меню === */
nav[aria-label="Дополнительное меню"] a {
  transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
nav[aria-label="Дополнительное меню"] a.active {
  background: linear-gradient(90deg, rgba(0,115,230,0.35), rgba(0,230,173,0.35));
  box-shadow: 0 2px 6px rgba(0, 230, 173, 0.3);
}

/* === Smooth highlight animation for secondary nav === */
nav[aria-label="Дополнительное меню"] a {
  position: relative;
  transition: background 220ms ease, color 220ms ease;
  border-radius: 6px;
  padding: 6px 10px;
}

nav[aria-label="Дополнительное меню"] a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #00e6ad, #0073e6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms ease;
  opacity: .9;
}

/* Активный пункт: фон + подчёркивание выезжает */
nav[aria-label="Дополнительное меню"] a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,115,230,.18), rgba(0,230,173,.18));
}

nav[aria-label="Дополнительное меню"] a.active::after {
  transform: scaleX(1);
}

/* По желанию: при hover показывать линию без фона */
nav[aria-label="Дополнительное меню"] a:hover::after {
  transform: scaleX(1);
}

/* === Prevent wrapping in top nav items === */
nav a {
  white-space: nowrap;
}


/* === Current location badge shown before the 'Подзвонити' button on mobile === */
.current-location {
  display: none;
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 10px;
  margin-left: 5px;
  background: linear-gradient(90deg, rgba(42,193,255,0.12), rgba(125,243,164,0.12));
  border: 1px solid rgba(255,255,255,0.12);
  align-self: center;
}

@media (max-width: 960px) {
  .cta {
    align-items: center;
  }
  .current-location {
    display: block;
    margin-right: 4px;
  }
}


/* === Mobile compaction for CTA & chips (except burger) === */
@media (max-width: 768px) {
  /* reduce gaps between items on the right */
  .cta {
    gap: 8px;
  }
  /* shrink only the regular buttons, not the burger */
  .cta .btn {
    padding: 8px 10px;
    font-size: 14px;
    min-width: auto;
  }
  /* ghost button often has larger padding: override */
  .cta .btn-ghost {
    padding: 8px 10px;
  }
  /* location/current page chip if shown on mobile */
  .current-location {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.1;
  }
  /* tighten main nav spacing if it's visible */
  .nav {
    padding: 10px 0;
  }
  .nav nav ul {
    gap: 10px;
  }
}
