/* ═══════════════════════════════════════════════════════════════
   FICHA INDIVIDUAL DE INMUEBLE — estilo tipo Airbnb
   Página autónoma, liviana, pensada para SEO y para enlaces compartidos
═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #f7f7f8;
  --card-bg: #ffffff;
  --text: #111111;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --line: #efeff1;
  --line-2: #e5e7eb;
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --brand: #E71433;
  --brand-dark: #c0102a;
  --brand-light: #fff0f2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.pdp-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-2);
}
.pdp-topbar-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.pdp-brand { display: flex; align-items: center; gap: 10px; }
.pdp-brand img { width: 36px; height: 36px; border-radius: 50%; }
.pdp-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.pdp-brand-name { font-weight: 800; font-size: 14px; }
.pdp-brand-sub { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.pdp-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted-2);
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.pdp-back:hover { border-color: var(--text); color: var(--text); }
.pdp-back svg { width: 14px; height: 14px; }

/* ── MAIN LAYOUT ────────────────────────────────────────────── */
.pdp-main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 80px; }

.pdp-titlebar { margin-bottom: 18px; }
.pdp-h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.01em; }
.pdp-titlebar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pdp-location { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted-2); }
.pdp-location svg { width: 15px; height: 15px; flex-shrink: 0; }
.pdp-titlebar-actions { display: flex; gap: 8px; }
.pdp-icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; padding: 8px 12px;
  border-radius: 999px; font-size: 12.5px; font-weight: 800; color: var(--text);
  border: 1.5px solid var(--line-2);
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.pdp-icon-btn:hover { border-color: var(--text); }
.pdp-icon-btn:active { transform: scale(.96); }
.pdp-icon-btn svg { width: 15px; height: 15px; }
.pdp-icon-btn.is-liked { color: var(--brand); border-color: var(--brand-light); background: var(--brand-light); }
.pdp-icon-btn.is-liked svg { fill: var(--brand); stroke: var(--brand); }

/* ── GALLERY ────────────────────────────────────────────────── */
.pdp-gallery {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: repeat(2, 190px);
  gap: 8px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 36px;
}
.pdp-gallery-item { position: relative; overflow: hidden; background: var(--line); cursor: pointer; }
.pdp-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pdp-gallery-item:hover img { transform: scale(1.04); }
.pdp-gallery-item--main { grid-row: 1 / 3; grid-column: 1 / 2; }
.pdp-gallery-empty {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); background: var(--line);
}
.pdp-gallery-empty span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pdp-gallery-viewall {
  position: absolute; bottom: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line-2);
  padding: 9px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800;
  box-shadow: var(--shadow);
}
.pdp-gallery-viewall svg { width: 14px; height: 14px; }
.pdp-status-pill {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; backdrop-filter: blur(14px);
}
.pdp-status-pill.libre { background: rgba(22,163,74,.85); }
.pdp-status-pill.ocupado { background: rgba(220,38,38,.85); }
.pdp-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }

@media (max-width: 860px) {
  .pdp-gallery {
    grid-template-columns: 100%;
    grid-template-rows: none;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-radius: 0;
    margin: 0 -20px 28px;
    gap: 0;
  }
  .pdp-gallery-item, .pdp-gallery-item--main {
    grid-row: auto; grid-column: auto;
    flex: 0 0 100%; scroll-snap-align: start;
    aspect-ratio: 4 / 3;
  }
  .pdp-gallery-viewall { bottom: 12px; right: 20px; }
  .pdp-status-pill { left: 20px; }
}

/* ── LIGHTBOX ───────────────────────────────────────────────── */
.pdp-lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.94);
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
.pdp-lightbox.is-open { display: flex; }
.pdp-lightbox img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 8px; }
.pdp-lightbox-close, .pdp-lightbox-prev, .pdp-lightbox-next {
  position: absolute; border: none; background: rgba(255,255,255,.1);
  color: #fff; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.pdp-lightbox-close:hover, .pdp-lightbox-prev:hover, .pdp-lightbox-next:hover { background: rgba(255,255,255,.2); }
.pdp-lightbox-close { top: 20px; right: 20px; }
.pdp-lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.pdp-lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.pdp-lightbox-close svg, .pdp-lightbox-prev svg, .pdp-lightbox-next svg { width: 20px; height: 20px; }
.pdp-lightbox-count { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 700; margin-top: 14px; }

/* ── BODY GRID ──────────────────────────────────────────────── */
.pdp-body { display: grid; grid-template-columns: 1fr 360px; gap: 56px; align-items: start; }
@media (max-width: 900px) { .pdp-body { grid-template-columns: 1fr; gap: 32px; } }

.pdp-main-col { min-width: 0; }
.pdp-section { padding: 28px 0; border-bottom: 1px solid var(--line-2); }
.pdp-section:first-child { padding-top: 0; }
.pdp-section-title { font-size: 16px; font-weight: 800; margin: 0 0 16px; }

/* Quick stats */
.pdp-stats { display: flex; gap: 28px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid var(--line-2); }
.pdp-stat { display: flex; align-items: center; gap: 10px; }
.pdp-stat-icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0;
}
.pdp-stat-icon svg { width: 19px; height: 19px; }
.pdp-stat-value { font-size: 16px; font-weight: 800; line-height: 1.1; }
.pdp-stat-label { font-size: 11.5px; color: var(--muted-2); font-weight: 600; }

/* Description */
.pdp-desc { font-size: 15px; line-height: 1.7; color: #1f2937; white-space: pre-line; position: relative; }
.pdp-desc.is-clamped { max-height: 88px; overflow: hidden; }
.pdp-desc.is-clamped::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background: linear-gradient(to bottom, rgba(247,247,248,0), var(--bg));
}
.pdp-desc-toggle {
  margin-top: 10px; border: none; background: none; padding: 0;
  font-size: 13.5px; font-weight: 800; text-decoration: underline; color: var(--text);
}

/* Amenities */
.pdp-amenities-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
@media (max-width: 480px) { .pdp-amenities-grid { grid-template-columns: 1fr; } }
.pdp-amenity { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #1f2937; }
.pdp-amenity svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }

/* Map */
.pdp-map-frame { width: 100%; height: 280px; border: none; border-radius: var(--radius-lg); overflow: hidden; }
.pdp-map-address { margin-top: 10px; font-size: 13.5px; color: var(--muted-2); font-weight: 600; }
.pdp-map-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--brand); }

/* Agent bio inline (mobile, shown at bottom of main col) */
.pdp-agent-inline { display: flex; align-items: center; gap: 14px; padding: 24px 0; }
.pdp-agent-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--line); }
.pdp-agent-name { font-size: 15px; font-weight: 800; }
.pdp-agent-role { font-size: 12.5px; color: var(--muted-2); font-weight: 600; }

/* ── SIDEBAR (sticky price card) ────────────────────────────── */
.pdp-sidebar { position: sticky; top: 88px; }
.pdp-price-card {
  background: var(--card-bg); border: 1px solid var(--line-2); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow-lg);
}
.pdp-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.pdp-price { font-size: 26px; font-weight: 900; letter-spacing: -.01em; }
.pdp-price-sub { font-size: 13px; font-weight: 700; color: var(--muted-2); }
.pdp-price-secondary { font-size: 13px; font-weight: 700; color: var(--muted-2); margin-bottom: 14px; }
.pdp-cta-wa {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px; margin-top: 16px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 800;
  border-radius: 999px; border: none; box-shadow: 0 8px 20px rgba(231,20,51,.28);
  transition: background .2s, transform .15s;
}
.pdp-cta-wa:hover { background: var(--brand-dark); }
.pdp-cta-wa:active { transform: scale(.98); }
.pdp-cta-wa svg { width: 18px; height: 18px; flex-shrink: 0; }
.pdp-cta-secondary-row { display: flex; gap: 8px; margin-top: 10px; }
.pdp-cta-secondary {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: 999px; border: 1.5px solid var(--line-2);
  font-size: 12.5px; font-weight: 800; color: var(--text); background: none;
}
.pdp-cta-secondary:hover { border-color: var(--text); }
.pdp-cta-secondary svg { width: 14px; height: 14px; }
.pdp-cta-secondary.is-liked { color: var(--brand); border-color: var(--brand-light); background: var(--brand-light); }
.pdp-cta-secondary.is-liked svg { fill: var(--brand); stroke: var(--brand); }

.pdp-agent-card { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.pdp-trust-note { font-size: 12px; color: var(--muted-2); font-weight: 600; margin-top: 14px; text-align: center; }

@media (max-width: 900px) {
  .pdp-sidebar { position: static; }
  .pdp-sidebar .pdp-price-card { display: none; }
}

/* Mobile sticky bottom bar */
.pdp-mobile-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--line-2);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 -6px 20px rgba(0,0,0,.08);
}
@media (max-width: 900px) { .pdp-mobile-bar { display: flex; } }
.pdp-mobile-price { font-size: 17px; font-weight: 900; }
.pdp-mobile-price small { font-size: 11px; font-weight: 700; color: var(--muted-2); display: block; }
.pdp-mobile-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 14px;
  padding: 13px 22px; border-radius: 999px; white-space: nowrap;
}
.pdp-mobile-cta svg { width: 16px; height: 16px; }

/* ── SIMILAR PROPERTIES ─────────────────────────────────────── */
.pdp-similar { margin-top: 48px; }
.pdp-similar-title { font-size: 19px; font-weight: 800; margin: 0 0 16px; }
.pdp-similar-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.pdp-similar-card {
  flex: 0 0 240px; scroll-snap-align: start;
  border-radius: var(--radius-lg); overflow: hidden; background: var(--card-bg);
  border: 1px solid var(--line-2); transition: box-shadow .2s, transform .2s;
}
.pdp-similar-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pdp-similar-card img { width: 100%; height: 150px; object-fit: cover; }
.pdp-similar-body { padding: 12px 14px 16px; }
.pdp-similar-loc { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); }
.pdp-similar-name { font-size: 13.5px; font-weight: 800; margin: 2px 0 6px; line-height: 1.25; }
.pdp-similar-price { font-size: 14px; font-weight: 900; }
.pdp-similar-stats { display: flex; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--muted-2); font-weight: 700; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.pdp-footer { margin-top: 64px; background: #0a0a0a; color: rgba(255,255,255,.75); padding: 32px 24px calc(90px + 16px); }
@media (min-width: 901px) { .pdp-footer { padding-bottom: 32px; } }
.pdp-footer-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pdp-footer-brand { font-weight: 800; color: #fff; font-size: 13.5px; }
.pdp-footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.pdp-footer-links a:hover { color: #fff; }
.pdp-footer-copy { max-width: 1120px; margin: 20px auto 0; font-size: 11.5px; color: rgba(255,255,255,.4); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
