/* =============================================
   VERDE PARK — Головна сторінка
   Всі правила тут переважають layout.css
   для цієї конкретної сторінки (body.page-home).
   ============================================= */


/* =============================================
   ЗАБОРОНА СКРОЛУ — повний екран 100vh
   ============================================= */
html:has(body.page-home) {
  overflow: hidden;
  height: 100vh;
}

body.page-home {
  overflow: hidden;
  height: 100vh;
}

body.page-home .site-wrapper {
  height: 100vh;
  overflow: hidden;
}


/* =============================================
   САЙДБАР — відступ 50px з усіх боків
   ============================================= */
body.page-home .sidebar {
  padding: 50px;
  /* тихий скрол якщо вміст не влазить (без полоси) */
  overflow-y: auto;
  scrollbar-width: none;
}

body.page-home .sidebar::-webkit-scrollbar {
  display: none;
}


/* =============================================
   КОНТЕНТНА ЗОНА — relative для абсолютного topbar
   ============================================= */
body.page-home .content-area {
  position: relative;
  height: 100vh;
  overflow: hidden;
  /* скасовуємо flex-direction:column — героя розміщаємо абсолютно */
  display: block;
}


/* =============================================
   ВЕРХНЄ МЕНЮ — парить над героєм
   50px зверху, 150px від лівого краю content-area
   ============================================= */
body.page-home .topbar {
  position: absolute;
  top: 50px;
  left: 150px;
  right: 40px;
  z-index: 30;
  padding: 0;
}

/* EU білим — топбар плаває над темним фото */
body.page-home .lang-switch button {
  color: rgba(255, 255, 255, .65);
}

body.page-home .lang-switch button.active {
  color: var(--green);
}

body.page-home .lang-divider {
  color: rgba(255, 255, 255, .4);
}

/* В мобільному оверлеї та хедері — повертаємо темні кольори */
body.page-home .mobile-overlay .lang-switch button,
body.page-home .mobile-header-lang button {
  color: var(--text-muted);
}

body.page-home .mobile-overlay .lang-switch button.active,
body.page-home .mobile-header-lang button.active {
  color: var(--green);
}

body.page-home .mobile-overlay .lang-divider,
body.page-home .mobile-header-lang .lang-divider {
  color: var(--text-muted);
}

/* Пігулка топ-меню: 490×30px, заокруглення 4px */
body.page-home .topbar-nav {
  width: 490px;
  height: 30px;
  border-radius: 4px;
  padding: 0 4px;
  align-items: center;
}

/* Museo 100, 16px, текст по центру кожного пункту */
body.page-home .topbar-nav a {
  padding: 0;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-family: var(--font-museo);
  font-size: 16px;
  font-weight: 100;
  letter-spacing: 0.02em;
  text-transform: none;
}


/* =============================================
   ГЕРОЙ — заповнює всю content-area
   ============================================= */
.hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
}


/* --- Фонове фото --- */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}


/* --- Градієнтний оверлей + вертикальні смужки 1px кожні 120px --- */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, .18) 0px,
      rgba(255, 255, 255, .18) 1px,
      transparent              1px,
      transparent              120px
    ),
    linear-gradient(
      to top right,
      rgba(60, 40, 90, .82) 0%,
      rgba(40, 25, 65, .60) 45%,
      rgba(20, 15, 40, .35) 100%
    );
  pointer-events: none;
}


/* =============================================
   КОНТЕНТ ГЕРОЯ (H1 + ціна + кнопка)
   Вертикально по центру, зліва 150px (як topbar)
   ============================================= */
.hero-content {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 150px;
  z-index: 2;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 0;
}


/* H1 — Museo 900, 60px, рівно 2 рядки */
.hero-title {
  font-family: var(--font-museo);
  font-size: 60px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

/* Кожен span — окремий рядок, без переносу всередині */
.hero-title span {
  display: block;
  white-space: nowrap;
}


/* Ціна — три частини: "від" / "12 400" / "грн/м²" */
.hero-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
  margin-bottom: 28px;
}

.price-from,
.price-unit {
  font-family: var(--font-museo);
  font-size: clamp(24px, 3.3vw, 48px);
  font-weight: 100;
  color: var(--white);
}

.price-num {
  font-family: var(--font-museo);
  font-size: clamp(24px, 3.3vw, 48px);
  font-weight: 900;
  color: var(--white);
}


/* CTA кнопка: 280×50px, заокруглення 5px */
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 280px;
  height: 50px;
  padding: 0;
  background: var(--green);
  color: var(--white);
  border-radius: 5px;
  margin-top: 20px;
  font-family: var(--font-museo);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(158, 199, 62, .35);
}

.hero-cta:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(158, 199, 62, .45);
}

.hero-cta:active {
  transform: translateY(0);
}


/* =============================================
   КНОПКА PLAY (центр праворуч)
   ============================================= */
.hero-play {
  position: absolute;
  right: 40px;
  top: calc(50% - 55px);
  z-index: 2;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 4px 20px rgba(0 0 0 / .25);
  cursor: pointer;
}

.hero-play:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(0 0 0 / .35);
}

.hero-play svg {
  width: 26px;
  height: 26px;
  fill: var(--green);
  margin-left: 4px; /* оптична корекція трикутника */
}

/* Зелене пульсуюче кільце */
.hero-play::before,
.hero-play::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(158, 199, 62, .55);
  animation: hero-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

.hero-play::after {
  inset: -24px;
  border-color: rgba(158, 199, 62, .25);
  animation-delay: .8s;
}

@keyframes hero-pulse {
  0%   { transform: scale(.9);  opacity: .8; }
  60%  { transform: scale(1.05); opacity: .3; }
  100% { transform: scale(1.12); opacity: 0;  }
}


/* =============================================
   БАНЕР СПЕЦПРОПОЗИЦІЇ (низ зліва)
   ============================================= */
.hero-promo {
  position: absolute;
  bottom: 50px;
  left: 150px;
  z-index: 2;
  padding-left: 14px;
  border-left: 2px solid var(--green);
  font-family: var(--font-museo);
  font-size: 16px;
  font-weight: 100;
  color: rgba(255 255 255 / .85);
  line-height: 1.6;
  max-width: 420px;
}

.hero-promo strong {
  color: var(--white);
  font-weight: 900;
}


/* =============================================
   ОБГОРТКА КНОПКИ «i» + ПОПОВЕР (позиційний якір)
   ============================================= */
.price-popover-wrap {
  position: absolute;
  bottom: 50px;
  right: 50px;
  z-index: 2;
}


/* =============================================
   КНОПКА «i»
   ============================================= */
.hero-info {
  position: relative;    /* позиціонування тепер на .price-popover-wrap */
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  cursor: pointer;
}

.hero-info:hover {
  background: var(--green-dark);
}

.hero-info em {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}


/* =============================================
   ПОПОВЕР З РОЗШИФРОВКОЮ ЦІНИ
   ============================================= */

/* Контейнер — з'являється над кнопкою */
.price-popover {
  position: absolute;
  bottom: calc(100% + 12px);   /* відступ 12px над кнопкою */
  right: 0;                     /* правий край = правий край обгортки */
  width: 300px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;

  /* drop-shadow охоплює і трикутник-носик */
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.13));

  /* Початковий прихований стан (анімація через .is-open) */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity    180ms ease,
    transform  180ms ease,
    visibility 0ms   180ms;   /* затримка при ховані */
}

/* Відкритий стан — наведення на обгортку */
.price-popover-wrap:hover .price-popover {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity    180ms ease,
    transform  180ms ease,
    visibility 0ms   0ms;
}

/* Трикутник-носик (вказує донизу, до кнопки "i") */
.price-popover::after {
  content: '';
  position: absolute;
  bottom: -7px;
  /* центр трикутника навпроти центру кнопки:
     кнопка 38px → 38/2 = 19px від правого краю; 19 − 7(напівширина) = 12px */
  right: 12px;
  border-left:  7px solid transparent;
  border-right: 7px solid transparent;
  border-top:   7px solid var(--white);
}

/* Заголовок */
.price-popover__title {
  font-family: var(--font-museo);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-heading);
  margin: 0 0 10px;
}

/* Основний текст */
.price-popover__text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.55;
  margin: 0 0 10px;
}

/* Дрібна примітка */
.price-popover__note {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}



/* =============================================
   АДАПТИВНІСТЬ
   ============================================= */

/* --- Планшет: 768–1199px --- */
@media (max-width: 1199px) {
  body.page-home .sidebar {
    padding: 40px 24px;
  }

  body.page-home .topbar {
    left: 100px;
    right: 24px;
  }

  .hero-content {
    left: 100px;   /* в парі з topbar left: 100px на планшеті */
    max-width: 480px;
    gap: 22px;
  }

  .hero-play {
    right: 36px;
    width: 62px;
    height: 62px;
  }

  .hero-promo {
    left: 100px;
    bottom: 50px;
  }

  .price-popover-wrap {
    right: 50px;
    bottom: 50px;
  }
}

/* --- Мобайл: < 768px --- */
@media (max-width: 767px) {
  body.page-home {
    overflow: hidden;
  }

  /* content-area займає весь залишок після фіксованого mobile-header (64px) */
  body.page-home .content-area {
    height: calc(100vh - 64px);
    /* .site-wrapper вже має padding-top: 64px із layout.css */
  }

  /* Герой — по центру з невеликим зміщенням вгору, щоб залишити місце для play */
  .hero-content {
    left: 24px;
    right: 90px;   /* місце для play-кнопки справа */
    max-width: unset;
    top: 48%;
    transform: translateY(-50%);
    gap: 18px;
  }

  .hero-title {
    font-size: clamp(24px, 7.5vw, 36px);
    letter-spacing: 0.02em;
  }

  .hero-price {
    font-size: 14px;
  }

  .hero-price strong {
    font-size: 22px;
  }

  .hero-cta {
    padding: 12px 28px;
    font-size: 11px;
  }

  /* Play: правий бік, вертикальний центр */
  .hero-play {
    right: 20px;
    top: calc(50% - 28px);
    width: 56px;
    height: 56px;
  }

  .hero-play:hover {
    transform: scale(1.08);
  }

  /* Банер: розтягується на ширину (без зони info-кнопки) */
  .hero-promo {
    left: 20px;
    right: 70px;
    bottom: 22px;
    font-size: 11px;
  }

  /* Обгортка — нова позиція */
  .price-popover-wrap {
    right: 20px;
    bottom: 22px;
  }

  /* Кнопка "i" — менший розмір на мобайлі */
  .hero-info {
    width: 34px;
    height: 34px;
  }

  /* Поповер — не виходить за межі екрана */
  .price-popover {
    max-width: calc(100vw - 32px);
  }

  /* Носик навпроти центру кнопки 34px: 34/2 − 7 = 10px */
  .price-popover::after {
    right: 10px;
  }
}

/* --- Дуже мала висота (< 600px) — дозволяємо скрол всередині hero --- */
@media (max-height: 600px) {
  body.page-home,
  body.page-home .site-wrapper,
  body.page-home .content-area {
    overflow-y: auto;
  }

  body.page-home .hero {
    position: relative;
    min-height: 520px;
  }

  .hero-bg {
    position: absolute !important;
  }

  .hero-content {
    /* від відносного верху при малій висоті */
    top: 50%;
    transform: translateY(-50%);
  }
}


/* =============================================
   ВІДЕО ПОПАП
   ============================================= */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal[hidden] {
  display: none;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 20, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  animation: modalFadeIn .35s ease forwards;
}

.video-modal__box {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  animation: modalSlideUp .4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.video-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 5px;
  background: rgba(10, 6, 20, .65);
  border: 1px solid rgba(255 255 255 / .2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background .2s, transform .2s;
}

.video-modal__close:hover {
  background: rgba(10, 6, 20, .9);
  transform: scale(1.08);
}

.video-modal__close svg {
  width: 18px;
  height: 18px;
}

.video-modal__player {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 24px 80px rgba(0 0 0 / .6);
}

.video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
  .video-modal__box {
    width: 96vw;
  }
}


/* =============================================
   LUXURY ENTRANCE ANIMATIONS
   ============================================= */

@keyframes kenBurns {
  from { transform: scale(1.04); }
  to   { transform: scale(1); }
}

/* Фото — дуже повільний Ken Burns */
body.page-home .hero-bg {
  animation: kenBurns 28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Базовий прихований стан — JS додасть .ha-visible */
.ha {
  opacity: 0;
  will-change: opacity, transform, filter;
}

.ha-up   { transform: translateY(18px); filter: blur(8px); }
.ha-down { transform: translateY(-12px); filter: blur(8px); }
.ha-left { transform: translateX(-18px); filter: blur(6px); }

/* Перехід до видимого */
.ha.ha-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity  2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 2s cubic-bezier(0.16, 1, 0.3, 1),
    filter   2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Оверлей — окремо через CSS (немає JS) */
body.page-home .hero-overlay {
  opacity: 0;
  animation: haFadeIn 3.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes haFadeIn {
  to { opacity: 1; }
}
