/* ===== Переменные ===== */
:root {
  --green: #2E5A3B;
  --brown: #6B4E3D;
  --sand: #D4B896;
  --cream: #F7F1E3;
  --accent: #E6A43F;
  --accent-strong: #D87C3E;
  --glass: rgba(247, 241, 227, 0.12);
  --glass-border: rgba(13, 20, 16, 0.35);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Raleway", "Segoe UI", system-ui, sans-serif;
  --marker-size: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--sans);
  color: var(--cream);
  background: #0d1410;
  overflow: hidden;
}

img { display: block; }

/* ===== Слайдер ===== */
.slider {
  position: fixed;
  inset: -12%;
  z-index: 0;
}
.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity;
}

.slide.is-active { opacity: 1; }

.slider__overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(13, 20, 16, 0.28) 100%),
    linear-gradient(180deg, rgba(13,20,16,0.3) 0%, transparent 22%, transparent 88%, rgba(13,20,16,0.25) 100%);
}

/* ===== Маркеры ===== */
.markers {
  position: fixed;
  inset: 0;
  z-index: 3;
}
.marker {
  position: absolute;
  width: var(--marker-size);
  height: var(--marker-size);
  margin-left: calc(var(--marker-size) / -2);
  margin-top: calc(var(--marker-size) / -2);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,1.3,.4,1);
}
.marker.is-visible { opacity: 1; transform: scale(1); }
.marker__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(230, 164, 63, 0.18);
  animation: pulse 2.4s ease-out infinite;
}
.marker__plus {
  position: relative;
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: 50%;
  background: rgba(247, 241, 227, 0.14);
  border: 1px solid rgba(247, 241, 227, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.marker__plus::before,
.marker__plus::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 42%; height: 1.5px;
  background: var(--cream);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.marker__plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.marker:hover .marker__plus,
.marker:focus-visible .marker__plus {
  transform: scale(1.18);
  background: var(--accent);
}
.marker.is-active .marker__plus {
  background: var(--accent-strong);
  transform: scale(1.18);
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ===== Шапка ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(18px, 3vw, 38px) clamp(18px, 4vw, 52px);
  pointer-events: none;
}
.topbar__brand { display: flex; flex-direction: column; gap: 4px; }
.topbar__logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: .14em;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.topbar__slogan {
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--sand);
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
  opacity: .92;
}

/* ===== Контролы слайдера (скрыты) ===== */
.slider__controls { display: none; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--cream);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all .3s ease;
}
.dot.is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.dot:hover { background: rgba(247,241,227,.6); }

/* ===== Кнопка Арендовать ===== */
.rent-wrap {
  position: fixed;
  bottom: clamp(28px, 6vh, 56px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
.rent-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(16px, 1.5vw, 19px);
  letter-spacing: .06em;
  color: #2a1907;
  padding: 18px 46px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(135deg, rgba(230,164,63,.82) 0%, rgba(216,124,62,.82) 100%);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  box-shadow: 0 14px 40px rgba(216, 124, 62, .4), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .25s cubic-bezier(.2,1.3,.4,1), box-shadow .25s ease, filter .25s ease;
  animation: floaty 5s ease-in-out infinite;
}
.rent-btn:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.06); box-shadow: 0 20px 55px rgba(216,124,62,.55); }
.rent-btn:active { transform: translateY(-1px) scale(.99); }
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

/* ===== Попап объекта ===== */
.popup-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(13, 20, 16, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s ease;
}
.popup-overlay.is-open,
.modal-overlay.is-open { opacity: 1; }

.popup {
  position: fixed;
  z-index: 10;
  max-width: 340px;
  width: calc(100% - 32px);
  padding: 26px 26px 24px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(46,90,59,.42), rgba(13,20,16,.55));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: opacity .3s ease, transform .35s cubic-bezier(.2,1.3,.4,1);
}
.popup.is-open { opacity: 1; transform: translateY(0) scale(1); }

.popup__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 10px;
  padding-right: 24px;
}
.popup__text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(247,241,227,.9);
}
.popup__close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--cream);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background .2s ease, transform .2s ease;
}
.popup__close:hover { background: rgba(255,255,255,.12); transform: rotate(90deg); }
#popup-close { display: none; }

/* ===== Модалка аренды ===== */
.modal {
  position: fixed;
  z-index: 10;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.96);
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(247,241,227,.96), rgba(212,184,150,.92));
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity .3s ease, transform .35s cubic-bezier(.2,1.3,.4,1);
}
.modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal .popup__close { color: var(--brown); }
.modal .popup__title { color: var(--green); }

.rent-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brown);
  font-weight: 600;
}
.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(107,78,61,.3);
  background: rgba(255,255,255,.7);
  font-family: var(--sans);
  font-size: 15px;
  color: #2a1907;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,164,63,.25);
}
.rent-form__submit {
  margin-top: 6px;
  padding: 15px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: #2a1907;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 28px rgba(216,124,62,.4);
  transition: transform .2s ease, filter .2s ease;
}
.rent-form__submit:hover { transform: translateY(-2px); filter: brightness(1.05); }
.rent-form__note { font-size: 11px; color: rgba(107,78,61,.85); text-align: center; }

.rent-contacts {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(107,78,61,.2);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rent-contacts a {
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(107,78,61,.2);
  transition: background .2s ease;
}
.rent-contacts a:hover { background: rgba(255,255,255,.9); }

/* ===== Правая панель (rail) ===== */
.rail {
  position: fixed;
  right: clamp(14px, 2.5vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity .3s ease;
}
.rail.is-hidden { opacity: 0; pointer-events: none; }
.rail__btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.rail__btn:hover { transform: scale(1.1); background: rgba(247,241,227,.22); }
.rail__btn.is-active { background: var(--accent); color: #2a1907; transform: scale(1.08); }
.rail__x { display: none; }
.rail__btn.is-active .rail__icon { display: none; }
.rail__btn.is-active .rail__x { display: block; }
.rail.has-open .rail__btn:not(.is-active) {
  opacity: 0;
  pointer-events: none;
  transform: scale(.6);
}
.rail__btn { transition: transform .25s ease, background .25s ease, color .25s ease, opacity .25s ease; }

.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(13, 20, 16, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .3s ease;
}
.panel-overlay.is-open { opacity: 1; }

.side-panel {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 88vw);
  padding: 22px 56px 22px 22px;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(46,90,59,.4), rgba(13,20,16,.52));
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: -20px 0 60px rgba(0,0,0,.4);
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.2,.9,.3,1);
}
.side-panel.is-open { transform: translateX(0); }
.side-panel__close { display: none; }
.side-panel__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 12px;
}
.side-block { margin-bottom: 12px; }
.side-block__title {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 600;
}
.side-block__text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247,241,227,.9);
}
.side-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.side-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(247,241,227,.92);
}
.side-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.side-map {
  display: inline-block;
  margin-top: 6px;
  padding: 9px 16px;
  border-radius: 100px;
  background: var(--accent);
  color: #2a1907;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: filter .2s ease, transform .2s ease;
}
.side-map:hover { filter: brightness(1.06); transform: translateY(-2px); }
.side-map--ghost {
  background: rgba(247,241,227,.14);
  color: var(--cream);
  border: 1px solid var(--glass-border);
}
.side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.side-actions .side-map { margin-top: 0; }
.side-panel__intro {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247,241,227,.92);
  margin-bottom: 12px;
}
.side-book { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(247,241,227,.18); }
.side-phone {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: filter .2s ease;
}
.side-phone:hover { filter: brightness(1.1); }

/* ===== Адаптив ===== */
@media (max-width: 768px) {
  :root { --marker-size: 32px; }
  .topbar { padding: 16px 20px; }
  .topbar__slogan { letter-spacing: .18em; }
  .slider__controls { display: none; }
  .marker__ring { animation: none; opacity: .35; }
  .rent-btn { padding: 16px 40px; font-size: 17px; }
  .popup {
    top: 58%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: calc(100% - 32px);
    max-width: none;
    transform: translate(-50%, -50%) translateY(12px) scale(.96);
  }
  .popup.is-open { transform: translate(-50%, -50%) scale(1); }
  .modal { width: calc(100% - 24px); padding: 24px; }
  .rail { right: 12px; }
  .rail__btn { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
  :root { --marker-size: 30px; }
  .topbar__slogan { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .marker__ring, .rent-btn { animation: none; }
  .slide { transition-duration: .4s; }
}
