/* =============================================================================
   property.css — Específico da Página do Imóvel
   (Galeria, Lightbox, ficha técnica, mapa, CTAs)
============================================================================= */

.property-hero-spacer { height: 88px; } /* compensa o header fixo (solid) */

.property-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.property-gallery__main {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
}
.property-gallery__main img { width: 100%; height: 100%; object-fit: cover; }

/* Carrossel arrastável (montado por js/components/gallery.js).
   touch-action: pan-y = o dedo continua rolando a página na vertical
   normalmente; só o movimento horizontal é tratado como troca de foto. */
.property-gallery__track {
  display: flex;
  height: 100%;
  will-change: transform;
  touch-action: pan-y;
  transition: transform var(--duration-slow) var(--ease-out);
}
.property-gallery__slide {
  flex: 0 0 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.property-gallery__slide img { -webkit-user-drag: none; pointer-events: none; }

/* Setas discretas — só no desktop, onde não há swipe natural com o dedo. */
.property-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px; height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-branco);
  background: rgba(11, 37, 41, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--duration-base) ease, background-color var(--duration-fast) ease;
}
.property-gallery__nav svg { width: 20px; height: 20px; }
.property-gallery__nav:hover { background: rgba(11, 37, 41, 0.6); }
.property-gallery__nav--prev { left: var(--space-sm); }
.property-gallery__nav--next { right: var(--space-sm); }
.property-gallery__nav[hidden] { display: none !important; }

@media (hover: hover) and (pointer: fine) {
  .property-gallery__nav { display: flex; }
  .property-gallery__main:hover .property-gallery__nav,
  .property-gallery__nav:focus-visible { opacity: 1; }
  .property-gallery__main { cursor: grab; }
  .property-gallery__main:active { cursor: grabbing; }
}

/* Dica discreta abaixo da galeria */
.property-gallery__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #8A8A8A;
}
.property-gallery__hint svg { width: 14px; height: 14px; opacity: 0.8; }
.property-gallery__hint[hidden] { display: none; }

.property-gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.gallery-thumb {
  flex: 0 0 96px;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active, .gallery-thumb:hover { opacity: 1; border-color: var(--color-dourado); }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  /* Recorta o trilho de fotos: sem isto, os slides vizinhos aparecem
     fora da area do overlay enquanto o usuario arrasta. */
  overflow: hidden;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 37, 41, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease;
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-overlay img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-sm); }

/* Trilho arrastável do lightbox — mesma mecânica da galeria, em tela cheia */
.lightbox__track {
  display: flex;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  will-change: transform;
  transition: transform var(--duration-slow) var(--ease-out);
}
.lightbox__slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox__slide img { -webkit-user-drag: none; }
body.lightbox-open { overflow: hidden; }

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: var(--color-branco);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background-color var(--duration-fast) ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.15); }
.lightbox-close { top: var(--space-md); right: var(--space-md); }
.lightbox-prev { left: var(--space-md); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: var(--space-md); top: 50%; transform: translateY(-50%); }
.lightbox-close svg, .lightbox-prev svg, .lightbox-next svg { width: 22px; height: 22px; }

.property-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}
@media (min-width: 1000px) {
  .property-layout { grid-template-columns: 1.6fr 1fr; align-items: start; }
}

.property-header__badge {
  display: inline-block;
  background: var(--color-petroleo);
  color: var(--color-branco);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.property-header__code {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-dourado-dark);
  margin-bottom: 0.4rem;
}

.property-header__price {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-petroleo);
  margin-bottom: var(--space-md);
}

.property-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm) var(--space-md);
  padding: var(--space-md);
  background: var(--color-cinza-claro);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}
@media (min-width: 480px) {
  .property-facts { grid-template-columns: repeat(3, 1fr); }
}
.property-facts li { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-small); }
.property-facts svg { width: 20px; height: 20px; color: var(--color-dourado-dark); flex-shrink: 0; }

.property-description { margin-bottom: var(--space-lg); }
.property-description h2 { font-size: 1.5rem; }

/* Respeita exatamente as quebras de linha, linhas em branco e bullets que a
   corretora digitou no textarea do painel — sem interpretar HTML. */
.property-description__text {
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------------
   Vídeo do imóvel (opcional — a seção só existe quando há vídeo cadastrado)
--------------------------------------------------------------------------- */
.property-video { margin-bottom: var(--space-lg); }
.property-video h2 { font-size: 1.5rem; }

.property-video__frame {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-petroleo-dark);
}
.property-video__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Facade: enquanto o usuário não clica, é só uma imagem + botão. O player do
   YouTube/Vimeo (pesado) só é carregado no clique. */
.property-video__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: linear-gradient(160deg, var(--color-petroleo), var(--color-petroleo-dark));
}
.property-video__facade img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out), opacity var(--duration-base) ease;
  opacity: 0.9;
}
.property-video__facade:hover img { transform: scale(1.03); opacity: 1; }

.property-video__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.property-video__play span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-base) var(--ease-out), background-color var(--duration-fast) ease;
}
.property-video__facade:hover .property-video__play span { transform: scale(1.06); background: var(--color-branco); }
.property-video__play svg { width: 26px; height: 26px; margin-left: 3px; color: var(--color-petroleo); }

.property-sidebar {
  position: sticky;
  top: 100px;
  background: var(--color-branco);
  border: 1px solid #EDEAE0;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.property-sidebar .btn { margin-bottom: var(--space-sm); }
.property-sidebar .btn:last-child { margin-bottom: 0; }

.related-properties { margin-top: var(--space-2xl); }
