/**
 * Property Detail Page — Aggregated CSS
 * Includes: Gallery, Layout, Stats, Info Table, Agent Sidebar, Contact Form, Lightbox
 * Copy this entire file for self-contained property detail styling.
 */

/* =============================================
   GALLERY — Adaptive Layout
   ============================================= */

/* Single image — full width hero */
.property-gallery--single .property-gallery-main {
  width: 100%;
}
.property-gallery--single .property-gallery-main img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}
@media (min-width: 640px) {
  .property-gallery--single .property-gallery-main img { height: 400px; }
}
@media (min-width: 768px) {
  .property-gallery--single .property-gallery-main img { height: 500px; }
}

/* 2-3 images — 1 large + stacked thumbnails */
.property-gallery--few {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}
.property-gallery--few .property-gallery-main img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}
.property-gallery--few .property-gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.property-gallery--few .property-gallery-thumb {
  flex: 1;
}
.property-gallery--few .property-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* 4+ images — 1 large + 2-col thumbnail grid with "+N more" */
.property-gallery--many {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}
.property-gallery--many .property-gallery-main {
  grid-row: span 2;
}
.property-gallery--many .property-gallery-main img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
}
.property-gallery--many .property-gallery-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  grid-row: span 2;
}
.property-gallery--many .property-gallery-thumb {
  position: relative;
}
.property-gallery--many .property-gallery-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* "+N more" overlay on last visible thumbnail */
.gallery-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  pointer-events: none;
}
.gallery-more-overlay span {
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

/* =============================================
   LAYOUT
   ============================================= */
.property-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}
.property-detail-main { }
.property-detail-sidebar { }

/* =============================================
   BADGES & TAGS
   ============================================= */
.property-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2;
}
.property-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.property-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

/* =============================================
   PROPERTY DETAIL STATS
   ============================================= */
.property-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.property-detail-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--secondary);
  border-radius: var(--radius);
}
.property-detail-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}
.property-detail-stat .stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* =============================================
   PROPERTY INFO TABLE
   ============================================= */
.property-info-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}
.property-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.property-info-label {
  font-weight: 500;
  font-size: 0.875rem;
}
.property-info-value {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* =============================================
   AGENT SIDEBAR
   ============================================= */
.agent-sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 6rem;
}
.agent-sidebar-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 4px solid rgba(212, 168, 75, 0.3);
}
.agent-contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.agent-contact-row a {
  color: var(--muted-foreground);
}
.agent-contact-row a:hover {
  color: var(--foreground);
}

/* =============================================
   SIDEBAR CONTACT FORM
   ============================================= */
.sidebar-contact-form .form-group {
  margin-bottom: 0.75rem;
}
.sidebar-contact-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.sidebar-contact-form input {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--background);
}
.sidebar-contact-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* =============================================
   GALLERY HOVER & LIGHTBOX
   ============================================= */
.lightbox-trigger {
  position: relative;
  cursor: pointer;
}
.gallery-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  border-radius: var(--radius);
  pointer-events: none;
}
.gallery-hover-overlay svg {
  opacity: 0;
  transition: opacity 0.2s;
}
.lightbox-trigger:hover .gallery-hover-overlay {
  background: rgba(0, 0, 0, 0.2);
}
.lightbox-trigger:hover .gallery-hover-overlay svg {
  opacity: 1;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  z-index: 10;
}
.lightbox-topbar-actions {
  display: flex;
  gap: 0.5rem;
}
.lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}
.lightbox-btn {
  padding: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}
.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-image {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
  user-select: none;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
  display: flex;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev {
  left: 0.5rem;
}
.lightbox-next {
  right: 0.5rem;
}
.lightbox-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}
.lightbox-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s;
}
.lightbox-dot.active {
  background: white;
}
.lightbox-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.property-gallery--many .property-gallery-thumbs .property-gallery-thumb img{
    height: 100%;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .property-gallery--few,
  .property-gallery--many {
    grid-template-columns: 1fr;
  }
  .property-gallery--few .property-gallery-main img,
  .property-gallery--many .property-gallery-main img {
    height: 300px;
    min-height: auto;
  }
  .property-gallery--few .property-gallery-thumbs {
    flex-direction: row;
  }
  .property-gallery--few .property-gallery-thumb img {
    height: 120px;
  }
  .property-gallery--many .property-gallery-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }
  .property-gallery--many .property-gallery-thumb img {
    height: 120px;
  }
  .property-detail-layout {
    grid-template-columns: 1fr;
  }
  .property-detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .property-info-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lightbox-nav {
    padding: 0.5rem;
  }
  .lightbox-nav svg {
    width: 24px;
    height: 24px;
  }
}
