/**
 * Property Detail Page Styles
 */

/* Fix navbar logo size on static pages */
.navbar-brand .navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* Ensure footer has correct text colors */
.footer h4 {
  color: white !important;
}

.footer p,
.footer li,
.footer a {
  color: rgba(255, 255, 255, 0.8) !important;
}

.footer a:hover {
  color: white !important;
}

.property-detail {
  min-height: 100vh;
  padding: var(--space-8) 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: var(--space-4);
  transition: transform 0.2s ease;
}

.back-link:hover {
  transform: translateX(-4px);
}

.property-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.property-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-light);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.property-location svg {
  fill: var(--color-primary);
}

.property-price {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}

.property-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.gallery-item img:hover {
  transform: scale(1.02);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  /* On mobile, `vh` is computed against the largest viewport (URL bar
     hidden), so 92vh can exceed the actually-visible area and the image
     looks cropped at the bottom. `dvh` (dynamic viewport height) tracks
     the real visible height. `vh` stays as a fallback for old browsers. */
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 92vh;
  max-height: 92dvh;
  object-fit: contain;
  cursor: zoom-in;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  /* JS handles wheel + pinch zoom; let it own all touch gestures so the
     browser doesn't try to page-zoom on top. */
  touch-action: none;
}

/* While zoomed, hide arrows + counter so they don't obstruct panning. */
.lightbox[data-zoomed="true"] .lightbox-prev,
.lightbox[data-zoomed="true"] .lightbox-next,
.lightbox[data-zoomed="true"] .lightbox-counter {
  display: none !important;
}

.lightbox[data-zoomed="true"] .lightbox-img {
  cursor: grab;
}

.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: background 0.15s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .lightbox-btn { width: 40px; height: 40px; font-size: 20px; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev  { left: 8px; }
  .lightbox-next  { right: 8px; }
}

.property-specs {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-4);
  background: var(--color-background);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.spec-item {
  text-align: center;
}

.spec-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
}

.spec-label {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.property-description {
  margin-bottom: var(--space-6);
}

.property-description h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.property-description p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-light);
}

.property-features {
  margin-bottom: var(--space-6);
}

.property-features h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-background);
  border-radius: var(--radius-md);
}

.features-list li::before {
  content: '✓';
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.2em;
}

.property-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .property-title {
    font-size: var(--text-2xl);
  }

  .property-price {
    font-size: var(--text-xl);
  }

  .property-gallery {
    grid-template-columns: 1fr;
  }

  .property-specs {
    gap: var(--space-3);
  }

  .features-list {
    grid-template-columns: 1fr;
  }

  .property-actions {
    flex-direction: column;
  }

  .property-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
