/* ═══════════════════════════════════════════════════════════════
   Mapa de Productos TAO México
   Layout tipo "mapa de competencia" (JoyTree) + identidad de
   ficha técnica TAO (navy / gold / cream · Archivo Expanded + Manrope)
═══════════════════════════════════════════════════════════════ */

:root {
  --navy:         #385265;
  --navy-d:       #2c4152;
  --gold:         #b3ab85;
  --gold-d:       #9a916a;
  --cream:        #f3eee3;
  --graphite:     #403d37;
  --slate:        #7395a7;
  --white:        #ffffff;
  --line:         rgba(64, 61, 55, 0.14);
  --line-heavy:   rgba(64, 61, 55, 0.28);

  --font-display: 'Archivo Expanded', sans-serif;
  --font-body:    'Manrope', sans-serif;

  --header-h:     64px;
  --sidebar-w:    380px;
  --radius:       10px;
  --radius-sm:    6px;
  --card-anim:    220ms cubic-bezier(0.22,1,0.36,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; overflow:hidden; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--cream);
  color: var(--graphite);
  -webkit-font-smoothing: antialiased;
}
button { cursor:pointer; border:none; background:none; font-family:inherit; color:inherit; }
input  { font-family:inherit; }

.app { display:flex; flex-direction:column; height:100vh; overflow:hidden; }

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 2px solid var(--line-heavy);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 30;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-logo { height: 34px; width: auto; object-fit: contain; }
.brand-copy { display:flex; flex-direction:column; line-height:1.15; }
.header-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--graphite);
  white-space: nowrap;
}
.header-sub {
  font-size: 10.5px;
  color: var(--slate);
  font-weight: 600;
  white-space: nowrap;
}

/* Filtros */
.header-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-filters::-webkit-scrollbar { display:none; }

.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 150ms;
  flex-shrink: 0;
}
.filter-pill:hover { color:var(--graphite); border-color:var(--line-heavy); background:var(--cream); }
.filter-pill.is-active {
  color: var(--white);
  border-color: var(--navy);
  background: var(--navy);
}
.filter-count { font-size: 10px; font-weight: 700; opacity: 0.65; }
.filter-pill.is-active .filter-count { opacity: 0.85; }

/* Búsqueda */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  width: 240px;
  flex-shrink: 0;
  transition: border-color 150ms;
}
.header-search:focus-within { border-color: var(--gold); }
.header-search svg { width:15px; height:15px; color:var(--slate); flex-shrink:0; }
.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--graphite);
  width: 100%;
}
.header-search input::placeholder { color: var(--slate); }
.search-clear { color: var(--slate); flex-shrink:0; }
.search-clear svg { width:13px; height:13px; }
.search-clear:hover { color: var(--graphite); }

.toggle-btn {
  display: none;
  color: var(--graphite);
  flex-shrink: 0;
}
.toggle-btn svg { width:20px; height:20px; }

/* ═══════════════════════════════════════════════════════════════
   BODY / LAYOUT
═══════════════════════════════════════════════════════════════ */
.app-body { flex:1; display:flex; overflow:hidden; min-height:0; position:relative; }

.map-wrap { flex:1; position:relative; z-index:1; min-width:0; background: var(--graphite); }
#map { width:100%; height:100%; }

.map-fabs {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}
.map-fab {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  display: flex; align-items:center; justify-content:center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.28);
  transition: background 150ms, color 150ms;
}
.map-fab svg { width:16px; height:16px; }
.map-fab:hover { background: var(--navy); color: var(--white); }

.map-chip {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(56,82,101,0.92);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
.map-chip #visibleCount { color: var(--gold); font-weight:800; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-left: 2px solid var(--line-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.view-list { flex:1; display:flex; flex-direction:column; overflow:hidden; min-height:0; }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sh-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
}
.sh-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--navy);
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 12px;
}

.prop-list { flex:1; overflow-y:auto; padding: 10px; display:flex; flex-direction:column; gap:9px; }

.prop-card {
  --accent: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color 180ms, background 180ms, transform 180ms, box-shadow 180ms;
  animation: cardEnter 420ms cubic-bezier(0.22,1,0.36,1) backwards;
}
.prop-card:hover,
.prop-card.is-hover {
  border-color: var(--accent);
  background: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -8px var(--accent), 0 2px 8px rgba(0,0,0,0.06);
}
.prop-card.is-active {
  border-color: var(--accent);
  background: var(--cream);
  box-shadow: 0 0 0 1.5px var(--accent) inset, 0 8px 22px -8px var(--accent);
}
.prop-card.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.prop-card__row { display:flex; align-items:flex-start; gap:12px; }

.prop-card__thumb {
  width: 52px; height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--cream);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  transition: box-shadow 180ms, transform 180ms;
}
.prop-card:hover .prop-card__thumb,
.prop-card.is-hover .prop-card__thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 24%, transparent);
  transform: scale(1.04);
}
.prop-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.prop-card__thumb--empty svg { width:20px; height:20px; opacity:0.7; }

.prop-card__body { flex:1; min-width:0; padding-top: 2px; }
.prop-card__name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--graphite);
  line-height: 1.25;
  display: block;
}
.prop-card__city {
  font-size: 11px;
  color: var(--slate);
  font-weight: 600;
  margin-top: 2px;
  display: block;
}
.prop-card__stats {
  display: block;
  font-size: 10.5px;
  color: var(--graphite);
  font-weight: 700;
  margin-top: 10px;
}
.prop-card__meta {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.prop-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--slate);
  border: 1px solid var(--line);
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Barra de % vendido ──────────────────────────────────────── */
.prop-bar { display:flex; align-items:center; gap:8px; margin-top:8px; }
.prop-bar__track {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.prop-bar__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent, var(--navy));
  transition: width 500ms cubic-bezier(0.22,1,0.36,1);
}
.prop-bar__label {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--slate);
  white-space: nowrap;
  flex-shrink: 0;
}
.prop-bar--lg .prop-bar__track { height: 8px; }
.prop-bar--lg .prop-bar__label { font-size: 11px; color: var(--graphite); }
.prop-bar--lg { margin: 4px 0 18px; }

/* ── Etiquetas de estatus (unidades / construcción) ─────────── */
.status-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-tag--disponible   { background: #e7f5ec; color: #1e7d43; border-color: #bfe6cd; }
.status-tag--soldout      { background: #f1eee8; color: #6b6558; border-color: var(--line-heavy); }
.status-tag--construccion { background: #fdf3dd; color: #92620a; border-color: #f0d693; }
.status-tag--terminado    { background: #eef2f5; color: var(--navy); border-color: var(--line); }

.status-tag--lg { font-size: 10px; padding: 5px 12px; border-radius: 12px; }
.detail-status-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 16px; }

.ftp-tags { display:flex; gap:6px; flex-wrap:wrap; margin: 2px 0 7px; }

.list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--slate);
  padding: 30px;
}
.list-empty svg { width:34px; height:34px; opacity:0.5; }
.list-empty p { font-size: 12.5px; font-weight:600; }
.list-empty[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════
   DETALLE
═══════════════════════════════════════════════════════════════ */
.view-detail {
  position: absolute;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn var(--card-anim);
}
.view-detail[hidden] { display: none; }
@keyframes slideIn { from { transform: translateX(24px); opacity:0; } to { transform:none; opacity:1; } }

.detail-back-btn {
  display: flex; align-items:center; justify-content:center;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--white);
  flex-shrink: 0;
  transition: background 150ms;
}
.detail-back-btn:hover { background: rgba(255,255,255,0.15); }
.detail-back-btn svg { width:16px; height:16px; }

.detail-head {
  background: var(--navy);
  color: var(--cream);
  padding: 16px 18px 20px;
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.detail-head__watermark {
  position: absolute;
  right: -46px;
  top: -30px;
  width: 190px;
  height: 190px;
  object-fit: cover;
  object-position: 30% 30%;
  opacity: 0.32;
  transform: rotate(6deg);
  pointer-events: none;
  border-radius: 24px;
  mix-blend-mode: soft-light;
}
.detail-head__top,
.detail-head__id {
  position: relative;
  z-index: 1;
}
.detail-head__top { display:flex; align-items:center; gap:10px; margin-bottom: 16px; }
.detail-head__topbar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}
.detail-head__id { display:flex; align-items:center; gap:12px; }

.detail-head__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255,255,255,0.7);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
.detail-head__avatar--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.14);
}
.detail-head__avatar--empty svg { width:20px; height:20px; opacity:0.85; }

.detail-head__num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1.5px solid var(--gold);
  display:flex; align-items:center; justify-content:center;
  font-size: 13px; font-weight:800; flex-shrink:0;
}
.detail-head__id-text { min-width: 0; }
.detail-head__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.detail-head__city {
  font-size: 11.5px;
  color: rgba(255,255,255,0.88);
  font-weight: 700;
  margin-top: 3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.detail-body { flex:1; overflow-y:auto; padding: 18px; }

.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.detail-stat {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.detail-stat__lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 3px;
  display: block;
}
.detail-stat__val {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--graphite);
}

.detail-summary {
  font-size: 12.5px;
  color: var(--graphite);
  line-height: 1.55;
  margin-bottom: 18px;
}

.detail-approx {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: #92620a;
  background: #fdf3dd;
  border: 1px solid #f0d693;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 18px;
}
.detail-approx svg { width:13px; height:13px; flex-shrink:0; }

/* ── Galería de medios ───────────────────────────────────────── */
.detail-media { margin-top: 4px; }
.detail-media__title {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
}
.detail-media__empty {
  font-size: 12px;
  color: var(--slate);
  font-weight: 600;
  background: var(--cream);
  border: 1px dashed var(--line-heavy);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.media-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-color: var(--cream);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: transform 150ms, box-shadow 150ms;
}
.media-thumb:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.media-thumb__play {
  position: absolute;
  inset: 0;
  display: flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,0.28);
  color: #fff;
}
.media-thumb__play svg { width:22px; height:22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.media-thumb__tag {
  position: absolute;
  left: 5px; bottom: 5px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 2px 6px;
  border-radius: 8px;
}

/* ── Lightbox ─────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10,12,14,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.is-open { display: flex; animation: lightboxFade 200ms ease; }
@keyframes lightboxFade { from { opacity:0; } to { opacity:1; } }
.lightbox__stage { max-width: 100%; max-height: 100%; display:flex; align-items:center; justify-content:center; }
.lightbox__stage img,
.lightbox__stage video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  transition: background 150ms;
}
.lightbox__close:hover { background: rgba(255,255,255,0.24); }
.lightbox__close svg { width:18px; height:18px; }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  transition: background 150ms;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.24); }
.lightbox__nav svg { width:20px; height:20px; }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

.detail-lotes-title {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
}

.lote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.lote-row:hover { border-color: var(--gold); background: var(--cream); }
.lote-row__num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 10px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
}
.lote-row[data-cat="predios"] .lote-row__num { background:#f59e0b; }
.lote-row__body { flex:1; min-width:0; }
.lote-row__name { font-size: 12px; font-weight:700; color:var(--graphite); }
.lote-row__meta { font-size: 10.5px; color:var(--slate); font-weight:600; margin-top:1px; }
.lote-row__precio { font-size: 11.5px; font-weight:800; color:var(--navy); flex-shrink:0; white-space:nowrap; }

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--navy);
  border: 1.5px solid var(--gold);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 150ms, border-color 150ms, transform 150ms;
}
.detail-btn svg { width:13px; height:13px; color:var(--gold); flex-shrink:0; }
.detail-btn:hover { background: var(--navy-d); border-color:#fff; transform: translateY(-1px); }
.detail-btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-heavy);
}
.detail-btn--ghost svg { color: var(--navy); }
.detail-btn--ghost:hover { background: var(--cream); border-color: var(--gold); }
.detail-btn--disabled { opacity: 0.35; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════
   LEAFLET — pines y popups estilo ficha técnica
═══════════════════════════════════════════════════════════════ */
.leaflet-container { font-family: var(--font-body); background: var(--graphite); }

/* ── Pin estilo "burbuja" (Find My / Apple Maps) ─────────────
   Círculo con el ícono del proyecto + punta inferior, hecho con
   un cuadrado redondeado rotado -45°; el contenido interno se
   contra-rota 45° para quedar en posición normal. */
.ft-pin {
  --accent: var(--navy);
  width: 40px; height: 40px;
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.45));
  animation: pinDrop 420ms cubic-bezier(0.22,1,0.36,1) backwards;
}
.ft-pin__body {
  position: absolute;
  inset: 0;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items:center; justify-content:center;
  transition: transform 0.18s;
}
.ft-pin:hover .ft-pin__body { transform: rotate(-45deg) scale(1.1); }

.ft-pin__img {
  width: 62%; height: 62%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.28);
  transform: rotate(45deg);
}
.ft-pin__img--empty {
  display: flex; align-items:center; justify-content:center;
  color: #fff;
}
.ft-pin__img--empty svg { width: 15px; height: 15px; }

.ft-pin--lote {
  width: 26px; height: 26px;
}
.ft-pin--lote .ft-pin__body {
  border-width: 2px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
}

.ft-pin-glow .ft-pin__body { transform: rotate(-45deg) scale(1.16); }
.ft-pin-glow {
  z-index: 900 !important;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.ft-pin-glow::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: pinRingPulse 1.1s ease-in-out infinite;
  z-index: -1;
}

@keyframes pinDrop {
  from { opacity: 0; transform: translateY(-16px) scale(0.5); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pinRingPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50%      { transform: scale(1.25); opacity: 0.12; }
}

.ftp-wrap .leaflet-popup-content-wrapper { padding:0 !important; border-radius:8px !important; overflow:hidden !important; box-shadow:0 6px 20px rgba(0,0,0,0.28) !important; }
.ftp-wrap .leaflet-popup-content { margin:0 !important; width:auto !important; }
.ftp-wrap .leaflet-popup-tip { background:#fff !important; }

.ftp { font-family: var(--font-body); min-width: 210px; }
.ftp-head { background: var(--navy); border-bottom: 2px solid var(--gold); padding: 10px 14px 8px; display:flex; align-items:center; gap:9px; }
.ftp-head--terrenos { background:#dc2626; border-bottom-color:#7f1d1d; }
.ftp-head--predios { background:#f59e0b; border-bottom-color:#78350f; }
.ftp-head__num { width:22px; height:22px; border-radius:50%; background:rgba(0,0,0,0.22); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:#fff; flex-shrink:0; }
.ftp-head__name { font-size:13px; font-weight:700; color:#fff; letter-spacing:0.02em; }
.ftp-body { padding:10px 14px 8px; border-bottom:1px solid #e5e7eb; }
.ftp-stat { margin-bottom:7px; }
.ftp-lbl { display:block; font-size:9px; font-weight:700; letter-spacing:0.16em; text-transform:uppercase; color:var(--slate); margin-bottom:1px; }
.ftp-val { font-size:15px; font-weight:800; color:var(--graphite); }
.ftp-addr { font-size:10px; color:#6b7280; line-height:1.45; margin-top:5px; }
.ftp-btns { display:flex; gap:6px; padding:10px 14px 13px; background:#fff; border-top:1px solid #e8e2d8; }
.ftp-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:5px; padding:8px 6px; border-radius:999px; background:var(--navy); border:1.5px solid var(--gold); color:#fff !important; font-family:var(--font-display); font-size:7.5px; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; text-decoration:none !important; transition:background 0.15s, border-color 0.15s; white-space:nowrap; }
.ftp-btn:hover { background: var(--navy-d); border-color:#fff; }
.ftp-btn--na { opacity:0.30; pointer-events:none; cursor:default; }

.ft-reset-btn { width:26px; height:26px; display:flex !important; align-items:center; justify-content:center; color:var(--navy) !important; background:#fff !important; text-decoration:none !important; transition:background 0.15s, color 0.15s; }
.ft-reset-btn:hover { background:var(--navy) !important; color:var(--cream) !important; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 340px; }
}

/* Tablet portrait y móviles: el header pasa a 2 filas (marca+buscador+
   menú arriba, filtros de ubicación abajo en su propia fila con
   scroll horizontal) y el panel lateral se vuelve un overlay a pantalla
   completa (con tope de ancho en tablets) sobre el mapa. */
@media (max-width: 880px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding: 10px 16px;
    gap: 8px 12px;
  }
  .header-brand  { order: 1; }
  .header-search { order: 2; flex: 1 1 100px; width: auto; min-width: 90px; }
  .toggle-btn    { order: 3; display: flex; }
  .header-filters {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
  }

  .sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 440px;
    z-index: 20;
    box-shadow: -8px 0 24px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform var(--card-anim);
  }
  .sidebar.is-open { transform: translateX(0); }

  .map-fabs { top: 10px; right: 10px; }
  .map-chip { bottom: 10px; left: 10px; }
}

@media (max-width: 560px) {
  .header-sub  { display: none; }
  .brand-logo  { height: 28px; }
  .header-title { font-size: 12.5px; }
  .header-search { flex-basis: 70px; }

  .detail-stats { grid-template-columns: 1fr 1fr; }
  .media-grid   { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  .lightbox { padding: 54px 14px; }
  .lightbox__nav { width: 38px; height: 38px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 10px; right: 10px; }
}

@media (max-width: 360px) {
  .header-search { flex-basis: 56px; }
  .prop-card__thumb { width: 44px; height: 44px; }
  .detail-head__watermark { display: none; }
}
