﻿/* ============================================
   HOME MARKET — Settlements pages
   ============================================ */

/* ---- Settlements list page ---- */
.settlements-hero {
  background: var(--navy-deep);
  padding: 100px 0 52px;
  position: relative;
  overflow: hidden;
}
.settlements-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 70% at 85% 50%, rgba(201,169,110,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 30% 50% at 15% 80%, rgba(27,58,75,0.4) 0%, transparent 60%);
  pointer-events: none;
}
.settlements-hero-inner { position: relative; z-index: 1; }
.settlements-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  margin-top: 20px;
}
.settlements-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.settlements-stat__num {
  font-family: 'Cormorant', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}
.settlements-stat__label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Direction filter bar */
.direction-filter {
  background: var(--white);
  border-bottom: 1px solid rgba(27,58,75,0.07);
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: 0 2px 12px rgba(27,58,75,0.06);
}
.direction-filter-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.direction-filter-inner::-webkit-scrollbar { display: none; }
.direction-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  border: 1.5px solid rgba(27,58,75,0.10);
  background: transparent;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(27,58,75,0.7);
  cursor: pointer;
  transition: var(--t-base);
  white-space: nowrap;
  flex-shrink: 0;
}
.direction-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}
.direction-btn.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--white);
}
.direction-btn-count {
  background: rgba(27,58,75,0.08);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}
.direction-btn.active .direction-btn-count {
  background: rgba(255,255,255,0.25);
}

/* Settlements grid section */
.settlements-section {
  padding: 52px 0 80px;
}
.settlements-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 32px;
}

/* Settlement card (большая версия) */
.settlement-card-full {
  background: var(--white);
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(27,58,75,0.07);
  box-shadow: 0 2px 16px rgba(27,58,75,0.06);
  transition: var(--t-base);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.settlement-card-full:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201,169,110,0.2);
}
.settlement-card-full:hover .sc-img img { transform: scale(1.05); }

.sc-img {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
}
.sc-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.sc-road-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(27,58,75,0.8);
  backdrop-filter: blur(8px);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}
.sc-distance {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.sc-fav {
  position: absolute;
  bottom: 14px; right: 14px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t-base);
}
.sc-fav:hover { transform: scale(1.1); background: var(--white); }
.sc-fav svg { width: 15px; height: 15px; stroke: var(--navy); fill: none; transition: var(--t-fast); }
.sc-fav.active svg { fill: #E53935; stroke: #E53935; }

.sc-body { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; }
.sc-name {
  font-family: 'Cormorant', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}
.sc-location {
  font-size: 12px;
  color: rgba(27,58,75,0.5);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sc-location svg { width: 11px; height: 11px; flex-shrink: 0; }

.sc-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.sc-feature {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(201,169,110,0.07);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(27,58,75,0.7);
}
.sc-feature svg { width: 11px; height: 11px; color: var(--gold-dark); }

.sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(27,58,75,0.06);
  margin-top: auto;
}
.sc-price-from {
  font-size: 12px;
  color: rgba(27,58,75,0.45);
  margin-bottom: 2px;
}
.sc-price-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-family: 'Cormorant', serif;
}
.sc-objects-count {
  font-size: 12px;
  color: rgba(27,58,75,0.5);
  text-align: right;
}
.sc-objects-count strong { color: var(--gold-dark); font-size: 16px; display: block; font-weight: 700; }

/* ============================================
   Settlement detail page
   ============================================ */

/* Settlement hero */
.settlement-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.settlement-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 8s ease;
}
.settlement-hero:hover .settlement-hero-bg { transform: scale(1.03); }
.settlement-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,20,30,0.92) 0%,
    rgba(10,20,30,0.55) 45%,
    rgba(10,20,30,0.25) 100%
  );
}
.settlement-hero-content {
  position: relative;
  z-index: 2;
  padding: 100px 0 52px;
  width: 100%;
}
.settlement-hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.settlement-badge {
  background: rgba(201,169,110,0.18);
  border: 1px solid rgba(201,169,110,0.35);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}
.settlement-badge.road {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}
.settlement-hero-title {
  font-family: 'Cormorant', serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.15;
}
.settlement-hero-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  flex-wrap: wrap;
}
.settlement-hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.settlement-hero-meta-item svg { width: 14px; height: 14px; color: var(--gold); }

/* Settlement facts strip */
.settlement-facts-strip {
  background: var(--white);
  border-bottom: 1px solid rgba(27,58,75,0.07);
  box-shadow: 0 4px 20px rgba(27,58,75,0.08);
}
.settlement-facts-inner {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.settlement-facts-inner::-webkit-scrollbar { display: none; }
.settlement-fact {
  flex: 1;
  min-width: 130px;
  padding: 22px 20px;
  border-right: 1px solid rgba(27,58,75,0.06);
  text-align: center;
}
.settlement-fact:last-child { border-right: none; }
.settlement-fact__val {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  font-family: 'Cormorant', serif;
  margin-bottom: 4px;
}
.settlement-fact__label {
  font-size: 11px;
  color: rgba(27,58,75,0.45);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Settlement layout */
.settlement-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 48px 0 80px;
  align-items: start;
}
.settlement-main {}
.settlement-sidebar { position: sticky; top: 90px; }

/* Description */
.settlement-section {
  margin-bottom: 40px;
}
.settlement-section-title {
  font-family: 'Cormorant', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(27,58,75,0.07);
  position: relative;
}
.settlement-section-title::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
}

/* Infrastructure grid */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.infra-item {
  background: var(--cream);
  border: 1px solid rgba(27,58,75,0.06);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: var(--t-base);
}
.infra-item:hover {
  border-color: rgba(201,169,110,0.25);
  background: rgba(201,169,110,0.04);
}
.infra-item-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(201,169,110,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
}
.infra-item-icon svg { width: 18px; height: 18px; }
.infra-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}
.infra-item-dist {
  font-size: 11px;
  color: rgba(27,58,75,0.45);
}

/* Map */
.settlement-map {
  height: 400px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid rgba(27,58,75,0.07);
  position: relative;
  isolation: isolate;
  z-index: 0;
}
#settlement-ymap { width: 100%; height: 100%; }

/* Settlement objects */
.settlement-objects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Sidebar */
.settlement-contact-card {
  background: var(--navy);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 20px;
}
.scc-head {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.scc-price-from {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.scc-price {
  font-family: 'Cormorant', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.scc-price-note {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.scc-body { padding: 20px 24px 24px; }
.scc-form-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
}
.scc-body .hm-form input,
.scc-body .hm-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: 'Onest', sans-serif;
  color: var(--white);
  background: rgba(255,255,255,0.07);
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: border-color var(--t-fast);
}
.scc-body .hm-form input::placeholder,
.scc-body .hm-form textarea::placeholder { color: rgba(255,255,255,0.35); }
.scc-body .hm-form input:focus,
.scc-body .hm-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.scc-body .hm-form textarea { resize: none; height: 72px; }
.scc-body .hm-form .btn { width: 100%; justify-content: center; }
.scc-privacy {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
}
.scc-privacy a { color: var(--gold); }

/* Settlement sidebar info */
.scc-info {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid rgba(27,58,75,0.08);
  overflow: hidden;
}
.scc-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(27,58,75,0.05);
  font-size: 13px;
}
.scc-info-row:last-child { border-bottom: none; }
.scc-info-key { color: rgba(27,58,75,0.55); }
.scc-info-val { font-weight: 700; color: var(--navy); text-align: right; }
.scc-info-val.green { color: #2e7d32; }
.scc-info-val.gold { color: var(--gold-dark); }

/* ============================================
   Yandex Map styles (shared)
   ============================================ */
.ymaps-wrapper {
  width: 100%; height: 100%;
  border-radius: inherit;
  overflow: hidden;
}
/* Кастомный маркер на карте */
.hm-placemark {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-family: 'Onest', sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1.5px solid rgba(201,169,110,0.4);
  cursor: pointer;
}
.hm-placemark::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
  border-bottom: none;
}
.hm-placemark:hover { background: var(--gold-dark); border-color: var(--gold); }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .settlements-grid-full { grid-template-columns: repeat(2, 1fr); }
  .settlement-layout { grid-template-columns: 1fr 300px; }
  .infra-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .settlement-layout { grid-template-columns: 1fr; }
  .settlement-sidebar { position: static; }
  .settlement-objects-grid { grid-template-columns: 1fr; }
  .settlement-map { height: 300px; }
}
@media (max-width: 700px) {
  .settlements-grid-full { grid-template-columns: 1fr; }
  .settlement-hero { min-height: 420px; }
  .settlement-hero-title { font-size: 28px; }
  .settlement-facts-strip .settlement-fact { min-width: 110px; padding: 16px 12px; }
  .infra-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Photo gallery on settlement page ---- */
.sg-gallery {
  position: relative;
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #1B3A4B;
}
.sg-gallery__item { display: none; width: 100%; height: 100%; }
.sg-gallery__item--active { display: block; }
.sg-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: background .2s;
}
.sg-btn:hover { background: rgba(0,0,0,.7); }
.sg-btn--prev { left: 12px; }
.sg-btn--next { right: 12px; }
.sg-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.sg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.45); border: none; cursor: pointer; padding: 0;
  transition: background .2s;
}
.sg-dot--active { background: #C9A96E; }
.sg-counter {
  position: absolute; bottom: 10px; right: 14px;
  background: rgba(0,0,0,.5); color: #fff; font-size: .72rem;
  padding: 2px 8px; border-radius: 20px; z-index: 2;
}
.sg-thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px;
  scrollbar-width: thin;
}
.sg-thumb {
  flex-shrink: 0; width: 72px; height: 52px; border-radius: 4px;
  overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0;
  transition: border-color .2s;
}
.sg-thumb--active { border-color: #C9A96E; }
.sg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Card carousel ---- */
.sc-img { position: relative; overflow: hidden; }
.sc-slide { display: none; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.sc-slide--active { display: block; position: static; }
.sc-arr {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.4); color: #fff; border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 18px; cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; line-height: 1;
}
.sc-arr:hover { background: rgba(0,0,0,.65); }
.sc-arr--l { left: 8px; }
.sc-arr--r { right: 8px; }
.sc-dots-row {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 5;
}
.sc-dot-s {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.45);
  transition: background .2s;
}
.sc-dot-s--on { background: #C9A96E; }
.sc-short-desc {
  font-size: .82rem; color: var(--text-muted, #666);
  line-height: 1.5; margin: 0 0 12px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.settlement-card-full.sc-map-active {
  outline: 2px solid #C9A96E;
  box-shadow: 0 0 0 4px rgba(201,169,110,.2);
}
