/* ==========================================================================
   Thawany Motta Imóveis — Property Detail Page
   ========================================================================== */

/* ---------- Hero Gallery / OwlCarousel ---------- */
.hero-gallery {
  background: linear-gradient(180deg, #f8f3ec 0, #f4ede2 100%);
  padding: 1.5rem 0 1rem;
}
.owl-carousel { position: relative; }
#propertyCarousel .owl-stage-outer { position: relative; overflow: hidden; }
#propertyCarousel .owl-stage { padding-left: 0 !important; }
.owl-stage-outer > .carousel-counter {
  top: auto;
  left: auto;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  pointer-events: none;
}
.owl-nav button.owl-prev,
.owl-nav button.owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  background: #fff !important;
  color: var(--color-text-primary) !important;
  border: 1px solid rgba(47,36,31,.12) !important;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  z-index: 3;
  font-size: var(--fs-3xl) !important;
  line-height: 1 !important;
}
.owl-nav button.owl-prev { left: -18px; }
.owl-nav button.owl-next { right: -18px; }
.owl-dots { margin-top: 1rem; }
.owl-dots .owl-dot span {
  width: .6rem;
  height: .6rem;
  background: #d0c7bd;
  border-radius: 50%;
}
.owl-dots .owl-dot.active span { background: var(--color-text-primary); }
.carousel-wrap { max-width: 1280px; margin: 0 auto; }
#propertyCarousel .owl-item {
  display: flex;
}
.slide-card {
  width: 100%;
  height: 552px;
  overflow: hidden;
  border-radius: 14px !important;
  box-shadow: var(--shadow-sm);
  background: #ddd;
  cursor: zoom-in;
}
.slide-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px !important;
}
.slide-card--single {
  cursor: default;
}

/* ---------- Details Section ---------- */
.details-wrap { background: #f0e8de; }
.detail-header {
  position: relative;
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.detail-header .meta-badge {
  position: absolute;
  top: 0;
  left: 0;
}
.detail-header .property-title {
  max-width: 18ch;
  margin: 0 auto;
}
.detail-header .subhead {
  max-width: 40ch;
  margin: var(--space-2) auto 0;
}
.detail-body {
  margin-top: 0;
}
.sticky-sidebar {
  position: sticky;
  top: 6.5rem;
}
.sidebar-price-title {
  margin: 0 0 var(--space-2);
  line-height: var(--lh-heading);
}
.sidebar-cta {
  background: #fff;
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
}
.sidebar-cta .price-box {
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.sidebar-cta-actions {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding-top: var(--space-1);
}
.price-value {
  font-size: var(--fs-title);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  margin: 0;
  white-space: nowrap;
}
.price-installment {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--fs-md);
}
.share-box .share-title {
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-1);
}
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: none;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.share-btn:hover,
.share-btn:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--color-brand-primary);
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}
.share-btn svg {
  width: 20px;
  height: 20px;
}
.section-title-sm {
  font-size: var(--fs-title);
  font-weight: var(--fw-medium);
}
.details-wrap h1.property-title {
  font-size: var(--fs-display-lg);
  line-height: var(--lh-tight);
  font-weight: var(--fw-medium);
}
.subhead {
  color: var(--color-text-secondary);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  margin-top: var(--space-1);
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border-default);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background: var(--color-brand-primary);
  color: #fff;
  border-color: transparent;
  border-radius: 50rem;
}

/* ---------- Related listings (mesmo padrão da listagem) ---------- */
.related-section .property-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}
.related-section .property-media {
  aspect-ratio: 16 / 11;
  background: #ddd;
  flex: none;
}
.related-section .property-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-3);
}
.related-section .property-title {
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-1);
}
.related-section .property-address {
  color: var(--color-text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  margin-bottom: var(--space-1);
}
.related-section .property-specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: var(--fs-md);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}
.related-section .property-specs span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.related-section .property-price {
  font-size: var(--fs-2xl);
  line-height: 1;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}
.related-section .property-actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  margin-top: auto;
  width: 100%;
}
.related-section .property-actions .btn,
.related-section .property-actions .ghost-link {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  justify-content: center;
  text-align: center;
}
.related-section .ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid rgba(47,36,31,.12);
  font-weight: var(--fw-regular);
}

/* ---------- Feature List ---------- */
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.feature-item {
  display: flex;
  gap: var(--space-1);
  align-items: flex-start;
  padding: var(--space-2);
  border: 1px solid rgba(47,36,31,.08);
  background: #fff;
  border-radius: 14px !important;
}
.feature-item .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--color-surface-base);
  flex: none;
  color: var(--color-brand-primary, #3f2419);
  border-radius: 8px;
}
.feature-item .icon svg,
.feature-item .icon .tm-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* ---------- Detail Text ---------- */
.detail-text p { margin-bottom: var(--space-2); }
.detail-text ul { padding-left: var(--space-3); }
.mais-detalhes-text {
  white-space: pre-line;
  line-height: var(--lh-loose);
  font-family: var(--font-body);
  font-variant-emoji: emoji;
}
.mais-detalhes-text img.emoji {
  display: inline;
  width: 1.15em;
  height: 1.15em;
  margin: 0 .05em;
  vertical-align: -0.15em;
  border: 0;
  box-shadow: none;
}

/* ---------- Gallery Grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.gallery-grid img {
  aspect-ratio: 1.1;
  object-fit: cover;
  width: 100%;
  border-radius: 0 !important;
  box-shadow: var(--shadow-sm);
}

/* ---------- Image Modal / Lightbox ---------- */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(14,10,8,.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.image-modal.is-open { display: flex; }
.image-modal img {
  max-width: min(1200px, 95vw);
  max-height: 78vh;
  object-fit: contain;
  box-shadow: var(--shadow-md);
  border-radius: 0 !important;
  background: #000;
}
.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.3);
  background: #fff;
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  line-height: 1;
  border-radius: 0 !important;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.25);
  background: #fff;
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
  font-size: var(--fs-3xl);
  line-height: 1;
  border-radius: 0 !important;
  box-shadow: var(--shadow-md);
}
.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }
.modal-thumbs {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: .5rem;
  overflow: auto;
  padding-bottom: .25rem;
}
.modal-thumbs .t {
  flex: 0 0 auto;
  width: 72px;
  height: 52px;
  opacity: .55;
  border: 2px solid transparent;
  overflow: hidden;
  background: #fff;
}
.modal-thumbs .t.active {
  opacity: 1;
  border-color: #fff;
}
.modal-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Detail Page Responsive ---------- */
@media (max-width: 991.98px) {
  .feature-list { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .carousel-wrap { max-width: 100%; }
  .slide-card { height: 480px; }
  .detail-sidebar-col { order: -1; }
  .detail-sidebar-col .sticky-sidebar { position: static; }
}

@media (max-width: 767.98px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .hero-gallery { padding: 1rem 0 1rem; }
  #propertyCarousel .owl-dots { display: none; }
  .owl-nav button.owl-prev,
  .owl-nav button.owl-next {
    width: 34px;
    height: 34px;
    font-size: var(--fs-2xl) !important;
  }
  .owl-nav button.owl-prev { left: 6px; }
  .owl-nav button.owl-next { right: 6px; }
  .owl-nav button.owl-prev.disabled,
  .owl-nav button.owl-next.disabled {
    opacity: .35;
    pointer-events: none;
  }
  .slide-card { height: min(420px, 75vh); }
  .details-wrap h1.property-title { font-size: var(--fs-title); }
  .detail-header .meta-badge {
    position: static;
    margin: 0 auto 1rem;
  }
  .detail-header .property-title { max-width: none; }
}

@media (max-width: 575.98px) {
  .sidebar-cta { padding: 1rem; }
  .feature-list { gap: .75rem; }
  .feature-item { padding: .85rem; }
  .slide-card { height: min(380px, 70vh); }
}
