/* ===== PROPERTY DETAILS PAGE STYLES ===== */

:root {
  /* Core design system variables */
  --card-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.12);
  --radius: 12px;
}

/* Card styling for consistent glass-morphism containers */
.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(15px, 4vw, 24px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Container = identical to .reviews-list-container */
.property-details-container {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(15px, 4vw, 15px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  max-width: 1400px;   /* match navigation/header */
  width: 100%;
  margin: 15px auto 0;   /* center it */
  box-sizing: border-box;
}

/* Prevent horizontal overflow in the card */
.property-details-container {
  overflow: hidden;                 /* clip any tiny overhangs */
}

/* Grid children must be allowed to shrink */
.property-hero,
.property-hero > *,
.property-gallery-main,
.property-right,
.property-image.carousel,
.property-thumbs4,
.property-thumbs-rest.property-map {
  min-width: 0;                     /* critical for grids on small screens */
}

/* Media/content should never exceed the container width */
.property-details-container img,
.property-details-container iframe {
  max-width: 100%;
  width: 100%;
  display: block;
}

/* Restore general section-title for elements not specifically targeted */
.section-title {
  text-align: center;
  margin: 0 auto 16px;
}

.map-section .section-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem) !important; /* Match font size */
  margin: 0 !important; /* Remove all margins */
  color: #fff !important; /* Match color */
  text-align: left !important; /* Left align for map section */
}

.reviews-section .section-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem) !important; /* Match font size */
  margin: 0 !important; /* Remove all margins */
  color: #fff !important; /* Match color */
  text-align: left !important; /* Left align for reviews section */
}

/* Make inner content transparent so only the outer card shows */
.property-details {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: 0;
}

/* Carousel (kept minimal) */
.property-image.carousel { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.carousel-track { position: relative; width: 100%; height: 100%; }
.carousel-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.carousel-slide.active { opacity: 1; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(11,18,32,0.8); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.carousel-btn.prev { left: 10px; } .carousel-btn.next { right: 10px; }
.carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.carousel-dots .dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.5); }
.carousel-dots .dot.active { width: 18px; background: #fff; }

/* Hero layout */
.property-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;  /* 2/3 + 1/3 */
  gap: 12px;
  margin-bottom: clamp(0px, 3vw, 0px);
  align-items: stretch;            /* stretch right to match left */
}

/* Left main carousel keeps aspect ratio */
.property-gallery-main .property-image.carousel {
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Right column: 3 equal sections - thumbnails, rating, widget */
.property-right {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;  /* Three equal sections */
  gap: 12px;
  height: 100%;
  min-height: 450px; /* Ensure minimum height for good proportions */
}

/* Top: 2x2 small thumbs (about 80–120px tall each) */
.property-thumbs4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: clamp(80px, 9vw, 120px);  /* control thumb size */
  gap: 8px;
  align-content: start;
  min-height: 0;
}

.property-thumb4 {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.property-thumb4 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Bottom: map fills remaining space */
.property-thumbs-rest.property-map {
  display: block;
  height: 100%;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.property-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---- Lightbox (fullscreen image viewer) ---- */
body.modal-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(9,12,20,0.92);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 1000;
  place-items: center;
}

.lightbox.open { display: grid; }

.lightbox-inner {
  position: relative;
  max-width: 94vw;
  max-height: 92vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}

.lightbox-prev { left: -56px; }
.lightbox-next { right: -56px; }

.lightbox-close {
  position: absolute;
  top: -56px; right: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
}

.lightbox-caption {
  margin-top: 10px;
  text-align: center;
  color: #cfd6e4;
  font-size: 0.95rem;
}

/* Title shown above the gallery */
.property-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 600;
}
.property-title-hero { margin-bottom: 12px; }

/* Title shown inside the left gallery column */
.property-gallery-main .property-title-hero.in-gallery {
  margin: 0 0 clamp(6px, 1.2vw, 12px);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.2;
}



/* Property description styles */
.property-description {
  margin-top: 20px;
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

/* Style HTML content inside description */
.property-description h1,
.property-description h2,
.property-description h3 {
  color: #fff;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.property-description h1 { font-size: 1.8rem; }
.property-description h2 { font-size: 1.5rem; }
.property-description h3 { font-size: 1.2rem; }

.property-description p {
  margin-bottom: 1em;
}

.property-description ul,
.property-description ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.property-description li {
  margin-bottom: 0.5em;
}

.property-description a {
  color: var(--accent);
  text-decoration: underline;
}

.property-description strong {
  color: #fff;
  font-weight: 600;
}

/* Property features section */
.property-features {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0px;
}

/* When features are in the gallery main (under carousel), add top margin */
.property-gallery-main .property-features {
  margin-top: clamp(12px, 2.5vw, 16px);
}

.property-features span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(8px, 2vw, 10px) clamp(16px, 3vw, 18px);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(79,159,248,0.15), rgba(126,231,181,0.15));
  border: 1px solid rgba(79,159,248,0.35);
  min-width: clamp(90px, 20vw, 100px);
  box-sizing: border-box;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: #fff;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .property-features {
    justify-content: center;
  }
}

/* Reviews title row: title on left, average on right */
.reviews-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
}

.reviews-avg-score {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #4a9eff;
}

@media (max-width: 768px) {
  .reviews-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Match reviews container width to booking-widget-container on property details page */
.reviews-list-container {
  max-width: 1400px !important;
  width: 100% !important;
  margin: 15px auto !important;
}

/* ===== Reviews + Map combined section ===== */
.reviews-map-container {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(15px, 4vw, 15px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  max-width: 1400px;
  width: 100%;
  margin: 15px auto 0;
  box-sizing: border-box;
  overflow: hidden;
}

.reviews-map-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.reviews-section {
  flex: 2;
}

.map-section {
  flex: 1;
}

.reviews-map-left,
.reviews-map-right { min-width: 0; }

/* Let the reviews container fill the grid cell and drop its own max-width/margins */
.reviews-map-container .reviews-list-container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}

/* Right column: keep at top of grid cell */
.reviews-map-right {
  align-self: start;
  position: static; /* was: sticky */
  /* top: 80px; */   /* remove */
}

/* Stick only the map so the rating card stays at the very top */
.reviews-map-right .property-map-full,
.reviews-map-right .property-map {
  position: sticky;
  top: 80px; /* adjust to your header height */
}

/* Rating average card above the map (right column) */
.reviews-map-right .rating-average {
  position: static; /* parent column is sticky */
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: clamp(12px, 2.5vw, 16px);
  margin-bottom: 12px;
}

/* Support either .property-map-full or .property-map inside the right column */
.reviews-map-container .property-map-full,
.reviews-map-container .property-map {
  height: 100%;
  min-height: 420px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.reviews-map-container .property-map-full iframe,
.reviews-map-container .property-map iframe {
  width: 100%;
  height: clamp(440px, 52vh, 680px); /* slightly shorter */
  border: 0;
  display: block;
}

/* In the combined Reviews + Map layout, remove the inline avg score on the left */
.reviews-map-left .reviews-avg-score,
.reviews-map-left #prAvgScore {
  display: none !important;
}

/* With the right-side element gone, keep the title aligned left */
.reviews-map-left .reviews-title-row {
  justify-content: flex-start;
}

/* Make the map fill the whole propertyMapContainer */
#propertyMapContainer {
  position: sticky;
  top: 80px;
  padding: 32px;
  margin-top: 0;
  /* was: height: clamp(380px, 55vh, 640px); */
  height: auto; /* let the iframe define height */
}

/* Ensure any map content fills the container */
/* Remove iframe here so it isn't forced to absolute/100% height */
#propertyMapContainer .gm-style,          /* Google Maps JS API canvas */
#propertyMapContainer .map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Responsive styles */
@media (max-width: 768px) {
  .property-details-container {
    padding: 1rem; /* Adjust padding for smaller screens */
  }

  .section-title {
    font-size: 1.5rem; /* Adjust font size for smaller screens */
  }

  .property-details p {
    font-size: 0.9rem; /* Adjust font size for smaller screens */
  }
}

/* Mobile: stack and grid of small thumbs below */
@media (max-width: 900px) {
  .property-hero { grid-template-columns: 1fr; }
  .property-right { grid-template-rows: auto auto; }
  .property-thumbs4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* allow full shrink */
    grid-auto-rows: 64px;
    gap: 6px;                                         /* avoid rounding bleed */
    overflow: hidden;                                 /* clip any sub‑pixel overhang */
  }
  .property-thumbs-rest.property-map { height: 260px; }
  .property-hero { gap: 8px; }
  .property-right { grid-template-rows: auto 260px; } /* thumbs auto, map fixed height */
  .property-map iframe { height: 100%; }
  .carousel-btn { width: 32px; height: 32px; }        /* slightly smaller buttons */
  .lightbox-inner { max-width: 96vw; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
  .property-title-hero { margin-bottom: 8px; }
}

/* Mobile: stack Reviews (top) and Map (below) */
@media (max-width: 768px) {
  .reviews-map-content {
    flex-direction: column;
  }
}

/* Phones: stack Reviews (top) and Map (below) */
@media (max-width: 700px) {
  .reviews-map-container {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .reviews-map-right { position: static; }

  /* Disable sticky map on phones */
  .reviews-map-right .property-map-full,
  .reviews-map-right .property-map {
    position: static !important;
    top: auto !important;
  }

  /* Keep the map inside its container (anchors absolutely positioned iframe) */
  #propertyMapContainer {
    position: relative !important;
    top: auto !important;
    height: clamp(300px, 50vh, 520px);
    margin-top: 0;
  }
}



/* Thumbnails section (top 1/3) */
.property-thumbnails {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: clamp(8px, 1.5vw, 12px);
}

/* Individual thumbnail styling */
.thumbnail {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.thumbnail:hover {
  transform: scale(1.02);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Thumbnail overlay for remaining photos count */
.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.remaining-count {
  color: #fff;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Average score card (middle 1/3) */
.property-right #prRatingAverage {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 125px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: clamp(12px, 2.5vw, 16px);
}

/* Widget container (bottom 1/3) */
.property-widget-container {
  display: flex;
  align-items: flex-start; /* Align to top instead of stretch */
  justify-content: center;
  width: 100%;
  height: auto; /* Auto height instead of 100% */
  min-height: fit-content; /* Only as tall as content needs */
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: clamp(8px, 1.5vw, 12px);
  overflow: visible; /* Allow natural widget sizing */
}

#widgetContainer {
  width: 100%;
  height: auto; /* Allow natural height */
  min-height: 200px; /* Minimum height for fallback content */
  display: flex;
  align-items: flex-start; /* Align to top */
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Booking widget styling within the container */
#widgetContainer #booking-widget-box {
  width: 100% !important;
  height: auto !important; /* Let it size naturally */
  max-height: 100%;
  border-radius: 8px !important;
  overflow: visible; /* Allow natural sizing */
  display: block !important; /* Use block instead of flex */
}

/* Ensure the widget content sizes naturally */
#widgetContainer #booking-widget-box * {
  box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .property-right {
    min-height: 400px;
  }
}

@media (max-width: 700px) {
  .property-right {
    min-height: 350px;
    gap: 10px;
  }
}

/* Map section: ensure title/address are visible above the map */
.property-map-full { 
  height: auto !important;
  position: static;
}

.property-map-full .map-section {
  display: grid;
  gap: 0.5rem;
}

.property-map-full .map-section .section-title,
.property-map-full .map-section .property-address {
  position: static;
  z-index: 1;
  margin: 0;
}

/* Property address styling in map section */
.property-address {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}

.property-address p {
  display: block !important;
  margin: 4px 0 !important;
  padding: 0 !important;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  width: 100%;
}

.property-address p:last-child {
  margin-bottom: 0;
}

.property-map-full iframe {
  position: static !important;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Optional: tweak for smaller screens */
@media (max-width: 700px) {
  .property-map-full iframe {
    height: clamp(320px, 50vh, 480px); /* slightly shorter on phones */
  }
}

/* No Photo Placeholder Styles */
.no-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  text-align: center;
}

.no-photo-placeholder span {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}

.no-photo-placeholder p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.6;
}

.no-photo-placeholder-small {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 6px;
}

.no-photo-placeholder-small span {
  font-size: 1.5rem;
  opacity: 0.3;
}

.thumbnail.no-photo {
  cursor: default;
}

.carousel-slide.no-photo {
  cursor: default;
}