/* ========== PLOTS PAGE ========== */

/* ---- Hero ---- */
.plots-hero {
  position: relative;
  min-height: 480px;
  background: var(--B-brand, #354e33);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.plots-hero__slide {
  background-position: center 48%;
  filter: saturate(1.02) contrast(.98);
}

.plots-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(37,58,30,.20) 0%, rgba(37,58,30,.08) 100%);
}

.plots-hero__inner {
  position: relative;
  z-index: 1;
  padding: 80px 48px 80px;
  max-width: 680px;
}

.plots-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: rgba(255,255,255,.65);
  margin-bottom: 24px;
}
.plots-crumbs a { color: rgba(255,255,255,.75); text-decoration: none; }
.plots-crumbs a:hover { color: #fff; }
.plots-crumbs .sep { opacity: .5; }

.plots-hero__title {
  font-family: 'Unbounded', 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: #fff !important;
  line-height: 1.15;
  margin: 0 0 20px;
}

.plots-hero__lead {
  font-size: 20px;
  color: rgba(255,255,255,.88);
  line-height: 1.65;
  margin: 0 0 32px;
  max-width: 520px;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,.32);
}

/* ---- Stats bar ---- */
.plots-stats {
  background: var(--B-brand, #354e33);
  border-top: 1px solid rgba(255,255,255,.1);
}

.plots-stats__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
}

.plots-stat {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px;
  border-right: 1px solid rgba(255,255,255,.1);
  gap: 4px;
}
.plots-stat:last-child { border-right: none; }

.plots-stat__num {
  font-family: 'Unbounded', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--B-gold, #B5924A);
  white-space: nowrap;
}
.plots-stat__label {
  font-size: 18px;
  color: rgba(255,255,255,.60);
  text-align: center;
  line-height: 1.4;
}

/* ---- Map section ---- */
.plots-map-section {
  padding: 64px 0 48px;
  background: var(--B-bg, #F8FBF3);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.plots-map-head {
  text-align: center;
  margin-bottom: 28px;
}

.plots-map-head__title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  color: var(--B-brand, #354e33);
  margin: 0 0 10px;
}

.plots-map-head__sub {
  font-size: 18px;
  color: var(--B-muted, #6b7568);
  margin: 0;
}

/* ---- Legend ---- */
.plots-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 18px;
}

.plots-legend__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  color: var(--B-text, #1f2a1e);
}

.plots-legend__dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,.15);
}
.plots-legend__dot--free     { background: rgba(76, 175, 80, 0.55); }
.plots-legend__dot--sold     { background: rgba(201, 122, 154, 0.7); }
.plots-legend__dot--reserved { background: rgba(228, 196, 66, 0.65); }

.plots-legend__item--count {
  margin-left: auto;
  font-size: 16px;
  color: var(--B-muted, #6b7568);
}
.plots-legend__item--count strong { color: var(--B-brand, #354e33); }

/* ---- Map wrapper ---- */
.plots-map-wrapper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 717px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(53,78,51,.18);
}

.plots-map-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.plots-map-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ---- Polygon states ---- */
.pm-polygon {
  fill-opacity: 0;
  stroke-opacity: 0;
  cursor: pointer;
  transition: fill-opacity 0.18s ease, stroke-opacity 0.18s ease;
  outline: none;
}

.pm-polygon--sold {
  fill: #c97a9a;
  fill-opacity: 0.30;
}

.pm-polygon--reserved {
  fill: #d4b83a;
  fill-opacity: 0.30;
}

/* cursor: pointer для не-участков (теперь тоже кликабельны) */
.pm-polygon--playground,
.pm-polygon--leisure,
.pm-polygon--road,
.pm-polygon--parking,
.pm-polygon--other {
  cursor: pointer;
}

.plots-map-hint {
  text-align: center;
  font-size: 16px;
  color: var(--B-muted, #6b7568);
  margin-top: 12px;
}

/* ---- Боковая панель (desktop hover, фиксирована на экране) ---- */
.plots-side-panel {
  position: fixed;
  top: 50%;
  right: 0;
  width: 300px;    /* JS перезапишет под реальный размер */
  max-width: 420px;
  min-width: 220px;
  max-height: min(70vh, calc(100vh - 180px));
  background: #fff;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 4px 32px rgba(53,78,51,.18);
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(20px, -50%);
  transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 500;
}

.plots-map-outer.is-active .plots-side-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.pm-sp__photo {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.pm-sp__photo[hidden] { display: none !important; }

.pm-sp__inner {
  padding: 16px 18px 20px;
}

.pm-sp__badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.pm-sp__title {
  font-size: 19px;
  font-weight: 700;
  color: var(--B-brand, #354e33);
  line-height: 1.3;
  margin-bottom: 12px;
}

.pm-sp__meta {
  font-size: 17px;
  color: var(--B-text, #1f2a1e);
  line-height: 1.9;
  margin-bottom: 8px;
}
.pm-sp__meta span { display: block; }

.pm-sp__desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--B-muted, #6b7568);
  margin: 0 0 12px;
}

.pm-sp__hint {
  font-size: 15px;
  color: var(--B-gold, #B5924A);
  font-weight: 600;
  margin: 0;
}

@media (max-width: 767px), (pointer: coarse) {
  .plots-side-panel { display: none !important; }
}

/* ---- Яндекс Карта ---- */
.plots-ymap-section {
  padding: 0;
}
.plots-ymap-section .plots-ymap-frame {
  width: 100%;
  height: 420px;
  overflow: hidden;
  display: block;
}
.plots-ymap-section .plots-ymap-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Benefits ---- */
.plots-benefits {
  padding: 72px 0;
  background: #fff;
}

.plots-benefits__title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--B-brand, #354e33);
  text-align: center;
  margin: 0 0 40px;
}

.plots-benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.plots-benefit {
  padding: 28px 22px;
  border: 1.5px solid var(--B-line, #dcd9cd);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plots-benefit:hover {
  border-color: var(--B-brand, #354e33);
  box-shadow: 0 4px 20px rgba(53,78,51,.10);
}

.plots-benefit__icon {
  font-size: 32px;
  margin-bottom: 12px;
  line-height: 1;
}

.plots-benefit h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--B-brand, #354e33);
  margin: 0 0 8px;
}

.plots-benefit p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--B-muted, #6b7568);
  margin: 0;
}

/* ---- Contact CTA ---- */
.plots-contact {
  background: var(--B-brand, #354e33);
  padding: 60px 24px;
  text-align: center;
}

.plots-contact__inner {
  max-width: 560px;
  margin: 0 auto;
}

.plots-contact .plots-contact__title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

.plots-contact__sub {
  font-size: 19px;
  color: rgba(255,255,255,.70);
  margin: 0 0 28px;
}

.plots-contact__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--B-gold, #B5924A);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.plots-contact__btn:hover {
  background: #9a7a3c;
  transform: translateY(-2px);
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.pm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* hidden state */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}

.pm-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.24s ease;
}

.pm-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  /* entry animation */
  transform: scale(0.93) translateY(12px);
  transition: transform 0.24s ease;
}

.pm-backdrop.is-open .pm-modal {
  transform: scale(1) translateY(0);
}

.pm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--B-bg, #F8FBF3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--B-muted, #6b7568);
  transition: background 0.15s, color 0.15s;
}
.pm-close:hover { background: var(--B-line, #dcd9cd); color: var(--B-text, #1f2a1e); }

.pm-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 40px;
}

.pm-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--B-brand, #354e33);
  margin: 0;
  line-height: 1.3;
}

.pm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}
.pm-badge--free     { background: #e8f5e9; color: #2e7d32; }
.pm-badge--sold     { background: #ffebee; color: #b71c1c; }
.pm-badge--reserved { background: #fff3e0; color: #e65100; }

.pm-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--B-bg, #F8FBF3);
  border-radius: 8px;
}

.pm-modal__meta span {
  font-size: 16px;
  font-weight: 600;
  color: var(--B-text, #1f2a1e);
}

.pm-modal__desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--B-muted, #6b7568);
  margin-bottom: 16px;
}

.pm-modal__photos {
  position: relative;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  background: var(--B-line, #dcd9cd);
}

.pm-carousel__slide {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.pm-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--B-brand, #354e33);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
  transition: background 0.15s, opacity 0.15s;
  z-index: 2;
}
.pm-carousel__btn:hover:not(:disabled) { background: #fff; }
.pm-carousel__btn:disabled { opacity: 0.35; cursor: default; }
.pm-carousel__btn--prev { left: 10px; }
.pm-carousel__btn--next { right: 10px; }

.pm-carousel__counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  pointer-events: none;
  line-height: 1.4;
}

.pm-modal__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pm-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--B-brand, #354e33);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.18s;
  flex: 1;
  justify-content: center;
  text-align: center;
}
.pm-call-btn:hover { background: var(--B-brand-deep, #263a24); }

.pm-dismiss-btn {
  background: none;
  border: 1.5px solid var(--B-line, #dcd9cd);
  color: var(--B-muted, #6b7568);
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.pm-dismiss-btn:hover { border-color: var(--B-muted, #6b7568); color: var(--B-text, #1f2a1e); }

/* ---- Mobile modal: bottom sheet ---- */
@media (max-width: 600px) {
  .pm-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .pm-modal {
    border-radius: 18px 18px 0 0;
    max-height: 82vh;
    padding: 24px 20px 32px;
    transform: translateY(40px);
  }
  .pm-backdrop.is-open .pm-modal {
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .plots-benefits__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .plots-hero__inner { padding: 60px 20px; }
  .plots-benefits__grid { grid-template-columns: 1fr; }
  .plots-stat {
    min-width: 50%;
    padding: 20px 8px;
    box-sizing: border-box;
  }
  .plots-stat__num { font-size: 20px; }
  .plots-stat__label { font-size: 16px; }
  .plots-legend__item--count { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .plots-hero__slide { transition: none !important; transform: none !important; }
  .pm-polygon { transition: none; }
  .pm-backdrop, .pm-modal { transition: none; }
}
