/* =============================================
   VERDE PARK — Планування
   ============================================= */

/* ---- Паралакс-банер ---- */
.planning-hero-banner {
  position: relative;
  height: 260px;
  overflow: hidden;
  margin-top: 50px;
}

.planning-hero-bg {
  position: absolute;
  top: -140px;
  left: 0;
  right: 0;
  bottom: -140px;
  background: url('../images/hero/planningbg.jpeg') center / cover no-repeat;
  will-change: transform;
  z-index: 0;
}

/* .planning-hero-overlay — стилі перенесено в .page-hero-overlay (layout.css) */

.planning-banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 0 50px 0 150px;
}

.planning-h1 {
  font-family: var(--font-heading);
  font-size: 60px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 1;
  flex-shrink: 0;
}

.planning-promo {
  font-family: var(--font-museo);
  font-size: 13px;
  font-weight: 300;
  color: var(--white);
  line-height: 1.5;
  margin-left: auto;
  text-align: right;
  transform: translateY(15px);
}

.planning-promo strong {
  color: var(--white);
  font-weight: 700;
}

/* =============================================
   ФІЛЬТРИ (кнопки-пігулки)
   ============================================= */
.planning-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--gap-lg);
}

.filter-tab {
  height: 40px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-montserrat);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--filter-inactive);
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.filter-tab:hover {
  background: var(--filter-hover);
  color: var(--text-dark);
}

.filter-tab.active {
  background: var(--green);
  color: var(--white);
}

/* =============================================
   СІТКА КАРТОК
   ============================================= */
.apt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 390px);
  gap: 24px;
  margin-bottom: var(--gap-lg);
}

/* ---- Картка квартири (390×430px) ---- */
.apt-card {
  width: 390px;
  height: 430px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.apt-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .13);
}

/* ---- Фото картки (350×250) ---- */
.apt-photo {
  flex-shrink: 0;
  width: 350px;
  height: 250px;
  object-fit: cover;
  margin-bottom: 16px;
  border-radius: var(--radius);
  display: block;
}

/* ---- Рядок: назва + ціна / площа ---- */
.apt-info-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.apt-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

/* Назва квартири */
.apt-name {
  font-family: var(--font-montserrat);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

/* Ціна */
.apt-price {
  font-family: var(--font-montserrat);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.2;
}

/* ---- Плашка площі (60×40px) ---- */
.apt-area-badge {
  width: 60px;
  height: 40px;
  flex-shrink: 0;
  background: var(--section-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-montserrat);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* ---- Кнопка "Детальніше" (350×50px) ---- */
.apt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 350px;
  height: 50px;
  flex-shrink: 0;
  margin-top: 16px;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-montserrat);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.apt-btn:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

/* ---- Схована картка (JS-фільтр) ---- */
.apt-card.hidden {
  display: none;
}

/* =============================================
   CTA-СМУГА (всередині grid — spans усі колонки)
   ============================================= */
.planning-cta {
  grid-column: 1 / -1;
  background: var(--section-bg);
  border-radius: var(--radius);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: nowrap; /* кнопка завжди праворуч */
}

.planning-cta-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-dark);
  line-height: 1.65;
  flex: 1;       /* займає весь вільний простір */
  min-width: 0;  /* дозволяє тексту переноситися */
}

/* Зелена кнопка (загальна — використовується в CTA) */
.btn-green {
  display: inline-block;
  padding: 9px 22px;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-green:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

/* CTA-кнопка (більша, 200×40px) */
.planning-cta .btn-green {
  min-width: 200px;
  height: 40px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-top: 0;
  font-size: 14px;
  flex-shrink: 0;
}

/* =============================================
   АДАПТИВ
   ============================================= */

/* Планшет: 768–1199px — 2 колонки, картки стискаються */
@media (max-width: 1199px) {
  .planning-hero-banner {
    margin-top: 80px;
  }

  .planning-banner-content {
    padding: 0 28px 0 80px;
  }

  .planning-h1 {
    font-size: 46px;
  }

  /* 2-колонкова сітка */
  .apt-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Картка займає 100% колонки (max 390px) */
  .apt-card {
    width: 100%;
    max-width: 390px;
    height: auto;
  }

  .apt-photo {
    width: 100%;
    height: 250px;
  }

  .apt-btn {
    width: 100%;
  }
}

/* Мобайл: < 768px — 1 колонка */
@media (max-width: 767px) {
  .planning-hero-banner {
    margin-top: 0;
  }

  .planning-banner-content {
    padding: 0 16px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
  }

  .planning-h1 {
    font-size: 38px;
  }

  .planning-promo {
    margin-left: 0;
    text-align: left;
    transform: none;
  }

  /* 1 колонка */
  .apt-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    /* CTA на мобільному вже займає 100% через grid-column: 1 / -1 */
  }

  /* Картка на всю ширину без обмеження */
  .apt-card {
    max-width: none;
  }

  /* Фільтри переносяться, висота кнопок 40px зберігається */
  .planning-filters {
    margin-bottom: var(--gap-md);
  }

  .planning-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }
}

/* =============================================
   ПОПАП ДЕТАЛЕЙ КВАРТИРИ
   ============================================= */
.apt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.apt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 40, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.apt-modal__box {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  display: flex;
  animation: aptModalIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aptModalIn {
  from { opacity: 0; transform: scale(0.93) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.apt-modal__close {
  position: absolute;
  top: -17px;
  right: -18px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transition: background 0.18s, color 0.18s;
}

.apt-modal__close:hover {
  background: var(--green);
  color: var(--white);
}

.apt-modal__close svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* ---- Ліва колонка: фото ---- */
.apt-modal__left {
  width: 42%;
  flex-shrink: 0;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
}

.apt-modal__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Права колонка: деталі ---- */
.apt-modal__right {
  flex: 1;
  min-width: 0;
  padding: 36px 32px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apt-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.apt-modal__title {
  font-family: var(--font-montserrat);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.apt-modal__area-badge {
  width: 68px;
  height: 42px;
  flex-shrink: 0;
  background: var(--section-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-montserrat);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.apt-modal__price {
  font-family: var(--font-montserrat);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.2;
}

.apt-modal__desc {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.72;
}

.apt-modal__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apt-modal__features li {
  background: var(--section-bg);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-family: var(--font-montserrat);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.apt-modal__cta {
  width: 100%;
  text-decoration: none;
}

/* ---- Попап: мобільний вигляд ---- */
@media (max-width: 640px) {
  .apt-modal__box {
    flex-direction: column;
    max-height: 92vh;
    overflow-y: auto;
  }

  .apt-modal__left {
    width: 100%;
    height: 210px;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
  }

  .apt-modal__close {
    top: -18px;
    right: 18px;
  }

  .apt-modal__right {
    padding: 22px 20px 24px;
    gap: 14px;
  }

  .apt-modal__title {
    font-size: 18px;
  }

  .apt-modal__price {
    font-size: 17px;
  }
}
