@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Montserrat:wght@700&display=swap');

:root {
  --primary: #1E3A8A;
  --primary-dark: #152C5F;
  --accent: #F59E0B;
  --bg: #F8FAFC;
  --text: #1F2937;
  --text-light: #6B7280;
  --white: #FFFFFF;
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.6; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Хедер */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px;
}
.logo {
  text-decoration: none; color: var(--primary); font-size: 1.8rem; font-weight: 700;
}
.logo span {
  display: block; font-size: 0.8rem; color: var(--text-light); font-weight: 400; margin-top: -5px;
}
.phone { color: var(--primary); font-weight: 600; text-decoration: none; font-size: 1.2rem; }

/* Hero */
.hero {
  position: relative; height: 100vh; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; color: var(--white);
}
.hero-video { position: absolute; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: relative; z-index: 1; text-align: center; padding: 20px; }
.hero-overlay h1 { font-size: 3rem; margin-bottom: 1rem; text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }
.hero-overlay p { font-size: 1.5rem; text-shadow: 1px 1px 4px rgba(0,0,0,0.5); }

/* Особенности */
.features { padding: 60px 0; background: var(--white); }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.feature-item { text-align: center; padding: 30px; border-radius: 15px; background: var(--bg); transition: transform 0.3s; }
.feature-item:hover { transform: translateY(-5px); }
.feature-item h3 { font-size: 1.5rem; color: var(--primary); margin-bottom: 10px; }
.feature-item p { color: var(--text-light); }

/* Видео */
.video-review { padding: 60px 0; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Галерея и автослайдер */
.gallery, .interior-slider { padding: 60px 0; }
.gallery-slider, .auto-slider { display: flex; overflow: hidden; gap: 20px; margin-top: 30px; }
.slide { min-width: calc(33.333% - 14px); }
.slide img { width: 100%; height: 300px; object-fit: cover; border-radius: 12px; cursor: pointer; transition: transform 0.3s; }
.slide img:hover { transform: scale(1.03); }
.slider-controls { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.slider-controls button, .modal-prev, .modal-next {
  background: var(--primary); color: var(--white); border: none; font-size: 1.5rem; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; transition: background 0.3s;
}
.slider-controls button:hover, .modal-prev:hover, .modal-next:hover { background: var(--primary-dark); }

/* Карточки комнат */
.room-cards { padding: 60px 0; background: var(--white); }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.room-card { background: var(--bg); border-radius: 15px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; transition: transform 0.3s; }
.room-card:hover { transform: translateY(-8px); }
.room-card img { width: 100%; height: 250px; object-fit: cover; }
.room-card h3 { font-size: 1.8rem; margin: 20px 0 10px; color: var(--primary); }
.price { font-size: 2rem; color: var(--accent); font-weight: 700; margin: 10px 0; }
.area { color: var(--text-light); margin-bottom: 20px; }
.buttons { display: flex; justify-content: center; gap: 10px; padding: 0 20px 30px; flex-wrap: wrap; }
.btn-mortgage, .btn-floorplan {
  padding: 12px 25px; border-radius: 30px; font-weight: 600; text-decoration: none; border: none; cursor: pointer;
  font-size: 1rem; transition: 0.3s;
}
.btn-mortgage { background: var(--accent); color: var(--text); }
.btn-mortgage:hover { background: #d18b06; }
.btn-floorplan { background: var(--primary); color: var(--white); display: inline-block; }
.btn-floorplan:hover { background: var(--primary-dark); }

/* Форма */
.contact-form { padding: 60px 0; background: var(--bg); }
.form-wrapper { display: flex; align-items: center; gap: 40px; }
.form-image { flex: 1; }
.form-image img { width: 100%; border-radius: 15px; }
.form-wrapper form { flex: 1; background: var(--white); padding: 40px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.form-wrapper form h2 { margin-bottom: 30px; color: var(--primary); }
.form-wrapper input { width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #ddd; border-radius: 10px; font-size: 1rem; }
.form-wrapper button {
  width: 100%; padding: 15px; background: var(--primary); color: var(--white); border: none; border-radius: 10px;
  font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: background 0.3s;
}
.form-wrapper button:hover { background: var(--primary-dark); }

/* Футер */
footer {
  background-size: cover; background-position: center; padding: 60px 0; color: var(--white); text-align: center;
}
footer p { font-size: 1rem; opacity: 0.8; margin-bottom: 10px; }
footer a { color: var(--white); font-weight: 600; text-decoration: none; font-size: 1.2rem; }

/* Шахматка */
.chess { width: 100%; border-collapse: collapse; margin-top: 30px; }
.chess td { border: 1px solid #e5e7eb; padding: 10px; text-align: center; font-size: 0.9rem; }
.floor-num { background: var(--primary); color: white; font-weight: 700; }
.cell { cursor: pointer; transition: 0.2s; }
.cell.empty { background: #f3f4f6; }
.cell.застройщик { background: #d1fae5; }
.cell.инвестор { background: #dbeafe; }
.cell.собственник { background: #fef3c7; }
.cell:hover { transform: scale(1.05); }
.chess-legend { display: flex; gap: 20px; margin-top: 20px; }
.legend-item { padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; }
.legend-item.developer { background: #d1fae5; }
.legend-item.investor { background: #dbeafe; }
.legend-item.owner { background: #fef3c7; }

/* Модалки */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 200; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: var(--white); padding: 30px; border-radius: 15px; max-width: 500px; width: 90%; position: relative; }
.close-modal { position: absolute; top: 10px; right: 20px; font-size: 2rem; cursor: pointer; color: var(--text); }
.modal-gallery-content { display: flex; align-items: center; gap: 20px; }
#modal-gallery-img { max-height: 80vh; max-width: 80vw; border-radius: 10px; }
#mortgage-result { margin-top: 20px; padding: 15px; background: var(--bg); border-radius: 10px; font-weight: 600; }

/* Главная страница (index.php) */
.complexes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; padding: 60px 0; }
.complex-card { background: var(--white); border-radius: 15px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-decoration: none; color: var(--text); transition: transform 0.3s; }
.complex-card:hover { transform: translateY(-10px); }
.complex-card img { width: 100%; height: 250px; object-fit: cover; }
.complex-card h2 { font-size: 1.8rem; margin: 20px; color: var(--primary); }
.complex-card p { margin: 0 20px; color: var(--text-light); }
.prices { display: flex; justify-content: space-around; padding: 20px; background: var(--bg); margin-top: 15px; }
.prices div { text-align: center; }
.prices span:first-child { font-weight: 700; font-size: 0.9rem; color: var(--primary); }
.prices span:nth-child(2) { font-size: 0.9rem; color: var(--text-light); }
.prices span:last-child { font-weight: 700; color: var(--accent); font-size: 1.1rem; }

/* Адаптивность */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: 1fr; }
  .form-wrapper { flex-direction: column; }
  .hero-overlay h1 { font-size: 2rem; }
  .slider-controls button { width: 30px; height: 30px; font-size: 1rem; }
  .slide { min-width: 80%; }
}


/* === ГЛАВНАЯ СТРАНИЦА: СЕТКА 1-4-1 === */
.main-content {
  padding: 60px 0;
  background: var(--bg);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 4fr 1fr; /* соотношение 1 : 4 : 1 */
  gap: 30px;
  align-items: start;
}

/* Баннеры */
.banners-left,
.banners-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.banner-stack img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  display: block;
}

/* Карточки ЖК (горизонтальные) */
.complexes-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.complex-card-horizontal {
  display: flex;
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s, box-shadow 0.3s;
}

.complex-card-horizontal:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.card-image {
  flex: 1;
  min-width: 200px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px;
}

.card-info {
  flex: 1.5;
  padding: 25px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-info h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.card-address {
  color: var(--text-light);
  margin-bottom: 15px;
}

.card-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.price-row {
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
}

.price-row span:first-child {
  font-weight: 700;
  color: var(--primary);
}

.price-row span:nth-child(2) {
  color: var(--text-light);
}

.price-row span:last-child {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: 1fr; /* оставляем только центральную колонку */
    gap: 20px;
  }

  .banners-left,
  .banners-right {
    display: none; /* скрываем баннеры на планшетах и телефонах */
  }
}

@media (max-width: 768px) {
  .complex-card-horizontal {
    flex-direction: column; /* картинка сверху, текст снизу */
  }

  .card-image {
    flex: none;
  }

  .card-image img {
    height: 200px;
  }

  .card-info {
    padding: 20px;
  }
}