/* property-detail.css — mobile-first responsive layout */
*,
*::before,
*::after { box-sizing: border-box; }

/*
 * Do NOT set overflow-x on html/body — it disables position:sticky
 * on the shared header (same as index). Clip overflow on content only.
 */
html {
  width: 100%;
  max-width: 100%;
}
body {
  background: #f9f7f2;
  color: var(--dark-jungle-green);
  margin: 0;
  width: 100%;
  max-width: 100%;
}
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 16px;
  box-sizing: border-box;
}
.page-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px 100px;
  box-sizing: border-box;
  overflow-x: clip;
}
#main-content,
#detailContent {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 18px 0 12px;
  font-size: 0.8rem;
  color: var(--cadet);
  max-width: 100%;
}
.breadcrumb a { color: var(--prussian-blue); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--gold-dark); }
.breadcrumb ion-icon { font-size: 13px; color: var(--gold); flex-shrink: 0; }
.breadcrumb span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.state-box {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 20px;
  margin-top: 24px;
  border: 1px solid rgba(212,175,55,0.15);
  box-shadow: var(--shadow-1);
}
.state-box h2 { font-family: var(--ff-display); font-size: 1.6rem; margin-bottom: 12px; }
.state-box p { color: var(--cadet); max-width: 480px; margin: 0 auto 24px; line-height: 1.7; }

/* Gallery — single column by default (mobile) */
.gallery-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  background: #ddd;
  width: 100%;
  max-width: 100%;
}
.gallery-main {
  position: relative;
  min-height: 220px;
  cursor: zoom-in;
  overflow: hidden;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-main:hover img { transform: scale(1.03); }
.gallery-side {
  display: none;
  gap: 10px;
}
.gallery-side-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
}
.gallery-side-item img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.gallery-side-item:hover img { transform: scale(1.05); }
.gallery-more {
  position: absolute; inset: 0;
  background: rgba(55,24,1,0.55);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 1rem;
}
.gallery-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 7px 14px; border-radius: 40px; font-size: 0.7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.gallery-badge.sale { background: var(--gold-gradient); color: var(--prussian-blue); }
.gallery-badge.rent { background: rgba(255,255,255,0.92); color: #0d6efd; }
.gallery-count {
  position: absolute; bottom: 14px; right: 14px; z-index: 2;
  background: rgba(0,0,0,0.65); color: white;
  padding: 7px 12px; border-radius: 40px; font-size: 0.75rem;
  display: flex; align-items: center; gap: 6px;
}
.gallery-single { grid-template-columns: 1fr; }
.gallery-single .gallery-side { display: none; }
.gallery-side-placeholder {
  background: linear-gradient(135deg, var(--prussian-blue), #2a1204);
  display: grid; place-items: center;
  color: rgba(255,255,255,0.5); font-size: 0.85rem; min-height: 140px;
}

.thumb-strip {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.thumb-strip::-webkit-scrollbar { display: none; height: 0; }
.thumb-strip button {
  flex: 0 0 72px;
  width: 72px;
  height: 56px;
  min-width: 72px;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  opacity: 0.72;
  background: none;
}
.thumb-strip button.active,
.thumb-strip button:hover { opacity: 1; border-color: var(--gold); }
.thumb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Detail layout — stacked on mobile */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 28px;
  width: 100%;
  max-width: 100%;
}
.detail-main,
.detail-sidebar {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
/* Price card first on phones/tablets for quicker CTAs */
.detail-sidebar { order: -1; }

.title-block { margin-bottom: 20px; max-width: 100%; }
.title-block h1 {
  font-family: var(--ff-display);
  font-size: clamp(1.55rem, 6vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--prussian-blue);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-start;
  color: var(--cadet);
  font-size: 0.88rem;
  max-width: 100%;
}
.title-meta span {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.title-meta ion-icon {
  color: var(--gold-dark);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}
.spec-card {
  background: white;
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-1);
  min-width: 0;
  overflow-wrap: anywhere;
}
.spec-card ion-icon { font-size: 24px; color: var(--gold-dark); margin-bottom: 6px; }
.spec-card strong { display: block; font-size: 1.05rem; color: var(--prussian-blue); margin-bottom: 3px; }
.spec-card span {
  font-size: 0.72rem;
  color: var(--cadet);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-card {
  background: white;
  border-radius: 18px;
  padding: 18px 14px;
  border: 1px solid rgba(212,175,55,0.12);
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
  max-width: 100%;
  width: 100%;
}
.section-heading {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  color: var(--prussian-blue);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--gold-gradient);
  flex-shrink: 0;
}
.description-text {
  line-height: 1.8;
  color: #3d4a4c;
  white-space: pre-wrap;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.22);
  color: var(--prussian-blue);
  padding: 8px 12px;
  border-radius: 40px;
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.feature-chip ion-icon { color: var(--gold-dark); font-size: 15px; flex-shrink: 0; }

.info-table { display: grid; gap: 0; }
.info-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(55,24,1,0.06);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row dt { color: var(--cadet); font-weight: 500; }
.info-row dd {
  color: var(--prussian-blue);
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.section-card video,
.video-section video {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  background: #000;
  max-height: 420px;
  display: block;
}
.video-placeholder {
  aspect-ratio: 16/9;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--prussian-blue), #1f0d02);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.7);
}
.video-placeholder ion-icon {
  font-size: 38px;
  display: block;
  margin: 0 auto 10px;
  color: var(--gold);
}

.price-card {
  background: linear-gradient(145deg, var(--prussian-blue) 0%, #2a1204 100%);
  color: white;
  border-radius: 22px;
  padding: 20px 16px;
  box-shadow: var(--shadow-2);
  border: 1px solid rgba(212,175,55,0.25);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
.price-card::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 55%;
  height: 120%;
  background: radial-gradient(circle, rgba(212,175,55,0.12), transparent 70%);
  pointer-events: none;
}
.price-card > * { position: relative; z-index: 1; }
.price-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  opacity: 0.7;
  margin-bottom: 8px;
}
.price-value {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.price-note { font-size: 0.82rem; opacity: 0.65; margin-bottom: 18px; }
.price-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.price-stat { text-align: center; min-width: 0; }
.price-stat strong { display: block; font-size: 1rem; }
.price-stat span { font-size: 0.68rem; opacity: 0.6; text-transform: uppercase; }

.cta-stack { display: grid; gap: 8px; }
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 12px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}
.cta-btn-primary { background: var(--gold-gradient); color: var(--prussian-blue); }
.cta-btn-outline {
  background: transparent;
  border: 1px solid rgba(212,175,55,0.45);
  color: white;
}
.cta-btn-ghost { background: rgba(255,255,255,0.08); color: white; }
.cta-btn ion-icon { font-size: 17px; flex-shrink: 0; }

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.trust-item {
  text-align: center;
  font-size: 0.64rem;
  opacity: 0.75;
  line-height: 1.35;
  min-width: 0;
}
.trust-item ion-icon {
  display: block;
  margin: 0 auto 5px;
  font-size: 18px;
  color: var(--gold-light);
}

.related-section { margin-top: 40px; width: 100%; }
.related-section h2 {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  color: var(--prussian-blue);
  margin-bottom: 18px;
  text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}
.related-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,0.12);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  max-width: 100%;
}
.related-card img { width: 100%; height: 170px; object-fit: cover; display: block; }
.related-card-body { padding: 14px; }
.related-card-body h3 {
  font-family: var(--ff-display);
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--prussian-blue);
  overflow-wrap: anywhere;
}
.related-card-body p { font-size: 0.82rem; color: var(--cadet); margin-bottom: 8px; }
.related-price { font-weight: 700; color: var(--gold-dark); font-size: 0.92rem; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 40px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--gold-gradient); color: var(--prussian-blue); }

/* Tablet+ */
@media (min-width: 640px) {
  .container { padding-inline: 24px; }
  .page-container { padding-inline: 24px; padding-bottom: 80px; }
  .gallery-main img { min-height: 300px; max-height: 460px; }
  .gallery-main { min-height: 300px; }
  .gallery-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .section-card { padding: 24px; border-radius: 22px; }
  .info-row {
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
    gap: 16px;
  }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thumb-strip button { flex: 0 0 84px; width: 84px; height: 64px; min-width: 84px; }
}

/* Desktop */
@media (min-width: 1100px) {
  .container { padding-inline: 30px; }
  .page-container { padding-inline: 24px; }
  .gallery-hero {
    grid-template-columns: 1.6fr 1fr;
    min-height: 460px;
    border-radius: 28px;
  }
  .gallery-main { min-height: 460px; }
  .gallery-main img { min-height: 460px; max-height: none; }
  .gallery-side {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 32px;
    align-items: start;
  }
  .detail-sidebar { position: sticky; top: 100px; order: 0; }
  .spec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price-card { padding: 28px; border-radius: 28px; }
  .section-heading { font-size: 1.45rem; }
}
