/* ================== RESET ================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;

  /* скрытие скроллбара */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }
body::-webkit-scrollbar { display: none; }

/* ================== VARIABLES ================== */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent: #ffffff;
  --accent-hover: #7c3aed;
  --border: #2a2a2a;
}

/* ================== BASE ================== */

body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-y: scroll;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .container { padding: 0 15px; }
}

/* ================== HEADER ================== */

header {
  background-color: var(--bg-secondary);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 50px;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 50px;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
nav a:hover { color: var(--accent); }

/* ================== HERO ================== */

.hero {
  padding: 6rem 0;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent), #919191);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* ================== SECTIONS ================== */

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.properties {
  padding: 5rem 0;
}

/* ================== PROPERTY CARD ================== */

.property-card {
  background-color: var(--bg-card);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

.property-card:hover {
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.property-card.house-card:hover {
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.property-card.apartment-card:hover {
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.property-card > *:last-child { margin-bottom: 0; }

.property-content {
  display: flex;
  gap: 2rem;
  align-items: stretch;
}

@media (max-width: 768px) {
  .property-content { gap: 1.5rem; }
}

.property-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.property-type {
  background-color: var(--accent);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.property-type.house { background-color: #ef4444; }
.property-type.apartment { background-color: #8b5cf6; }
.property-type.sauna { background-color: #ef4444; }

/* ================== CAROUSEL ================== */

.carousel-container {
  width: 60%;
  min-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--bg-secondary);

  display: flex;
  min-height: 500px;
  align-self: stretch;
}

.carousel-container,
.carousel,
.carousel-track,
.carousel-slide {
  line-height: 0;
}

.carousel {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s ease-in-out;
}

.carousel-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  opacity: 1;
}

/* кнопки */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

.carousel-btn:hover {
  background: rgba(139,92,246,0.8);
}

/* dots */
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 6;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}
.dot.active { background: var(--accent); }

/* ================== CAROUSEL LOADING OVERLAY (SPINNER) ================== */

.carousel.is-preparing .carousel-slide { opacity: 0 !important; pointer-events: none !important; }
.carousel.is-preparing .carousel-btn,
.carousel.is-preparing .carousel-dots { opacity: 0 !important; pointer-events: none !important; }

.carousel-loading {
  position: absolute;
  inset: 0;
  display: none; /* включается через JS */
  align-items: center;
  justify-content: center;
  z-index: 20;

  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}

.carousel-loading .spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(139, 92, 246, 0.85); /* акцент */
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================== INFO ================== */

.property-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.property-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.property-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.property-detail-item .icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  color: #fff;
  opacity: 0.92;
  }

.property-detail-item .icon use { pointer-events: none; }

.property-detail-item .icon{
  fill: currentColor;
}

.property-price {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* ================== MINI MAP ================== */

.mini-map {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  margin-top: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 150px;
}

.mini-map:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.mini-map iframe {
  border: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mini-map.interactive-map iframe {
  pointer-events: auto;
}

/* ================== ABOUT / CONTACT ================== */

.about {
  padding: 5rem 0;
  background-color: var(--bg-secondary);
  text-align: center;
}

.about p,
.contact p {
  color: #fff;
  opacity: 0.92;
  font-size: 1.2rem;
}

.contact {
  padding: 5rem 0;
  text-align: center;
}

/* ================== FOOTER ================== */

footer {
  background-color: var(--bg-secondary);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ================== MODAL (PHOTO) ================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img {
  max-width: 95%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

#modalImage {
  transition: opacity 0.6s ease;
  will-change: opacity;
  transform: none;
}
#modalImage:hover {
  transform: none;
  cursor: default;
}

.modal-close,
.modal-prev,
.modal-next {
  position: absolute;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  font-size: 28px;
  z-index: 1001;
}

.modal-prev {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 30px;
  z-index: 1001;
}

.modal-next {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 30px;
  z-index: 1001;
}

.modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1001;
}

/* ================== LOCATION BUTTON (MOBILE) ================== */

.location-btn {
  display: none;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  align-self: stretch;
  margin: 1rem 0 0 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;

  background: rgb(239, 68, 68);
  color: var(--text-primary);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .mini-map { display: none !important; }
  .location-btn { display: block; }
  .property-info { width: 100%; }
}

/* ================== MAP MODAL ================== */

.map-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}

.map-modal-content {
  width: min(1200px, 96vw);
  height: min(92vh, 900px);
  margin: 4vh auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: relative;

  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s ease;
}

.map-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  line-height: 28px;
  cursor: pointer;
  color: #bbb;
  z-index: 3001;
}

.map-modal-close:hover { color: #fff; }

.map-container {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#locationMap {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================== RESPONSIVE ================== */

@media (max-width: 768px) {
  .container { padding: 0 15px; }

  .property-content { flex-direction: column; }

  .carousel-container {
    width: 100%;
    min-width: unset;
    min-height: unset;
    display: block;
    aspect-ratio: 16 / 9;
  }

  .carousel {
    width: 100%;
    height: 100%;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .carousel-btn.prev { left: 10px; }
  .carousel-btn.next { right: 10px; }

  .property-info { margin-top: 1.5rem; }

  .hero { padding: 3rem 0; }
  .hero h2 { font-size: 1.8rem; }
  .hero p { font-size: 1.1rem; }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .property-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .property-title { font-size: 1.5rem; }
  .property-price { font-size: 1.3rem; }

  .property-detail-item {
    flex-wrap: wrap;
    font-size: 0.9rem;
  }

  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav { gap: 1.2rem; }

  .logo { height: 40px; }
  .logo-img { height: 40px; }

  .modal-content img {
    max-width: 95%;
    max-height: 80vh;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }

  .modal-prev,
  .modal-next {
    width: 45px;
    height: 45px;
    font-size: 24px;
  }

  .modal-counter {
    bottom: 15px;
    font-size: 12px;
    padding: 4px 12px;
  }

  .map-modal-content {
    width: 96vw;
    height: 88vh;
    margin: 6vh auto 0;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .hero h2 { font-size: 1.5rem; }
  .hero { padding: 2rem 0; }

  .section-title { font-size: 1.6rem; }

  .property-card { padding: 1rem; }

  .property-details { gap: 0.5rem; }

  .property-detail-item {
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  .property-price { font-size: 1.2rem; }

  .carousel-container {
    aspect-ratio: 16 / 10;
  }

  .modal { padding: 10px; }

  .modal-content img { max-height: 80vh; }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .modal-prev,
  .modal-next {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .modal-counter {
    bottom: 10px;
    font-size: 11px;
    padding: 3px 10px;
  }
}

/* ================== CONTACT ICONS ================== */

.contact-block{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.contact-main{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-phone{
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.contact-label{
  color: var(--text-secondary);
  font-weight: 500;
}

.contact-tel{
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
}

.contact-tel:hover{ color: var(--accent); }

.contact-icons{
  display:flex;
  gap:10px;
  align-items:center;
}

.contact-icon{
  width:46px;
  height:46px;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
  text-decoration:none;

  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.contact-icon:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
}

.contact-icon img{
  width:22px;
  height:22px;
  display:block;
}

.contact-hint{
  color: var(--text-secondary);
  font-size: 0.95rem;
}
/* ===== СПИННЕР НА СЛАЙДЕ ПОКА IMG НЕ ЗАГРУЗИЛАСЬ ===== */

/* отключаем старый shimmer если он был */
.carousel-slide::before { content: none !important; }

/* пока идёт скан папки — прячем слайды/кнопки/точки, оставляем общий оверлей */
.carousel.is-preparing .carousel-slide { opacity: 0 !important; pointer-events: none !important; }
.carousel.is-preparing .carousel-btn,
.carousel.is-preparing .carousel-dots { opacity: 0 !important; pointer-events: none !important; }

/* спиннер на отдельном слайде */
.carousel-slide.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(139, 92, 246, 0.85); /* акцент */
  animation: spin 0.9s linear infinite;
  z-index: 3;
  pointer-events: none;
}

.carousel-slide.is-loaded::after,
.carousel-slide.is-error::after {
  content: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* чтобы фото не “мигало” до загрузки */
.carousel-slide img {
  opacity: 0;
  transition: opacity .2s ease;
}
.carousel-slide.is-loaded img { opacity: 1; }


/* ===== svg icons ===== */
.property-detail-item .icon,
.amenity-item .icon{
  fill: currentColor;
  stroke: currentColor;
}


/* ===== amenities block ===== */
.amenities-block{
  margin-top: -1%;
  margin-bottom: 5%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 16px;
}


.amenities-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.amenity-item{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  min-width: 0;
}

.amenity-item span{
  font-size: 13px;
  line-height: 1.2;
}

.amenity-item .icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #fff;
  opacity: 0.92;
}

@media (max-width: 420px){
  .amenities-grid{ grid-template-columns: 1fr; }
}
