/*
  zel-fixes.css — правки юзабилити и мобильной вёрстки, 02.07.2026.
  Подключается после custom.css во всех шаблонах.
*/

/* ==================== ДЕСКТОП / ОБЩЕЕ ==================== */

/* Базовая типографика: у сайта было 14px — мелко. Современный стандарт 16-17px. */
body {
  font-size: 16px;
  line-height: 1.55;
}

/* Контентные страницы: крупнее и с ограничением длины строки для читаемости */
.text-page-core {
  font-size: 17px;
  line-height: 1.6;
}
.text-page-core p { max-width: 72ch; }
.text-page-core h1 { font-size: clamp(30px, 3vw, 44px); }
.text-page-core h2 { font-size: clamp(22px, 2.2vw, 30px); }

/* Кнопки и карточки — под стать тексту */
.standart-button { font-size: 15px !important; }
.zu-props { font-size: 15px !important; }
.zu-num { font-size: 20px !important; }
.parking-status-panel { font-size: 15px; }
.parking-legend { font-size: 14px !important; }

/* Подписи/лиды hero */
.hero-lead { font-size: clamp(16px, 1.3vw, 19px) !important; }

/* 3D-план: примечание про места вне схемы — на всю ширину панели статистики */
.pk-stat-note {
  grid-column: 1 / -1;
  width: 100%;
  font-size: 13px;
  color: inherit;
  opacity: 0.75;
  text-align: left;
}

/* Кнопки hero: убираем «пятна» backdrop-blur, даём плотную подложку */
.hero-button-secondary {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 14, 17, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
}
.hero-button-secondary:hover {
  background: rgba(12, 14, 17, 0.75) !important;
}

/* Карточка преимуществ в hero — тоже без blur (источник «пятен») */
.hero-triggers-line {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 14, 17, 0.55) !important;
}

/* Лид-строка «Дом сдан / адрес» на фото — читаемость.
   Только главная (fullpage): на внутренних страницах шапка на белом фоне. */
body.fp-responsive .hero-lead,
body.fp-responsive .hero-lead *,
body.fp-responsive .top-ab,
body.fp-responsive .top-ab * {
  color: #fff !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}

/* Мёртвая точка навигации по секциям главной */
a[href="#undefined"] { display: none !important; }

/* Выбор квартиры: картинка дома и SVG-слой обводок должны занимать ОДИН
   и тот же прямоугольник и деформироваться одинаково — иначе обводки съезжают
   при изменении размера окна. Плюс слой обводок должен быть НАД картинкой. */
.apartments-home-scheme-card .svg-wrapper {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
}
.apartments-home-scheme-card .svg-wrapper .w-embed {
  position: absolute !important;
  inset: 0 !important;
}
.apartments-home-scheme-card img.background-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill !important; /* растягивается ровно как viewBox (preserveAspectRatio=none) */
  z-index: 1;
}
.apartments-home-scheme-card svg.background-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 3;
}

/* Всплывающая карточка машиноместа: площадь, цена, бронирование */
.parking-pop {
  position: fixed;
  z-index: 60;
  display: none;
  min-width: 200px;
  max-width: 260px;
  background: #1c1e21;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.4;
}
.parking-pop.is-visible { display: block; }
.parking-pop .pp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.parking-pop .pp-st { font-size: 11px; font-weight: 600; white-space: nowrap; }
.parking-pop .pp-available { color: #4fd98a; }
.parking-pop .pp-reserved { color: #f6c945; }
.parking-pop .pp-sold { color: #9aa0a6; }
.parking-pop .pp-facts { margin-top: 5px; font-size: 13px; opacity: 0.9; }
.parking-pop .pp-family { margin-top: 5px; font-size: 12px; color: #8ecbff; }
.parking-pop .pp-book {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: #fee040;
  color: #1c1e21;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.parking-pop .pp-book:hover { transform: translateY(-1px); }

/* Слайды «Шахматка» и «Паркинг-схема» на главной: iframe во весь экран слайда */
.apartments-home-section .shahmatka-frame,
.parking-plan-home-section .shahmatka-frame {
  display: block;
  width: 100%;
  height: 100vh;
  border: 0;
  background: #f5f6f8;
}
.parking-plan-home-section .shahmatka-frame { background: #101112; }

/* Шапка главной (fullpage): читаемость на фото */
body.fp-responsive [class*="fixed-top"],
body.fp-responsive [class*="fixed-top"] a {
  color: #fff !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

/* Фикс-ссылки «Документы / Ход строительства»: плашка, чтобы не висели голым текстом */
.fixed-bot-link {
  background: rgba(255, 255, 255, 0.82);
  color: #1c1e21 !important;
  padding: 3px 12px;
  border-radius: 999px;
  line-height: 1.9;
  text-shadow: none !important;
  backdrop-filter: none !important;
}

/* Cookie-баннер: компактная полоса снизу по центру */
#cookie-notice {
  left: 50% !important;
  right: auto !important;
  bottom: 12px !important;
  transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px)) !important;
  /* display управляет инлайн-скрипт (show=flex / ok=none) — НЕ прибивать !important */
  align-items: center;
  gap: 14px;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}
#cookie-notice a { white-space: nowrap; }
#accept-cookies {
  flex: none;
  min-height: 40px;
  padding: 8px 22px;
  cursor: pointer;
}

/* Заглушка модалки «Забронировать место»: не даём заголовку налезать на текст */
.remodal[data-remodal-id="parking-book"] h2,
.remodal[data-remodal-id="parking-book"] h3 {
  position: static !important;
  margin: 0 0 16px !important;
  line-height: 1.25 !important;
}

/* ==================== СЕКЦИЯ «ПОСЛЕДНЯЯ КВАРТИРА» НА ГЛАВНОЙ ==================== */
.apartment-feature-layout {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}
.apartment-feature-layout .apartments-home-copy {
  flex: 1 1 46%;
  /* сброс старой absolute-раскладки .apartments-home-copy из custom.css */
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.apartment-feature-layout { position: relative; z-index: 6; }
.apartment-feature-plan {
  flex: 1 1 54%;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.apartment-feature-plan img {
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
}
.apartment-plan-caption {
  margin-top: 12px;
  font-size: 14px;
  color: #5f6368;
}
.apartment-plan-placeholder { padding: 48px 24px; color: #5f6368; }
.apartment-plan-rooms { font-size: 26px; font-weight: 700; color: #1c1e21; margin-bottom: 12px; }
.apartment-feature-facts {
  list-style: none;
  padding: 0;
  margin: 22px 0 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}
.apartment-feature-facts li {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
}
.apartment-feature-facts li span {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.apartment-feature-facts li b { font-size: 17px; }
.apartment-feature-facts .apt-status-free b { color: #35c26f; }

@media (max-width: 991px) {
  .apartment-feature-layout { flex-direction: column; gap: 22px; padding: 24px 14px; }
  .apartment-feature-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apartment-feature-plan { padding: 14px; width: 100%; box-sizing: border-box; }
}

/* Невысокие экраны и планшеты: секция должна помещаться в 100vh fullpage */
@media (max-height: 860px), (max-width: 991px) {
  .apartments-home-section .fp-tableCell { vertical-align: middle; }
  .apartment-feature-layout {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px;
    gap: 16px;
  }
  .apartment-feature-layout h2 { font-size: clamp(20px, 3vh, 30px) !important; margin: 6px 0; }
  .apartment-feature-plan img { max-height: 36vh; }
  .apartment-plan-placeholder { padding: 18px 12px; }
  .apartment-plan-rooms { font-size: 20px; }
  .apartment-feature-facts { margin: 10px 0 12px; gap: 8px; }
  .apartment-feature-facts li { padding: 7px 10px; }
  .apartment-feature-facts li b { font-size: 15px; }
}

/* ==================== МОБИЛЬНАЯ ВЁРСТКА ==================== */
@media (max-width: 767px) {

  /* 1. Убираем зарезервированную левую колонку */
  .core {
    margin-left: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
  }
  .menu-div {
    width: 64px !important;
    height: 64px !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .menu-burger {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  }
  /* Вертикальное боковое меню-ссылки прячем (есть бургер) */
  .menu-core-links { display: none !important; }

  /* 2. Контейнеры на всю ширину, колонки в столбец */
  .standart-section,
  .flex-corners-section {
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box;
    flex-direction: column;
  }
  .card-middle-content-section {
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    flex-direction: column;
  }

  /* 3. Схема паркинга: горизонтальная прокрутка вместо обрезания */
  .app-card-middle-middle-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .parking-plan-wrapper { touch-action: pan-x pan-y; }
  .parking-status-panel {
    width: auto !important;
    max-width: 100% !important;
    margin: 14px 0;
    position: static !important;
  }

  /* 4. Шапка: место под бургер, перенос строк */
  [class*="fixed-top"] {
    padding-left: 72px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  /* 5. Типографика */
  h1 { font-size: clamp(26px, 8vw, 40px) !important; line-height: 1.15 !important; }
  h2 { font-size: clamp(20px, 6vw, 28px) !important; line-height: 1.2 !important; }
  body { font-size: 15px; }

  /* 6. Кнопки и hero */
  .hero-actions,
  .button-container {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px;
  }
  .standart-button {
    width: 100% !important;
    box-sizing: border-box;
    text-align: center;
  }

  /* 7. Cookie-баннер компактный */
  #cookie-notice {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px !important;
    padding: 10px 12px !important;
    bottom: 8px !important;
  }

  /* 8. Карточки квартир/кладовых — на всю ширину */
  .zu-grid { grid-template-columns: 1fr !important; }

  /* 9. Форма заявки */
  .zb-modal { padding: 20px 16px !important; }
}

/* Планшет: колонку тоже убираем, но сетки в 2 колонки */
@media (min-width: 768px) and (max-width: 991px) {
  .core { margin-left: 0 !important; width: 100% !important; }
  .menu-div { background: transparent !important; }
}

/* 117A: the final project sheet is portrait-oriented; keep the entire plan visible. */
.twentytwenty-container img[src*="117a-project-final.png"] {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

@media (max-width: 479px) {
  /* Twelve project rows must grow vertically instead of wrapping off-screen. */
  .card-meters-div:has(+ .buttons-line),
  .card-meters-div {
    height: auto !important;
    flex-wrap: nowrap !important;
  }
}

/* Home page finishing touches: restrained legal link and aligned status copy. */
body .fixed-bot-link.privacy-home-link {
  width: auto !important;
  min-width: 0 !important;
  padding: 3px 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28) !important;
  font-size: 9px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.08em !important;
  text-transform: none !important;
  opacity: 0.72;
}

body .fixed-bot-link.privacy-home-link:hover {
  opacity: 1;
}

.home-status-ab {
  padding-left: 10px !important;
  box-sizing: border-box;
}
