/* ============================================================
   Ficha de propiedad — galería/carrusel + layout de 2 columnas
   Medidas replicadas de nb-realtors.com, colores de rcarreterom.com
   ============================================================ */

/* ── LAYOUT ─────────────────────────────────────── */
.pd-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; margin-top: 32px; align-items: start; max-width: 100%; }
.pd-left { min-width: 0; max-width: 100%; }
.pd-right { min-width: 280px; max-width: 100%; }
@media (min-width: 900px) {
  .pd-right { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
}
@media (max-width: 899px) {
  .pd-layout { display: flex; flex-direction: column; }
  .pd-right { min-width: 0; }
}

/* ── GALLERY / CARRUSEL (mismas medidas que nb-realtors) ── */
.gallery { position: relative; width: 100%; max-width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; background: #111; }
.gallery__main { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16/9; max-height: 392px; overflow: hidden; }
.gallery__main img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: opacity .3s; }

/* ── TIPOLOGÍAS Y PRECIOS (mismo carrusel, sin recortar el plano/precio) ── */
.tipologia-gallery .gallery__main { aspect-ratio: auto; width: 100%; max-width: 100%; height: 420px; max-height: none; background: #f4f4f2; }
.tipologia-gallery .gallery__main img { object-fit: contain; background: #f4f4f2; }
.gallery__label { font-size: .8rem; color: #666; text-align: center; margin: 8px 0 0; }
@media (max-width: 640px) {
  .tipologia-gallery .gallery__main { height: 300px; }
}
.gallery__counter {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(26,26,26,.65); color: #fff;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  padding: .3rem .7rem; border-radius: 20px; backdrop-filter: blur(6px);
}
.gallery__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(26,26,26,.5); border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background .2s, border-color .2s;
  z-index: 2;
}
.gallery__arrow:hover { background: var(--color-teal); border-color: var(--color-teal); }
.gallery__arrow--prev { left: .75rem; }
.gallery__arrow--next { right: .75rem; }
.gallery__thumbs {
  display: flex; gap: .5rem; padding: .5rem;
  width: 100%; max-width: 100%;
  overflow-x: auto; background: var(--color-black-soft);
  scrollbar-width: thin; scrollbar-color: rgba(37,150,190,.4) transparent;
}
.gallery__thumb {
  flex: 0 0 80px; height: 60px; border-radius: 6px;
  overflow: hidden; border: 2px solid transparent;
  cursor: pointer; transition: border-color .2s, opacity .2s;
  opacity: .65;
}
.gallery__thumb.active { border-color: var(--color-teal); opacity: 1; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── LIGHTBOX ───────────────────────────────────── */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,10,.95);
  flex-direction: column; align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
.lb-img-wrap { position: relative; max-width: 92vw; max-height: 82vh; overflow: hidden; }
.lb-img-wrap img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 4px; transition: transform .15s ease; cursor: zoom-in; touch-action: none; }
.lb-img-wrap.zoomed img { cursor: grab; }
.lb-img-wrap.zoomed img:active { cursor: grabbing; }

.lb-zoom-controls { position: absolute; top: .75rem; left: .75rem; z-index: 5; display: flex; gap: .5rem; }
.lb-zoom-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: #fff; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background .2s; cursor: pointer;
}
.lb-zoom-btn:hover { background: rgba(255,255,255,.2); }
.lb-close {
  position: absolute; top: .75rem; right: .75rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-close:hover { background: rgba(255,255,255,.2); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: #fff; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-nav:hover { background: var(--color-teal); }
.lb-nav--prev { left: -54px; }
.lb-nav--next { right: -54px; }
.lb-counter { color: rgba(255,255,255,.6); font-size: .8rem; margin-top: .75rem; letter-spacing: .06em; }
@media (max-width: 640px) {
  .lb-nav--prev { left: .5rem; }
  .lb-nav--next { right: .5rem; }
}

/* ── SECTION LABEL ──────────────────────────────── */
.section-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-teal); margin-bottom: .75rem;
}

/* ── RIGHT COLUMN CARDS ──────────────────────────── */
.r-card {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 1.4rem; margin-bottom: 1rem;
}
.r-card:last-child { margin-bottom: 0; }
.price-main { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800; color: var(--color-orange-dark); line-height: 1; margin-bottom: .3rem; }
.price-sub { font-size: .78rem; color: #777; margin-bottom: 1rem; }

.agent-row { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.agent-avatar {
  width: 50px; height: 50px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--color-border); flex-shrink: 0;
  background: var(--color-bg); display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 1.3rem;
}
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-title { font-size: .75rem; color: #777; }

.r-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .75rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 700; letter-spacing: .02em;
  border: none; transition: opacity .2s, transform .15s;
  margin-bottom: .6rem;
}
.r-btn:last-child { margin-bottom: 0; }
.r-btn:hover { opacity: .9; transform: translateY(-1px); }
.r-btn--wa { background: linear-gradient(135deg,#25d366,#128c5e); color: #fff; }
.r-btn--call { background: var(--color-black-soft); color: #fff; }
.r-btn--visit { background: var(--color-orange); color: #fff; }
.r-btn--outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.r-btn--outline:hover { border-color: var(--color-teal); color: var(--color-teal); }

/* ── CONSENT CHECKBOX (misma tonalidad verde que contactanos.php) ── */
.consent-checkbox { accent-color: #1f9d55; }

/* ── QR CARD ────────────────────────────────────── */
.qr-card { text-align: center; }
.qr-card img { display: block; margin: 0 auto .75rem; border-radius: 8px; border: 1px solid var(--color-border); }
.qr-card p { font-size: .72rem; color: #777; margin-bottom: .75rem; line-height: 1.4; }

/* ── SHARE CARD ─────────────────────────────────── */
.share-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-btn {
  flex: 1; min-width: 80px;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem .5rem; border-radius: var(--radius);
  font-size: .75rem; font-weight: 600; border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-text);
  transition: border-color .2s, background .2s, color .2s;
}
.share-btn:hover { border-color: var(--color-teal); background: rgba(37,150,190,.06); color: var(--color-teal); }
.share-btn.copied { border-color: var(--color-teal); background: rgba(37,150,190,.1); color: var(--color-teal); }
.share-btn svg { flex-shrink: 0; }

/* ── BADGES (venta/alquiler) ────────────────────── */
.pd-badges { display: flex; gap: .5rem; margin: 14px 0 4px; flex-wrap: wrap; }
.pd-badge {
  padding: .3rem .85rem; border-radius: 20px;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pd-badge--venta { background: rgba(37,150,190,.12); color: var(--color-teal); border: 1px solid rgba(37,150,190,.3); }
.pd-badge--alquiler { background: rgba(250,127,40,.12); color: var(--color-orange-dark); border: 1px solid rgba(250,127,40,.3); }
