/* ═══════════════════════════════════════════════════════════════
   ALEX ARIAS · CONSULTOR INMOBILIARIO
   Diseño base conservado + extensiones funcionales
═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #f0f1f3;
  --card-bg: #ffffff;
  --text: #111111;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --line: #f3f4f6;
  --line-2: #e5e7eb;
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-open: 0 12px 32px rgba(0,0,0,.12);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 24px;
  --radius-sm: 18px;
  --black: #000000;
  --white: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --green-bg: #dcfce7;
  --red-bg: #fee2e2;
  --accent: #111827;
  /* ── Color de marca ── */
  --brand:       #E71433;
  --brand-dark:  #c0102a;
  --brand-light: #fff0f2;
  --brand-mid:   rgba(231,20,51,.12);

  --card-collapsed-height: 308px;
  --card-expanded-height-desktop: 690px;
  --card-expanded-height-tablet: 700px;
  --card-expanded-height-mobile: 720px;
  --media-height: 242px;
  --actions-bar-height: 50px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; color: inherit; }

.app-shell {
  min-height: 100vh;
  background: var(--bg);
  padding-top: var(--top-bar-h, 72px);  /* se actualiza dinámicamente via JS */
  padding-bottom: 120px;
}

/* ─── TOP BAR FIJA ─────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-2);
  border-top: 3px solid var(--brand);
  padding: 0 clamp(16px, 2.5vw, 48px);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  max-width: 1400px;
  margin: 0 auto;
}

.results-count {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding: 3px clamp(16px, 2.5vw, 48px);
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── BRAND ─────────────────────────────────────────────────── */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-logo-img {
  width: 32px; height: 32px;
  object-fit: contain;
  display: block;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 14px; font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.1;
  color: var(--black);
}
.brand-sub {
  font-size: 7.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand); line-height: 1.4;
}

/* ─── MEGABUSCADOR UNIFICADO ────────────────────────────────── */
.mega-search {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Desktop: cápsula completa */
.mega-desktop {
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  padding: 5px 5px 5px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: box-shadow .2s;
  overflow: hidden;
  min-width: 0;
}
.mega-desktop:focus-within {
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
}

/* Mobile trigger: oculto en desktop */
.mega-mobile-trigger { display: none; }

/* Segmentos internos */
.mega-seg {
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.mega-seg.search-seg {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 0 6px;
}

/* Separador vertical interno */
.mega-sep {
  width: 1px;
  height: 22px;
  background: #e2e2e2;
  flex-shrink: 0;
}

/* Pills tipo dentro de la cápsula */
.tipo-seg { gap: 2px; padding: 0 2px; }

.pill-btn {
  padding: 7px 13px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #555;
  cursor: pointer;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.pill-btn:hover { background: #f0f0f0; color: #111; }

.pill-btn.active { background: #222; color: #fff; }
.pill-btn[data-tipo="arriendo"].active { background: #2563eb; }
.pill-btn[data-tipo="venta"].active    { background: #059669; }

/* Selects de ubicación */
.loc-seg { gap: 4px; padding: 4px 6px; }

.mega-loc-icon {
  width: 12px; height: 12px;
  color: #888;
  flex-shrink: 0;
}

.mega-select {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  outline: none;
  width: auto;
  max-width: 140px;
}
#filterMunicipio { min-width: 82px; }
#filterBarrio    { min-width: 62px; }
#filterHab       { min-width: 52px; }
.mega-select:focus { color: #111; }

/* Seg habitaciones */
.hab-seg { gap: 4px; padding: 4px 6px; }

/* Toggle parqueadero */
.park-seg { padding: 3px 4px; }
.park-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 12px; font-weight: 600; font-family: inherit;
  color: #555; cursor: pointer;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.park-toggle:hover { background: #f0f0f0; color: #111; }
.park-toggle[aria-pressed="true"] {
  background: #111; color: #fff;
}
.park-toggle[aria-pressed="true"] svg { stroke: #fff; }

/* Input de búsqueda */
.search-icon-svg {
  position: absolute; left: 12px;
  width: 14px; height: 14px;
  color: #888;
  pointer-events: none;
  flex-shrink: 0;
}
.mega-seg.search-seg input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #111;
  background: transparent;
  padding: 8px 30px 8px 34px;
  min-width: 160px;
}
.mega-seg.search-seg input::placeholder { color: #aaa; }

.search-clear {
  position: absolute; right: 6px;
  border: none; background: transparent;
  padding: 4px; cursor: pointer; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  color: #888;
  transition: color .2s, background .2s;
}
.search-clear svg { width: 13px; height: 13px; }
.search-clear:hover { color: #111; background: var(--line); }

/* Botón filtro avanzado */
.filter-advanced-btn {
  position: relative;
  width: 38px; height: 38px;
  border: none;
  border-radius: 999px;
  background: #111;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .18s, background .2s;
  margin-left: 3px;
}
.filter-advanced-btn svg { width: 14px; height: 14px; }
.filter-advanced-btn:hover { background: #333; }
.filter-advanced-btn:active { transform: scale(.93); }

.filter-badge {
  position: absolute; top: -3px; right: -3px;
  width: 16px; height: 16px;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 900;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── BOTÓN USUARIO ─────────────────────────────────────────── */
.user-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1.5px solid #ddd;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #333;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.user-btn:hover {
  border-color: #aaa;
  box-shadow: 0 2px 8px rgba(0,0,0,.13);
}

/* ─── MOBILE: TRIGGER COMPACTO ──────────────────────────────── */
@media (max-width: 700px) {
  .top-bar-inner { height: 64px; gap: 8px; }
  .brand-text { display: none; }
  .mega-desktop { display: none; }

  .mega-mobile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    cursor: pointer;
    text-align: left;
    min-width: 0;
  }
  .mobile-trigger-icon {
    width: 32px; height: 32px;
    border-radius: 999px;
    background: #f5f5f5;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #333;
  }
  .mobile-trigger-text {
    display: flex; flex-direction: column; gap: 1px;
    flex: 1; min-width: 0;
  }
  .mobile-trigger-main {
    font-size: 13px; font-weight: 700; color: #111;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-trigger-hint {
    font-size: 11px; font-weight: 500; color: #888;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-trigger-filter-btn {
    width: 28px; height: 28px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .results-count { text-align: left; }
}

/* ─── PANEL MÓVIL MEGAFILTRO ────────────────────────────────── */
.mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-start;
  animation: fadeIn .2s ease;
}
.mobile-search-panel {
  width: 100%;
  background: #fff;
  border-radius: 0 0 24px 24px;
  display: flex; flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
  animation: slideDown .28s cubic-bezier(.4,0,.2,1);
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.mobile-panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line-2);
}
.mobile-panel-close {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: none;
  background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #444;
  flex-shrink: 0;
}
.mobile-panel-close svg { width: 14px; height: 14px; }
.mobile-panel-title {
  font-size: 15px; font-weight: 800; color: #111;
}
.mobile-panel-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.mobile-filter-section { display: flex; flex-direction: column; gap: 8px; }
.mobile-filter-label {
  margin: 0;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: #999;
}
.mobile-tipo-group {
  display: flex; gap: 6px;
}
.mobile-tipo-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #e2e2e2;
  background: #fff;
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: #555; cursor: pointer;
  transition: all .18s;
}
.mobile-tipo-btn:hover { border-color: #aaa; }
.mobile-tipo-btn.active { border-color: #111; background: #111; color: #fff; }
.mobile-tipo-btn[data-tipo-m="arriendo"].active { background: #2563eb; border-color: #2563eb; }
.mobile-tipo-btn[data-tipo-m="venta"].active    { background: #059669; border-color: #059669; }

.mobile-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e2e2;
  border-radius: 12px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  color: #333; background: #fff;
  outline: none; cursor: pointer;
  appearance: none;
}
.mobile-select:focus { border-color: #111; }

.mobile-search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #e2e2e2;
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s;
}
.mobile-search-input-wrap:focus-within { border-color: #111; }
.mobile-search-input-wrap svg { color: #888; flex-shrink: 0; }
.mobile-search-input-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 14px; font-weight: 500; font-family: inherit; color: #111; background: transparent;
}
.mobile-search-input-wrap input::placeholder { color: #aaa; }

.mobile-panel-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line-2);
  gap: 10px;
}
.btn-mobile-clear {
  padding: 12px 18px;
  border-radius: 12px; border: 1.5px solid #ccc;
  background: transparent;
  font-size: 13px; font-weight: 700; font-family: inherit;
  color: #333; cursor: pointer;
  transition: border-color .2s;
}
.btn-mobile-clear:hover { border-color: #666; }
.btn-mobile-go {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 12px; border: none;
  background: #111; color: #fff;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.btn-mobile-go:hover { background: #333; }

/* ─── MODAL PERFIL ALEX ARIAS ───────────────────────────────── */
.profile-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.profile-card {
  background: #fff;
  border-radius: 24px;
  width: 100%; max-width: 560px;
  padding: 20px 28px 28px;
  position: relative;
  animation: popIn .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* Header del card con close + edit */
.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.profile-close {
  width: 30px; height: 30px;
  border-radius: 999px; border: none;
  background: #f0f0f0; color: #444;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.profile-close:hover { background: #e0e0e0; }
.profile-close svg { width: 13px; height: 13px; }

.profile-header-actions {
  display: flex; align-items: center; gap: 6px;
}
.profile-edit-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 12px; font-weight: 600; color: #6b7280;
  cursor: pointer;
  transition: all .18s;
}
.profile-edit-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.profile-logout-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 12px; font-weight: 600; color: #9ca3af;
  cursor: pointer;
  transition: all .18s;
}
.profile-logout-btn:hover { border-color: #ef4444; color: #ef4444; background: #fff1f2; }

/* Stats row */
.profile-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: 12px 0 14px;
  background: #f8f9fa; border-radius: 14px; padding: 10px 0;
}
.profile-stat { flex: 1; text-align: center; }
.profile-stat-sep { width: 1px; height: 28px; background: #e5e7eb; }
.stat-value { display: block; font-size: 18px; font-weight: 800; color: #111; letter-spacing: -.03em; }
.stat-label { display: block; font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; margin-top: 1px; }

/* Licencia */
.profile-license {
  display: flex; align-items: center; gap: 5px;
  justify-content: center;
  font-size: 11px; font-weight: 600; color: #6b7280;
  background: #f3f4f6; border-radius: 8px;
  padding: 5px 10px; margin-bottom: 12px;
}

/* Instagram icon color */
.ig-icon { background: #fce7f3; color: #db2777; }

/* ── MODO EDICIÓN ── */
.profile-edit-avatar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.profile-avatar--edit { cursor: default; }
.profile-edit-avatar-actions { display: flex; gap: 8px; }
.profile-avatar-upload-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px;
  border: 1.5px solid #e5e7eb; background: #fff;
  font-size: 12px; font-weight: 600; color: #6b7280;
  cursor: pointer; transition: all .18s;
}
.profile-avatar-upload-btn:hover { border-color: var(--brand); color: var(--brand); }

.profile-edit-form { display: flex; flex-direction: column; gap: 10px; }
.pef-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pef-group { display: flex; flex-direction: column; gap: 4px; }
.pef-label { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; }
.pef-input {
  padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; background: #fff;
  font-size: 13px; color: #111; font-family: inherit;
  outline: none; transition: border-color .18s;
}
.pef-input:focus { border-color: var(--brand); }
.pef-textarea {
  padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; background: #fff;
  font-size: 13px; color: #111; font-family: inherit;
  outline: none; resize: vertical; transition: border-color .18s;
}
.pef-textarea:focus { border-color: var(--brand); }
.pef-pwd-row { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid #f3f4f6; }
.pef-error { font-size: 12px; color: var(--red); }
.pef-actions { display: flex; gap: 8px; padding-top: 4px; }
.pef-actions .btn-secondary { flex: 1; }
.pef-actions .btn-primary   { flex: 2; display: flex; align-items: center; justify-content: center; gap: 6px; }

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.avatar-initials {
  font-size: 24px; font-weight: 900; color: #fff;
  letter-spacing: -.04em;
}

.profile-info { text-align: center; margin-bottom: 12px; }
.profile-name {
  margin: 0 0 4px;
  font-size: 20px; font-weight: 900;
  letter-spacing: -.04em; color: #111;
}
.profile-role {
  margin: 0 0 6px;
  font-size: 13px; font-weight: 600; color: #666;
}
.profile-zone {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0;
  font-size: 11px; font-weight: 600; color: #999;
}

.profile-bio {
  margin: 0 0 18px;
  font-size: 12.5px; line-height: 1.6;
  color: #555; text-align: center;
  padding: 0 4px;
}

.profile-contacts {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 18px;
}
.profile-contact {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  transition: background .18s;
}
.profile-contact:hover { background: #f7f7f7; }
.contact-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.phone-icon { background: #dbeafe; color: #2563eb; }
.email-icon { background: #fce7f3; color: #db2777; }
.wa-icon    { background: #dcfce7; color: #16a34a; }

.contact-detail { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.contact-label { font-size: 10px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: .08em; }
.contact-value { font-size: 13px; font-weight: 600; color: #111; }
.contact-arrow { color: #ccc; }

.profile-actions {
  display: flex; gap: 8px;
}
.btn-profile-wa, .btn-profile-call {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px;
  border-radius: 14px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  text-decoration: none;
  transition: opacity .2s, transform .18s;
}
.btn-profile-wa:active, .btn-profile-call:active { transform: scale(.97); }
.btn-profile-wa  { background: #25d366; color: #fff; }
.btn-profile-call { background: #111; color: #fff; }

/* ─── MAIN GRID ─────────────────────────────────────────────── */
.main-content {
  width: min(96vw, 1680px);
  margin: 32px auto 0;
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

/* ─── LOADING STATE ─────────────────────────────────────────── */
.loading-state {
  display: contents; /* los skeleton-card pasan a ser hijos directos del grid */
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--line-2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SKELETON LOADER ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  width: 100%;
  height: var(--card-collapsed-height);
  background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 50%, var(--line-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}
.empty-state p { font-size: 15px; font-weight: 500; }

.fav-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px;
}

@keyframes badgePulse {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── PROPERTY CARD ─────────────────────────────────────────── */
.property-card {
  position: relative;
  height: var(--card-collapsed-height);
  width: 100%;
  z-index: 1;
}
.property-card.card-animate {
  animation: cardFadeIn .4s ease-out forwards;
}
.property-card.card-animate:nth-child(2) { animation-delay: 40ms; }
.property-card.card-animate:nth-child(3) { animation-delay: 80ms; }
.property-card.card-animate:nth-child(4) { animation-delay: 120ms; }
.property-card.card-animate:nth-child(n+5) { animation-delay: 160ms; }
@keyframes cardFadeIn {
  from { opacity: 0.4; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── ANIMACIÓN DE CONTADORES ──────────────────────────────────── */
@keyframes countUp {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.views-count, .like-count {
  display: inline-block;
  animation: countUp .35s ease-out;
}

.property-card.is-open { z-index: 80; }

.property-card-inner {
  position: absolute;
  inset: 0;
  height: var(--card-collapsed-height);
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 10px;
  padding-top: 12px;
  overflow: hidden;
  transition: height .34s cubic-bezier(.4,0,.2,1),
              box-shadow .25s ease,
              border .25s ease;
}

.property-card.is-open .property-card-inner {
  height: var(--card-expanded-height-desktop);
  box-shadow: var(--shadow-open);
  border: 1px solid rgba(0,0,0,.06);
}

/* ─── MEDIA / SLIDER ─────────────────────────────────────────── */
.property-media {
  position: relative;
  width: 100%;
  height: var(--media-height);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
/* Garantizar overflow hidden en todos los contextos */
.property-media,
.map-cards-list .property-media {
  overflow: hidden !important;
  border-radius: var(--radius-lg) !important;
}

.property-slider { position: relative; width: 100%; height: 100%; }
.property-slides { position: relative; width: 100%; height: 100%; }

.property-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.property-slide.is-active { opacity: 1; pointer-events: auto; }
.property-slide img { object-fit: cover; }

/* Overlay gradient */
.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,.88) 0%,
    rgba(0,0,0,.25) 45%,
    transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  pointer-events: none;
}

/* Status badge top */
.media-overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: auto;
}

/* Badge esquina superior derecha: top likes */
.prop-corner-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
  animation: badgePulse .5s ease-out;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: none;
  font-size: 9px;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform .18s, opacity .2s;
}
.status-btn:active { transform: scale(.95); }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.status-btn.status-libre {
  background: rgba(220,252,231,.85);
  color: #15803d;
}
.status-btn.status-libre .status-dot { background: #15803d; }

.status-btn.status-ocupado {
  background: rgba(254,226,226,.85);
  color: #b91c1c;
}
.status-btn.status-ocupado .status-dot { background: #b91c1c; }

/* Bottom of overlay: location + price */
.media-overlay-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.media-location { display: flex; flex-direction: column; gap: 1px; }

.location-municipio {
  margin: 0;
  color: rgba(255,255,255,.7);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .28em;
}

.location-barrio {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  max-width: 160px;
}

.card-price {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.03em;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* Tipo pill inside image overlay — hidden by default, shown in carousel peek */
.tipo-overlay-badge {
  display: none;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 5px;
  width: fit-content;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Slider arrows */
.slider-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none; border-radius: 999px;
  background: rgba(0,0,0,.38);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 3;
  opacity: 0;
  transition: background .2s, transform .18s, opacity .2s;
}
.property-media:hover .slider-arrow,
.property-card.is-open .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: rgba(0,0,0,.6); }
.slider-arrow:active { transform: translateY(-50%) scale(.93); }
.slider-arrow.prev { left: 10px; }
.slider-arrow.next { right: 10px; }
.slider-arrow svg { width: 16px; height: 16px; }

/* Lightbox trigger button (aparece solo cuando la tarjeta está abierta) */
.lightbox-trigger {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 4;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .2s, transform .2s, background .15s;
  pointer-events: none;
}
.property-card.is-open .lightbox-trigger {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.lightbox-trigger:hover { background: rgba(0,0,0,.72); }
.lightbox-trigger svg { flex-shrink: 0; }

/* Imagen slide con fade-in suave */
.property-slide img {
  opacity: 0;
  transition: opacity .35s ease;
}
.property-slide img.img-loaded { opacity: 1; }

/* Slider dots */
.slider-dots {
  position: absolute;
  left: 50%; bottom: 12px;
  transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 3;
}
.slider-dot {
  width: 6px; height: 6px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,.38);
  padding: 0; cursor: pointer;
  transition: width .22s ease, background .22s ease;
}
.slider-dot.is-active { width: 18px; background: #fff; }

/* ─── CARD ACTIONS BAR ─────────────────────────────────────── */
.card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 0;
  flex-shrink: 0;
  height: var(--actions-bar-height);
}

/* Badge Arriendo / Venta */
.tipo-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tipo-badge--arriendo {
  background: var(--brand-light);
  color: var(--brand);
}
.tipo-badge--venta {
  background: #d1fae5;
  color: #065f46;
}
.tipo-badge--nuevo {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  animation: badgePulse .5s ease-out;
}

/* Like button */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  transition: color .2s, transform .18s;
}
.like-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.like-btn:hover { color: var(--brand); transform: scale(1.08); }
.like-btn:active { transform: scale(.94); }
.like-btn.is-liked { color: var(--brand); }
.like-btn.is-liked svg { fill: var(--brand); stroke: var(--brand); }

/* Views button */
.views-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  cursor: default;
  pointer-events: none;
  font-family: inherit;
  flex-shrink: 0;
}
.views-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.views-btn .views-count { font-variant-numeric: tabular-nums; }

/* Expand toggle */
.expand-toggle {
  border: none;
  background: var(--bg);
  border-radius: 999px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted-2);
  flex-shrink: 0;
  transition: color .2s, background .2s, transform .28s;
}
.expand-toggle svg { width: 18px; height: 18px; transition: transform .3s ease; }
.expand-toggle:hover { color: var(--black); background: var(--line-2); }
.property-card.is-open .expand-toggle svg { transform: rotate(180deg); }
.property-card.is-open .expand-toggle { color: var(--brand); background: var(--brand-light); }

/* ─── PROPERTY DETAILS (expandida) ─────────────────────────── */
.property-details {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .26s ease, transform .26s cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}
.property-card.is-open .property-details {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Animación de cierre suave (slide hacia abajo) */
.property-card.is-closing .property-details {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .18s ease, transform .18s ease;
}

.property-details-scroll {
  overflow-y: auto;
  padding: 16px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Detail header */
.detail-header { display: flex; flex-direction: column; gap: 4px; }
.detail-header h3 {
  margin: 0;
  font-size: 15px; font-weight: 800;
  color: #111827; letter-spacing: -.03em; line-height: 1.15;
}
.detail-address {
  margin: 0;
  font-size: 10px; font-weight: 600;
  color: var(--muted); letter-spacing: .06em;
}

/* Stats */
.property-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.stat-item { flex: 1 1 0; text-align: center; }
.stat-item p {
  margin: 0 0 3px;
  font-size: 16px; font-weight: 900;
  letter-spacing: -.05em; color: var(--brand);
}
.stat-item span {
  display: block; font-size: 8px;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .22em; font-weight: 900;
}
.stat-item.with-border {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 16px;
}

/* Amenidades */
.property-amenities { display: flex; flex-direction: column; gap: 10px; }
.section-label {
  margin: 0;
  font-size: 9px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .24em; color: var(--muted);
}

.amenities-list { display: flex; flex-wrap: wrap; gap: 6px; }

.amenity-chip {
  display: inline-flex; align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  line-height: 1;
  background: #f8fafc; color: #475569; /* fallback */
}
/* Paleta rotativa de 8 colores para amenidades */
.amenity-chip.chip-0 { background: #fecdd3; color: #9f1239; }
.amenity-chip.chip-1 { background: #bfdbfe; color: #1e40af; }
.amenity-chip.chip-2 { background: #bbf7d0; color: #14532d; }
.amenity-chip.chip-3 { background: #e9d5ff; color: #581c87; }
.amenity-chip.chip-4 { background: #fed7aa; color: #7c2d12; }
.amenity-chip.chip-5 { background: #99f6e4; color: #134e4a; }
.amenity-chip.chip-6 { background: #fde68a; color: #78350f; }
.amenity-chip.chip-7 { background: #c7d2fe; color: #312e81; }

/* Description */
.property-description p {
  margin: 0;
  font-size: 12px; line-height: 1.65;
  color: #4b5563;
}

/* Detail actions */
.detail-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
}

.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  font-size: 11px; font-weight: 800;
  font-family: inherit; color: var(--muted-2);
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .18s;
  white-space: nowrap;
}
.share-btn svg { width: 14px; height: 14px; }
.share-btn:hover { border-color: var(--black); color: var(--black); }
.share-btn:active { transform: scale(.97); }

.contact-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 11px; font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .18s;
  white-space: nowrap;
}
.contact-btn svg { width: 15px; height: 15px; }
.contact-btn:hover { background: #128c7e; }
.contact-btn:active { transform: scale(.97); }

/* Admin actions in details */
.admin-actions {
  display: flex; gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.admin-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 10px; font-weight: 800; font-family: inherit;
  color: var(--muted-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all .2s;
}
.admin-btn svg { width: 12px; height: 12px; }
.admin-btn:hover { border-color: var(--black); color: var(--black); }
.admin-btn.danger:hover { border-color: #ef4444; color: #ef4444; }

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; }

/* ─── MAP VIEW — Layout 50/50 ────────────────────────────────── */
.map-view {
  position: fixed;
  top: var(--top-bar-h, 72px); left: 0; right: 0; bottom: 0;
  display: flex;
  z-index: 10;
}

/* ── Animación grid → mapa ─────────────────────────────────── */
#gridView {
  transition: opacity .25s ease, transform .3s cubic-bezier(.4,0,.2,1);
}
#gridView.view-exit {
  opacity: 0;
  transform: scale(.96) translateY(-12px);
  pointer-events: none;
}
#mapView {
  transition: opacity .3s ease, transform .3s cubic-bezier(.4,0,.2,1);
}
#mapView.view-enter {
  opacity: 0;
  transform: scale(.97) translateY(16px);
}
#mapView.view-enter-active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Sidebar izquierdo — 50% Airbnb ───────────────────────── */
.map-sidebar {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line-2);
  overflow: hidden;
}

.map-sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg);
  flex-shrink: 0;
}
.map-sidebar-count {
  font-size: 12px; font-weight: 700; color: var(--muted-2);
}

.map-cards-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  align-content: start;
}
.map-cards-list::-webkit-scrollbar { width: 3px; }
.map-cards-list::-webkit-scrollbar-track { background: transparent; }
.map-cards-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; }
/* Empty state ocupa todo el ancho */
.map-cards-list > p { grid-column: 1 / -1; }

/* ── Tarjeta del sidebar del mapa — idéntico al inicio ──────── */
.map-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-xl, 36px);
  overflow: hidden;
  box-shadow: var(--shadow, 0 20px 50px rgba(0,0,0,.12));
  cursor: pointer;
  transition: box-shadow .25s, transform .2s;
  border: 1.5px solid transparent;
  flex-shrink: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.map-card:hover {
  box-shadow: var(--shadow-open, 0 28px 60px rgba(0,0,0,.18));
  transform: translateY(-2px);
}
.map-card.is-active {
  border-color: #222;
  box-shadow: var(--shadow-open);
}

.map-card-img {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--line);
}
.map-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.map-card:hover .map-card-img img { transform: scale(1.04); }

.map-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.1) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  pointer-events: none;
}
.map-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.map-card-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9px; font-weight: 900;
  letter-spacing: .1em; text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.map-card-status.libre  { background: rgba(220,252,231,.85); color: #15803d; }
.map-card-status.ocupado{ background: rgba(254,226,226,.85); color: #b91c1c; }
.map-card-status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.map-card-tipo {
  font-size: 9px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 9px;
  border-radius: 999px; backdrop-filter: blur(8px);
}
.map-card-tipo.arriendo { background: rgba(219,234,254,.9); color: #1d4ed8; }
.map-card-tipo.venta    { background: rgba(209,250,229,.9); color: #065f46; }

.map-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.map-card-location { display: flex; flex-direction: column; gap: 1px; }
.map-card-muni  { font-size: 8px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.map-card-barrio{ font-size: 14px; font-weight: 800; color: #fff; line-height: 1.1; }
.map-card-price { font-size: 14px; font-weight: 900; color: #fff; white-space: nowrap; }

.map-card-body {
  padding: 12px 14px;
}
.map-card-title {
  font-size: 13px; font-weight: 700; color: #111;
  margin: 0 0 6px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-card-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.map-card-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #666;
}
.map-card-stat svg { width: 12px; height: 12px; color: #999; }

/* Expanded detail dentro del sidebar */
.map-card-detail {
  display: none;
  padding: 0 14px 14px;
  flex-direction: column;
  gap: 10px;
}
.map-card.is-active .map-card-detail { display: flex; }

.map-card-actions {
  display: flex; gap: 6px;
}
.map-card-btn-share {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: transparent;
  font-size: 11px; font-weight: 700; font-family: inherit;
  color: #333; cursor: pointer;
  transition: border-color .2s;
}
.map-card-btn-share:hover { border-color: #111; }
.map-card-btn-wa {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 12px; border: none;
  background: #25d366; color: #fff;
  font-size: 12px; font-weight: 800; font-family: inherit;
  text-decoration: none;
  transition: background .2s;
}
.map-card-btn-wa:hover { background: #128c7e; }

/* ── Mapa derecho ──────────────────────────────────────────── */
.map-pane {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 12px;
  background: var(--bg);
}
#leafletMap {
  width: 100%;
  height: 100%;
  z-index: 0;
  border-radius: 16px;
  overflow: hidden;
}

/* ── Marcadores de precio (Airbnb style) ───────────────────── */
.map-price-marker {
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1.5px solid #ddd;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s;
  line-height: 1;
}
.map-price-marker:hover,
.map-price-marker.hovered {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(231,20,51,.3);
  z-index: 999 !important;
}

.map-price-marker.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(231,20,51,.2), 0 6px 20px rgba(231,20,51,.35);
  z-index: 999 !important;
  animation: pinPulse .6s ease-out;
}

@keyframes pinPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1.1); opacity: 1; }
}

.map-price-marker.occupied {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.map-price-marker.occupied:hover,
.map-price-marker.occupied.hovered {
  background: #b91c1c;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(185,28,28,.3);
}

.map-price-marker.occupied.active {
  background: #b91c1c;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(185,28,28,.2), 0 6px 20px rgba(185,28,28,.35);
  animation: pinPulse .6s ease-out;
}

/* Tarjeta resaltada desde hover en el pin del mapa */
.property-card.is-map-hovered > .property-card-inner {
  box-shadow: 0 0 0 2.5px var(--brand), 0 8px 24px rgba(231,20,51,.18);
  transform: translateY(-2px);
  transition: box-shadow .15s, transform .15s;
}

/* Wrapper del marcador */
.map-marker-wrap { background: transparent !important; border: none !important; }

/* Popup personalizado */
.map-custom-popup .leaflet-popup-content-wrapper {
  border-radius: 18px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.22) !important;
  border: 1px solid #eee !important;
}
.map-custom-popup .leaflet-popup-content { margin: 0 !important; width: 240px !important; }
.map-custom-popup .leaflet-popup-tip-container { display: none !important; }
.map-custom-popup .leaflet-popup-close-button { display: none !important; }

/* Mini-tarjeta popup — Airbnb minimal ─────────────────────── */
.map-popup-card { font-family: 'Inter', sans-serif; width: 220px; }

.map-popup-img-wrap {
  position: relative; width: 100%; height: 150px; overflow: hidden;
}
.map-popup-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.map-popup-no-img {
  width: 100%; height: 100%; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
}
.map-popup-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%);
  display: flex; flex-direction: column;
  justify-content: space-between; padding: 8px;
}
.map-popup-img-overlay .map-popup-badge-tipo {
  align-self: flex-end;
}
.map-popup-img-overlay .map-popup-badge-status {
  display: none; /* Solo tipo en la imagen */
}

.map-popup-badge-status, .map-popup-badge-tipo {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 999px;
}
.map-popup-badge-status.libre   { background: rgba(220,252,231,.9); color: #15803d; }
.map-popup-badge-status.ocupado { background: rgba(254,226,226,.9); color: #b91c1c; }
.mpb-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.map-popup-badge-tipo.arriendo { background: rgba(219,234,254,.95); color: #1d4ed8; }
.map-popup-badge-tipo.venta    { background: rgba(209,250,229,.95); color: #065f46; }

.map-popup-body { padding: 10px 12px 12px; }
.map-popup-title {
  margin: 0 0 4px; font-size: 13px; font-weight: 800; color: #111;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-popup-price {
  margin: 0 0 10px; font-size: 17px; font-weight: 900; color: #111;
}
.map-popup-wa {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px;
  border-radius: 10px; background: #25d366; color: #fff;
  font-size: 12px; font-weight: 800; font-family: inherit;
  text-decoration: none; transition: background .2s;
}
.map-popup-wa:hover { background: #128c7e; }

/* ── Mapa derecho — ocupa el resto (heredado arriba) ────────── */

/* ── Property cards dentro del sidebar del mapa ─────────────── */
/* ── Property cards en el sidebar del mapa (desktop) ────────── */
/* Igual que el grid principal: contenedor con altura fija,
   inner en absolute → se expande por encima sin empujar las de abajo */
.map-cards-list .property-card {
  height: var(--card-collapsed-height);
  position: relative !important;
}
.map-cards-list .property-card-inner {
  position: absolute !important;
  inset: 0 !important;
  height: var(--card-collapsed-height) !important;
  padding: 10px !important;
  padding-top: 12px !important;
}
.map-cards-list .property-card.is-open .property-card-inner {
  height: var(--card-expanded-height-desktop) !important;
  z-index: 10;
}
.map-cards-list .property-media { height: var(--media-height); }

/* Tarjeta activa (marcada desde el mapa) = borde oscuro */
.map-cards-list .property-card.is-map-active .property-card-inner {
  border: 2px solid #111;
  box-shadow: var(--shadow-open);
}

/* ── Custom DOM Overlay Popup — diseño igual a las tarjetas ── */
.map-overlay-popup {
  position: absolute;
  z-index: 800;
  pointer-events: all;
  animation: popIn .2s cubic-bezier(.2,.8,.4,1.1) both;
}
.map-overlay-card {
  background: #fff;
  border-radius: 20px;
  width: 272px;
  box-shadow: 0 12px 48px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  cursor: default;
}

/* ── Imagen ── */
.map-overlay-media {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: 20px 20px 0 0;
}
.map-overlay-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.map-overlay-card:hover .map-overlay-media img { transform: scale(1.04); }
.map-overlay-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Botón cerrar */
.map-overlay-close {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  border: none; cursor: pointer; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.map-overlay-close:hover { background: rgba(0,0,0,.7); }
.map-overlay-close svg { color: #fff; }

/* Badge LIBRE / OCUPADO */
.map-overlay-status {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
  padding: 4px 9px 4px 7px; border-radius: 999px;
  backdrop-filter: blur(10px);
}
.map-overlay-status.libre    { background: rgba(0,0,0,.42); color: #4ade80; }
.map-overlay-status.occupied { background: rgba(0,0,0,.42); color: #f87171; }
.map-overlay-status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: currentColor;
}

/* Contador de propiedades (X de Y) */
.map-overlay-counter {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 8px;
  background: rgba(0,0,0,.5); color: #fff;
  backdrop-filter: blur(10px);
}

/* Custom map controls */
.map-controls-custom {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255,255,255,.95) !important;
  border: 1px solid #ddd !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
  padding: 0 !important;
  overflow: hidden;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  font-size: 0;
  padding: 0;
}

.map-control-btn:hover {
  background: #f3f4f6;
  color: var(--brand);
}

.map-control-btn:active {
  background: #e5e7eb;
}

.map-control-btn + .map-control-btn {
  border-top: 1px solid #f0f0f0;
}

.map-control-btn.active {
  background: #f3f4f6;
  color: var(--brand);
}

.map-control-btn.loading {
  animation: spin .8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Cluster markers */
.cluster-icon {
  background: transparent !important;
  border: none !important;
}

.cluster-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  transition: transform .15s;
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
}

.cluster-marker:hover {
  transform: scale(1.1);
}

.cluster-marker.cluster-small {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.cluster-marker.cluster-medium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.cluster-marker.cluster-large {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  width: 52px;
  height: 52px;
  font-size: 16px;
}

/* Pin tooltip ligero — aparece sobre el marker al hover */
.pin-tooltip {
  position: fixed;
  z-index: 9000;
  transform: translate(-50%, -100%);
  background: rgba(17,24,39,.92);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* Footer superpuesto en imagen: location + nombre + precio */
.map-overlay-media-footer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,.68) 0%, transparent 100%);
  padding: 32px 12px 11px;
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: none;
}
.map-overlay-loc {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,.72);
  text-transform: uppercase; letter-spacing: .07em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-overlay-name-price {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.map-overlay-name {
  font-size: 13px; font-weight: 800; color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.map-overlay-price {
  font-size: 14px; font-weight: 900; color: #fff;
  white-space: nowrap; flex-shrink: 0;
}

/* ── Cuerpo ── */
.map-overlay-body { padding: 11px 13px 13px; }

.map-overlay-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.map-overlay-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.map-overlay-stat {
  font-size: 11px; font-weight: 600; color: #666;
  display: flex; align-items: center; gap: 3px;
}
.map-overlay-stat + .map-overlay-stat::before {
  content: '·'; color: #ccc; margin-right: 5px;
}

/* Badge tipo (ARRIENDO / VENTA) */
.map-overlay-tipo-badge {
  font-size: 8.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; padding: 3px 8px;
  border-radius: 999px; flex-shrink: 0;
}
.map-overlay-tipo-badge.arriendo { background: #dbeafe; color: #1d4ed8; }
.map-overlay-tipo-badge.venta    { background: #d1fae5; color: #065f46; }

/* Botón Ver detalles (reemplaza WA en el overlay del mapa) */
.map-overlay-detail-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 12px;
  border-radius: 12px;
  background: #111; color: #fff;
  font-size: 12.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; border: none;
  transition: background .18s, transform .12s;
}
.map-overlay-detail-btn:hover { background: #333; transform: translateY(-1px); }
.map-overlay-detail-btn:active { transform: scale(.97); }

/* ── Responsive móvil: Bottom Sheet Airbnb (3 snap points) ─── */
@media (max-width: 768px) {
  .map-view {
    top: var(--top-bar-h, 64px);
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    position: fixed;
    flex-direction: column;
  }

  /* Mapa ocupa toda la pantalla */
  .map-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    flex: none;
    order: 1;
    padding: 0;
  }

  #leafletMap { border-radius: 0; }

  /* ── BOTTOM SHEET ─────────────────────────────────────────── */
  .map-sidebar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 72px;                      /* Snap 1: solo handle */
    max-height: 90vh;
    border-right: none;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,.12);
    z-index: 20;
    order: 2;
    transition: height .38s cubic-bezier(.32,.72,0,1); /* iOS spring */
    background: #fff;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    will-change: height;
  }

  /* Snap 1: colapsado — solo handle+contador */
  .map-sidebar.sheet-hidden { height: 72px; }

  /* Snap 2: peek — 1 tarjeta visible (carousel horizontal) */
  .map-sidebar.sheet-peek { height: 310px; }

  /* Snap 3: expandido — lista completa */
  .map-sidebar.sheet-expanded { height: 88vh; }

  /* ── HANDLE ───────────────────────────────────────────────── */
  .map-sidebar-header {
    cursor: grab;
    padding: 10px 16px 8px;
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    user-select: none; -webkit-user-select: none;
    flex-shrink: 0;
    transition: background .15s;
    touch-action: none;
  }
  .map-sidebar-header:active { background: #f8f8f8; cursor: grabbing; }

  /* Pill del handle */
  .map-sheet-pill {
    width: 44px; height: 4px;
    background: #d0d0d0;
    border-radius: 999px;
    transition: width .2s, background .2s;
    flex-shrink: 0;
  }
  .map-sidebar-header:active .map-sheet-pill {
    width: 52px; background: #888;
  }
  .map-sidebar.sheet-dragging .map-sheet-pill { background: #555; }

  /* Label: contador + chevron */
  .map-sheet-label {
    display: flex; align-items: center; gap: 6px;
  }
  .map-sidebar-count { font-size: 12px; font-weight: 700; color: #333; }
  .map-sheet-chevron {
    transition: transform .32s cubic-bezier(.32,.72,0,1);
    color: #999;
  }
  .map-sidebar.sheet-expanded .map-sheet-chevron { transform: rotate(180deg); }
  .map-sidebar.sheet-peek .map-sheet-chevron { transform: rotate(0deg); }

  /* Separador bajo el handle */
  .map-sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px; background: #f0f0f0;
  }
  .map-sidebar-header { position: relative; }

  /* ── LISTA: VERTICAL por defecto ─────────────────────────── */
  .map-cards-list {
    grid-template-columns: 1fr;
    padding: 10px 14px 100px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    height: auto;
    gap: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* ── LISTA: HORIZONTAL en modo peek (carousel) ──────────── */
  .map-sidebar.sheet-peek .map-cards-list {
    display: flex;
    flex-direction: row;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding: 10px 14px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .map-sidebar.sheet-peek .map-cards-list::-webkit-scrollbar { display: none; }

  /* Tarjeta en carousel — ancho fijo (solo cuando NO está expandida) */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) {
    flex: 0 0 82vw;
    max-width: 340px;
    scroll-snap-align: center;
  }

  /* ── CAROUSEL COMPACT: Airbnb-style clean cards ─────────────── */
  /* Only applies to non-expanded cards so is-open full-screen wins */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) {
    height: 205px !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
  }
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .property-card-inner {
    height: 205px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    padding: 0 !important;          /* Remove desktop inner padding */
  }
  /* Image fills the full card */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .property-media {
    height: 205px !important;
    flex: none !important;
    border-radius: 0 !important;
  }
  /* Stronger gradient so overlay text is readable */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .media-overlay {
    background: linear-gradient(to top,
      rgba(0,0,0,.82) 0%,
      rgba(0,0,0,.10) 52%,
      transparent 100%) !important;
  }
  /* Tighten overlay bottom padding */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .media-overlay-bottom {
    padding: 0 13px 13px !important;
    align-items: flex-end !important;
  }
  /* Compact barrio text (single line, no overflow) */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .location-barrio {
    font-size: 14px !important;
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.15 !important;
  }
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .location-municipio {
    font-size: 8px !important;
  }
  /* Compact price */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .card-price {
    font-size: 13px !important;
    align-self: flex-end !important;
    padding-bottom: 2px !important;
  }
  /* Show tipo pill in overlay */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .tipo-overlay-badge {
    display: inline-flex !important;
  }

  /* Hide all cluttered / complex elements in compact mode */
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .slider-arrow,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .slider-dots,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .lightbox-trigger,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .prop-corner-badge,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .media-overlay-top,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .card-actions-bar,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .property-details,
  .map-sidebar.sheet-peek .map-cards-list .property-card:not(.is-open) .admin-actions {
    display: none !important;
  }

  /* Property cards normales en el sheet */
  .map-cards-list .property-card { height: var(--card-collapsed-height); }
  .map-cards-list .property-card.is-open { height: var(--card-expanded-height-mobile); }
  .map-cards-list .property-media { height: var(--media-height); }

  /* Tarjeta expandida → pantalla completa */
  .map-cards-list .property-card.is-open {
    position: fixed !important;
    top: var(--top-bar-h, 64px) !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: calc(100dvh - var(--top-bar-h, 64px)) !important;
    z-index: 300 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow-y: auto;
  }
  .map-cards-list .property-card.is-open .property-card-inner {
    position: relative !important;
    height: auto !important;
    min-height: calc(100dvh - 64px);
    border-radius: 0 !important;
    overflow: visible !important;
  }
  .map-cards-list .property-card.is-open .property-media {
    height: 62vw; min-height: 240px;
    border-radius: var(--radius-lg) !important;
  }

  /* ── FAB "Ver lista" ──────────────────────────────────────── */
  .map-list-fab {
    position: absolute;
    bottom: 86px;             /* sobre el sheet colapsado */
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex; align-items: center; gap: 7px;
    padding: 11px 22px;
    background: #111; color: #fff;
    border: none; border-radius: 999px;
    font-size: 13px; font-weight: 700; font-family: inherit;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s, box-shadow .15s;
    animation: fabIn .3s cubic-bezier(.32,.72,0,1) both;
  }
  .map-list-fab:active {
    transform: translateX(-50%) scale(.95);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
  }
  @keyframes fabIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  /* Ocultar FAB cuando sheet no está colapsado */
  .map-sidebar:not(.sheet-hidden) ~ .map-list-fab { display: none !important; }
}

/* ─── FLOATING BAR ──────────────────────────────────────────── */
.floating-bar {
  position: fixed;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--black);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}

.float-icon {
  position: relative;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, transform .18s;
  border-radius: 8px;
}
.float-icon svg { width: 20px; height: 20px; }
.float-icon:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.float-icon.active {
  color: var(--brand);
  background: rgba(231,20,51,.15);
}
.float-icon:active { transform: scale(.92); }

/* Tooltips en hover */
.float-icon::after {
  content: attr(aria-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  margin-bottom: 8px;
  z-index: 999;
}
.float-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Favorites count badge */
.fav-count-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  background: var(--brand);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
  border: 1.5px solid #111;
  animation: favBadgeIn .25s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes favBadgeIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Active: heart fills with brand red */
#btnFavorites.active svg {
  fill: var(--brand);
  stroke: var(--brand);
}
#btnFavorites.active {
  color: var(--brand);
}

/* ─── MODALS ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal-content {
  background: #fff;
  border-radius: 28px;
  padding: 32px;
  width: 100%;
  max-width: 580px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.2);
  margin: auto;
}
.modal-small { max-width: 380px; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border: none; border-radius: 999px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted-2);
  transition: background .2s, color .2s;
}
.modal-close svg { width: 14px; height: 14px; }
.modal-close:hover { background: var(--line-2); color: var(--black); }

.modal-icon {
  width: 56px; height: 56px;
  background: var(--bg);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--muted-2);
}

.modal-content h2 {
  margin: 0 0 6px;
  font-size: 22px; font-weight: 900;
  letter-spacing: -.04em;
}
.modal-sub {
  margin: 0 0 24px;
  font-size: 13px; color: var(--muted-2);
}

/* ─── FORMS ─────────────────────────────────────────────────── */
.upload-form { display: flex; flex-direction: column; gap: 0; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px; font-family: inherit; color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .3s cubic-bezier(.4,0,.2,1), box-shadow .3s cubic-bezier(.4,0,.2,1), background-color .3s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; cursor: pointer; }

.form-checkboxes {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--muted-2);
}
.check-label input { cursor: pointer; accent-color: var(--black); }

.form-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line-2);
}

.form-actions {
  display: flex; gap: 10px; padding-top: 8px;
}

.parse-area { display: flex; flex-direction: column; gap: 8px; }

.btn-parse {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  background: var(--bg);
  font-size: 11px; font-weight: 800;
  font-family: inherit; color: var(--muted-2);
  cursor: pointer;
  transition: all .2s;
  align-self: flex-start;
}
.btn-parse:hover { border-color: var(--black); color: var(--black); }

.btn-primary {
  flex: 1;
  min-height: 46px;
  border: none; border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 12px; font-weight: 900; font-family: inherit;
  letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: background .3s cubic-bezier(.4,0,.2,1), transform .2s cubic-bezier(.4,0,.2,1), box-shadow .3s;
  box-shadow: 0 2px 8px rgba(231,20,51,.15);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(231,20,51,.25);
  transform: translateY(-2px);
}
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  min-height: 46px;
  padding: 0 20px;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  font-size: 12px; font-weight: 800; font-family: inherit;
  color: var(--muted-2); cursor: pointer;
  transition: border-color .3s cubic-bezier(.4,0,.2,1), color .3s cubic-bezier(.4,0,.2,1), background .3s, box-shadow .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(231,20,51,.1);
}

.link-btn {
  border: none; background: none; padding: 0;
  color: var(--black); font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: underline;
}

.password-error {
  background: #fef2f2; color: #b91c1c;
  border-radius: 10px; padding: 10px 14px;
  font-size: 12px; font-weight: 600;
}

/* ─── PUBLISH FORM REDESIGN ─────────────────────────────── */
.publish-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.publish-header h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.04em; }

.admin-integ-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid #e0e0e0; background: #f8f8f8;
  font-size: 11px; font-weight: 700; font-family: inherit; color: #555;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.admin-integ-btn:hover {
  border-color: var(--brand); background: rgba(220,53,69,.06); color: var(--brand);
}
.parse-toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: var(--bg);
  font-size: 11px; font-weight: 700; font-family: inherit; color: var(--muted-2);
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.parse-toggle-btn:hover, .parse-toggle-btn.active {
  border-color: var(--black); background: var(--black); color: #fff;
}
.parse-area--collapsible {
  flex-direction: column; gap: 10px;
  background: var(--bg); border-radius: 16px; padding: 16px;
  margin-bottom: 8px;
}

/* Form sections */
.form-section {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 0; border-top: 1px solid var(--line-2);
}
.upload-form > .form-section:first-of-type { border-top: none; padding-top: 4px; }

.form-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.section-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}
.form-section-header > span {
  font-size: 14px; font-weight: 800; letter-spacing: -.02em; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-badge {
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--bg); padding: 2px 8px; border-radius: 999px;
}
.section-hint { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.field-hint { font-size: 11px; color: var(--muted); }

/* Tipo / Estado visual buttons */
.tipo-row, .estado-row { display: flex; gap: 8px; }
.tipo-btn {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 16px; border: 2px solid var(--line-2); border-radius: 16px;
  background: #fff; cursor: pointer; transition: all .2s; text-align: left;
  font-family: inherit; color: var(--text);
}
.tipo-btn svg { margin-bottom: 2px; opacity: .6; }
.tipo-btn strong { font-size: 13px; font-weight: 800; letter-spacing: -.02em; }
.tipo-btn span { font-size: 11px; color: var(--muted); }
.tipo-btn:hover { border-color: var(--text); }
.tipo-btn.active { border-color: var(--black); background: var(--black); color: #fff; }
.tipo-btn.active svg { opacity: 1; stroke: #fff; }
.tipo-btn.active span { color: rgba(255,255,255,.55); }

.estado-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: #fff; font-size: 12px; font-weight: 700; font-family: inherit;
  color: var(--muted-2); cursor: pointer; transition: all .2s;
}
.estado-btn:hover { border-color: var(--text); color: var(--text); }
.estado-btn.active { border-color: var(--black); color: var(--black); background: #f8f9fa; }
.estado-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.estado-dot.libre { background: #16a34a; }
.estado-dot.ocupado { background: #dc2626; }

/* Input with prefix / suffix */
.input-affix-wrap { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute; font-size: 13px; font-weight: 700;
  color: var(--muted-2); pointer-events: none; z-index: 1;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }
.input-with-pre { padding-left: 24px !important; }
.input-with-suf { padding-right: 32px !important; }

/* Counter inputs */
.counter-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden;
  background: #fff; transition: border-color .2s;
}
.counter-wrap:focus-within { border-color: var(--black); }
.counter-btn {
  width: 42px; height: 44px; border: none; background: none;
  font-size: 20px; font-weight: 300; color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s; line-height: 1;
}
.counter-btn:hover { background: var(--bg); }
.counter-btn:first-child { border-right: 1.5px solid var(--line-2); }
.counter-btn:last-child  { border-left: 1.5px solid var(--line-2); }
.counter-input {
  flex: 1; text-align: center; border: none !important; border-radius: 0 !important;
  box-shadow: none !important; padding: 0 4px !important;
  font-size: 15px; font-weight: 700; min-width: 0; background: transparent;
  font-family: inherit; color: var(--text);
}
.counter-input:focus { outline: none; }
.counter-input::-webkit-inner-spin-button,
.counter-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.counter-input[type=number] { -moz-appearance: textfield; }

/* Características pills */
.caract-check { display: none; }
.caract-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.caract-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 1.5px solid var(--line-2); border-radius: 999px;
  font-size: 12px; font-weight: 700; font-family: inherit; color: var(--muted-2);
  cursor: pointer; transition: all .2s; background: #fff; user-select: none;
}
.caract-pill:hover { border-color: var(--black); color: var(--black); }
.caract-check:checked + .caract-pill {
  border-color: var(--black); background: var(--black); color: #fff;
}
.caract-check:checked + .caract-pill svg { stroke: #fff; }

/* Form map */
.form-map-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1.5px solid var(--line-2);
}
#formMap { height: 280px; width: 100%; z-index: 0; }
.form-map-pin {
  display: flex; align-items: flex-end; justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
}
.btn-locate-me {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: #fff; border: 1.5px solid var(--line-2);
  border-radius: 999px; font-size: 11px; font-weight: 700; font-family: inherit;
  color: var(--text); cursor: pointer; transition: all .2s;
  white-space: nowrap; box-shadow: 0 2px 12px rgba(0,0,0,.12); z-index: 500;
}
.btn-locate-me:hover { background: var(--black); color: #fff; border-color: var(--black); }
.btn-geocode {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; border: 1.5px dashed var(--line-2); border-radius: 12px;
  background: var(--bg); font-size: 11px; font-weight: 700; font-family: inherit;
  color: var(--muted-2); cursor: pointer; transition: all .2s;
}
.btn-geocode:hover { border-color: var(--black); color: var(--black); background: #fff; }
.coords-row { margin-top: 4px; }

/* Upload icon */
.upload-icon-wrap {
  width: 48px; height: 48px; border-radius: 14px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}

/* Image upload area */
.image-upload-area {
  border: 2px dashed var(--line-2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted);
}
.image-upload-area:hover { border-color: var(--black); background: var(--bg); }
.image-upload-area svg { color: var(--muted); }
.image-upload-area p { margin: 0; font-size: 13px; font-weight: 500; }
.upload-hint { font-size: 10px; color: var(--muted); }

.image-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-preview-item {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px; overflow: hidden;
}
.image-preview-item img { object-fit: cover; width: 100%; height: 100%; }
.image-preview-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1;
}

.existing-images-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.existing-img-item {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px; overflow: hidden;
}
.existing-img-item img { object-fit: cover; width: 100%; height: 100%; }
.existing-img-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  background: rgba(220,38,38,.8); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

/* ── Filters Modal — Airbnb style ───────────────────────────── */
.filters-modal {
  max-width: 480px;
  padding: 0 !important;
  border-radius: 24px !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.filters-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
  flex-shrink: 0;
}
.filters-modal-title {
  font-size: 15px; font-weight: 800; color: #111;
  letter-spacing: -.02em;
}
.filters-modal .modal-close {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
}

.filters-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Sección individual */
.filter-section {
  padding: 24px 28px;
}
.filter-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.filter-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filter-section-title {
  font-size: 15px; font-weight: 800; color: #111;
  display: block; margin-bottom: 4px;
}
.filter-section-value {
  font-size: 14px; font-weight: 700; color: #111;
}
.filter-section-sub {
  font-size: 13px; color: #777; font-weight: 500; margin-top: 3px;
}

.filter-divider {
  height: 1px;
  background: var(--line-2);
  margin: 0 28px;
}

/* Slider */
.filter-slider-wrap { display: flex; flex-direction: column; gap: 8px; }
.filter-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 999px;
  background: #ddd;
  outline: none;
  cursor: pointer;
}
.filter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform .15s;
}
.filter-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.filter-slider-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px; color: #aaa; font-weight: 600;
}

/* Habitaciones y Baños pills — mismo estilo */
.hab-options {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px;
}
.hab-btn, .ban-btn, .hab-btn-m, .ban-btn-m {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform .18s ease;
}

.hab-btn:hover .filter-icon,
.ban-btn:hover .filter-icon,
.hab-btn-m:hover .filter-icon,
.ban-btn-m:hover .filter-icon {
  transform: scale(1.1);
}

.hab-btn:hover, .ban-btn:hover,
.hab-btn-m:hover, .ban-btn-m:hover {
  border-color: #111;
  color: #111;
}

.hab-btn.active, .ban-btn.active,
.hab-btn-m.active, .ban-btn-m.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.hab-btn.active .filter-icon,
.ban-btn.active .filter-icon,
.hab-btn-m.active .filter-icon,
.ban-btn-m.active .filter-icon {
  transform: scale(1.2);
}

/* Rango de precio */
.filter-price-inputs {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.filter-price-field {
  flex: 1; display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 10px 14px; background: #fff;
  transition: border-color .2s;
}
.filter-price-field:focus-within { border-color: #111; }
.filter-price-symbol { font-size: 13px; font-weight: 700; color: #999; }
.filter-price-input {
  border: none; outline: none; width: 100%;
  font-size: 14px; font-weight: 700; font-family: inherit; color: #111;
  background: transparent;
}
.filter-price-input::placeholder { color: #bbb; font-weight: 500; }
.filter-price-dash { font-size: 18px; color: #ccc; flex-shrink: 0; }
.filter-price-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-preset {
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: #fff;
  font-size: 12px; font-weight: 700; font-family: inherit;
  color: #555; cursor: pointer; transition: all .18s;
}
.filter-preset:hover { border-color: #111; color: #111; }
.filter-preset.active { background: #111; border-color: #111; color: #fff; }

/* Amenidades */
.filter-amenidades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.amenity-check {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0;
}

.amenity-check input {
  display: none;
}

.amenity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform .15s ease;
}

.amenity-check span:not(.amenity-icon) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  transition: all .18s;
  cursor: pointer;
  box-sizing: border-box;
}

.amenity-check input:checked ~ .amenity-icon {
  transform: scale(1.15);
}

.amenity-check input:checked ~ span:not(.amenity-icon) {
  border-color: #111;
  background: #f5f5f5;
  color: #111;
  font-weight: 700;
}

.amenity-check:hover span:not(.amenity-icon) {
  border-color: #999;
}

/* Toggle parqueadero */
.filter-toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.filter-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.filter-toggle-track {
  display: block;
  width: 48px; height: 28px;
  background: #ddd;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  position: relative;
}
.filter-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.filter-toggle input:checked + .filter-toggle-track { background: #111; }
.filter-toggle input:checked + .filter-toggle-track::after { transform: translateX(20px); }

/* Estado filter */
.filter-state-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-state-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-state-btn:hover {
  border-color: #111;
  color: #111;
}

.filter-state-btn.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* Select filter */
.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  transition: border-color .15s;
}

.filter-select:hover {
  border-color: #999;
}

.filter-select:focus {
  outline: none;
  border-color: #111;
}

.filter-select option {
  padding: 8px;
  background: #fff;
  color: #333;
}

/* Footer */
.filters-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--line-2);
  flex-shrink: 0;
  background: #fff;
}
.filters-modal-footer-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── SHARE SHEET ────────────────────────────────────────────── */
.share-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
}

.share-sheet {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  width: calc(100% - 32px);
  max-width: 420px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.12);
}
.share-title {
  margin: 0 0 16px;
  font-size: 13px; font-weight: 800;
  letter-spacing: -.02em; text-align: center; color: var(--muted-2);
}
.share-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.share-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 10px;
  border: 1.5px solid var(--line-2);
  border-radius: 16px;
  background: #fff;
  font-size: 10px; font-weight: 800; font-family: inherit;
  color: var(--muted-2); cursor: pointer;
  transition: all .2s;
}
.share-opt:hover { border-color: var(--black); color: var(--black); transform: translateY(-2px); }
.share-opt:active { transform: scale(.96); }

.share-close-btn {
  width: 100%; padding: 13px;
  border: none; border-radius: 14px;
  background: var(--bg);
  font-size: 12px; font-weight: 800; font-family: inherit;
  color: var(--muted-2); cursor: pointer;
  transition: background .2s, color .2s;
}
.share-close-btn:hover { background: var(--line-2); color: var(--black); }

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  z-index: 400;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── CLOSE HINT TOOLTIP ────────────────────────────────────── */
.close-hint-tooltip {
  position: fixed;
  z-index: 9998;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 13px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0,0,0,.28);
  animation: closeHintIn .35s cubic-bezier(.34,1.45,.64,1);
  display: flex;
  align-items: center;
  gap: 5px;
}
.close-hint-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #111827;
}
.close-hint-tooltip.hint-out {
  animation: closeHintOut .28s ease-out forwards;
}
@keyframes closeHintIn {
  from { opacity: 0; transform: translateY(6px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes closeHintOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(4px) scale(.96); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .properties-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

@media (max-width: 1399px) and (min-width: 1100px) {
  .properties-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}

@media (max-width: 1099px) and (min-width: 768px) {
  .main-content, .map-view { width: min(95vw, 1100px); }
  .properties-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .property-card.is-open .property-card-inner { height: var(--card-expanded-height-tablet); }
  .bar-divider:first-of-type { display: none; }
}

@media (max-width: 767px) {
  .main-content { width: 95vw; }
  .map-view { width: 100%; left: 0; right: 0; }
  .top-bar-inner { gap: 8px; }
  .bar-divider { display: none; }
  .location-filters { display: none; }
  .brand-sub { display: none; }
  .type-pills { gap: 3px; }
  .pill { padding: 5px 10px; font-size: 9px; }
  .search-input-wrap { border-left: none; padding-left: 0; }
  .properties-grid { grid-template-columns: 1fr; gap: 12px; }

  .property-card { position: relative; height: var(--card-collapsed-height); }
  .property-card-inner { position: relative; height: var(--card-collapsed-height); }

  .property-card.is-open { height: var(--card-expanded-height-mobile); }
  .property-card.is-open .property-card-inner {
    position: relative;
    height: var(--card-expanded-height-mobile);
  }

  .slider-arrow { opacity: 1; }

  /* ── Bottom Tab Bar en móvil (reemplaza el pill flotante) ── */
  .floating-bar {
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    transform: none !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0;
    padding: 10px 8px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    justify-content: space-around;
    box-shadow: 0 -1px 0 rgba(255,255,255,.08), 0 -8px 32px rgba(0,0,0,.3);
  }
  .float-icon {
    flex: 1;
    padding: 5px 4px;
    border-radius: 10px;
  }
  .float-icon svg { width: 20px; height: 20px; }

  /* Compensar el tab bar en la vista de grid */
  .app-shell { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* Espacio entre tarjeta expandida y la barra de navegación inferior */
  .property-card.is-open {
    margin-bottom: 16px;
  }

  /* Padding interno para que los botones Compartir/Contactar
     no queden pegados al borde inferior de la tarjeta */
  .property-card.is-open .property-details-scroll {
    padding-bottom: 20px;
  }

  .modal-content { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }

  .share-options { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 479px) {
  .top-bar-inner { height: 56px; }
  .app-shell { padding-top: var(--top-bar-h, 60px); }
  .brand-name { font-size: 13px; }
  /* floating-bar ya es full-width desde 767px — sin override aquí */
  .property-card.is-open, .property-card.is-open .property-card-inner { height: 740px; }

  /* Mantener el margen y padding también en pantallas muy pequeñas */
  .property-card.is-open {
    margin-bottom: 16px;
  }
  .property-card.is-open .property-details-scroll {
    padding-bottom: 20px;
  }
}

/* ─── ACTIVE FILTER TAGS BAR ──────────────────────────────── */
.active-filters-bar {
  position: fixed;
  top: var(--top-bar-h, 72px);
  left: 0; right: 0;
  z-index: 85;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
  padding: 6px clamp(16px, 2.5vw, 48px);
}
.active-filters-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid rgba(231,20,51,.2);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.filter-tag:hover { background: #ffd6db; }
.filter-tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(231,20,51,.15);
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.filter-tag-clear-all {
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 3px 6px;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.filter-tag-clear-all:hover { color: var(--brand); }

/* When active filters bar is visible, push grid down — height set via JS */
.app-shell.has-active-filters { padding-top: var(--filters-offset, 110px); }

/* Push map view down when active filters bar is visible — set via JS */
.app-shell.has-active-filters .map-view { top: var(--filters-offset, 110px); }

/* ─── SAVED SEARCHES ──────────────────────────────────────── */
.saved-searches-section { padding-bottom: 0 !important; }
.saved-searches-section .filter-divider { margin-top: 16px; }
.saved-search-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.saved-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  color: var(--text);
}
.saved-search-chip:hover { background: var(--brand-light); border-color: rgba(231,20,51,.3); color: var(--brand); }
.saved-search-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--line-2);
  border: none;
  cursor: pointer;
  font-size: 9px;
  flex-shrink: 0;
  padding: 0;
  color: var(--muted-2);
  transition: background .15s;
}
.saved-search-chip-del:hover { background: var(--red-bg); color: var(--red); }

/* ─── SAVE SEARCH BUTTON ─────────────────────────────────── */
.btn-save-search {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-save-search:hover { border-color: var(--brand); color: var(--brand); }
.save-search-inline {
  display: none;
  margin-top: 10px;
  gap: 8px;
  align-items: center;
}
.save-search-inline.is-open { display: flex; }
.save-search-input {
  flex: 1;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.save-search-input:focus { border-color: var(--brand); }
.save-search-confirm {
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  animation: lbFadeIn .18s ease;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Close */
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 10;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* Counter */
.lightbox-counter {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.75);
  font-size: 13px; font-weight: 600;
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 10;
}

/* Arrows */
.lightbox-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.25); }
.lightbox-arrow:active { transform: translateY(-50%) scale(.92); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* Image wrap */
.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 64px 80px 48px;
  overflow: hidden;
  position: relative;
}

/* Spinner animation */
@keyframes lbSpinnerRotate {
  to { transform: rotate(360deg); }
}

/* Spinner en lightbox */
.lightbox-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-spinner .spinner-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: lbSpinnerRotate 0.8s linear infinite;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  transition: transform .25s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-img.is-zoomed {
  cursor: grab;
  transition: none; /* pan sin lag */
}
.lightbox-img.is-zoomed.is-dragging { cursor: grabbing; }

/* Hint */
.lightbox-hint {
  position: absolute;
  bottom: 58px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.38);
  font-size: 11px;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  pointer-events: none;
}

/* Miniaturas */
.lightbox-thumbs {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}
.lightbox-thumbs::-webkit-scrollbar { display: none; }
.lightbox-thumb {
  width: 44px; height: 32px;
  border-radius: 5px;
  object-fit: cover;
  cursor: pointer;
  opacity: .45;
  border: 2px solid transparent;
  transition: opacity .15s, border-color .15s;
  flex-shrink: 0;
}
.lightbox-thumb.is-active {
  opacity: 1;
  border-color: #fff;
}

@media (max-width: 600px) {
  .lightbox-img-wrap { padding: 56px 14px 80px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-arrow { width: 40px; height: 40px; }
  .lightbox-hint { display: none; }
  .lightbox-spinner .spinner-circle { width: 32px; height: 32px; border-width: 2px; }
}

/* ═══ INTEGRACIONES PANEL ═══════════════════════════════════════ */
.integ-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 1100; display: flex; justify-content: flex-end;
}
.integ-panel {
  width: 520px; max-width: 100vw; height: 100%;
  background: #fff; display: flex; flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  animation: slideInRight .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.integ-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
  background: #fff;
}
.integ-header-left { display: flex; align-items: center; gap: 10px; }
.integ-header-left h2 { font-size: .95rem; font-weight: 700; margin: 0; color: #111; }
.integ-tabs {
  display: flex; gap: 2px; padding: 10px 16px 0;
  border-bottom: 1px solid #f0f0f0; flex-shrink: 0; overflow-x: auto;
  scrollbar-width: none;
}
.integ-tabs::-webkit-scrollbar { display: none; }
.integ-tab {
  background: none; border: none; padding: 8px 14px; border-radius: 8px 8px 0 0;
  font-size: .8rem; font-weight: 500; color: #666; cursor: pointer;
  transition: all .15s; white-space: nowrap; border-bottom: 2px solid transparent;
}
.integ-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: rgba(220,53,69,.06); }
.integ-tab-content { display: none; flex: 1; overflow-y: auto; padding: 20px; }
.integ-tab-content.active { display: block; }
.integ-section-desc { font-size: .82rem; color: #666; margin: 0 0 16px; line-height: 1.5; }
.integ-row { display: flex; gap: 8px; margin-bottom: 12px; }
.integ-field-group { margin-bottom: 16px; }
.integ-label { display: block; font-size: .75rem; font-weight: 600; color: #444; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.integ-optional { font-weight: 400; text-transform: none; color: #888; font-size: .72rem; }
.integ-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: .85rem; color: #111; background: #fafafa; transition: border-color .15s;
  box-sizing: border-box;
}
.integ-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.integ-textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: .82rem; color: #111; background: #fafafa; resize: vertical;
  font-family: inherit; transition: border-color .15s; box-sizing: border-box; min-height: 80px;
}
.integ-textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.integ-btn-primary {
  background: var(--brand); color: #fff; border: none; padding: 9px 18px;
  border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: background .15s; white-space: nowrap; flex-shrink: 0;
}
.integ-btn-primary:hover { background: #b52030; }
.integ-btn-secondary {
  background: #f4f4f4; color: #333; border: 1.5px solid #e0e0e0; padding: 8px 16px;
  border-radius: 8px; font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s;
}
.integ-btn-secondary:hover { background: #eaeaea; }
.integ-actions-row { display: flex; gap: 8px; margin-top: 4px; }
.integ-status-msg { margin-top: 10px; font-size: .8rem; padding: 8px 12px; border-radius: 6px; display: none; }
.integ-status-msg.ok { background: #eafaf1; color: #1a7a4c; display: block; }
.integ-status-msg.err { background: #fdf0f0; color: #c0392b; display: block; }
.integ-new-key-box {
  background: #fffbea; border: 1.5px solid #f0c040; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.integ-new-key-label { font-size: .78rem; font-weight: 600; color: #7a5200; margin: 0 0 8px; }
.integ-key-copy-row { display: flex; gap: 8px; align-items: center; }
.integ-key-code {
  flex: 1; font-family: monospace; font-size: .75rem; background: #fff;
  border: 1px solid #e8d48a; border-radius: 6px; padding: 6px 10px;
  word-break: break-all; color: #333;
}
.integ-copy-btn {
  background: #f0c040; color: #7a5200; border: none; padding: 6px 12px;
  border-radius: 6px; font-size: .75rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.integ-copy-btn:hover { background: #e0b030; }
.integ-keys-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.integ-key-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f8f8f8; border: 1px solid #ececec; border-radius: 8px; padding: 10px 14px;
}
.integ-key-item-left { min-width: 0; }
.integ-key-item-name { font-size: .82rem; font-weight: 600; color: #111; }
.integ-key-item-meta { font-size: .73rem; color: #888; font-family: monospace; margin-top: 2px; }
.integ-key-del {
  background: none; border: none; color: #c0392b; cursor: pointer;
  padding: 4px 6px; border-radius: 6px; transition: background .15s; flex-shrink: 0;
}
.integ-key-del:hover { background: rgba(192,57,43,.1); }
.integ-api-docs { margin-top: 4px; }
.integ-code-block {
  display: block; font-family: monospace; font-size: .75rem; background: #f4f4f4;
  border: 1px solid #e0e0e0; border-radius: 6px; padding: 6px 10px; color: #333;
  margin-bottom: 4px; word-break: break-all;
}
.integ-checks { display: flex; flex-direction: column; gap: 8px; }
.integ-check { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: #333; cursor: pointer; }
.integ-check input { accent-color: var(--brand); width: 15px; height: 15px; }
.integ-service-card {
  border: 1.5px solid #e8e8e8; border-radius: 12px; padding: 16px;
  margin-bottom: 12px; background: #fafafa;
}
.integ-service-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.integ-service-logo {
  width: 40px; height: 40px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.integ-logo-anthropic { background: linear-gradient(135deg, #d4a96a, #a0522d); color: #fff; }
.integ-service-desc { display: block; font-size: .75rem; color: #888; margin-top: 2px; }
.integ-link { font-size: .78rem; color: var(--brand); text-decoration: none; }
.integ-link:hover { text-decoration: underline; }
.integ-toggle-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.integ-toggle-row .integ-label { margin: 0; flex-shrink: 0; }
.integ-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.integ-toggle input { opacity: 0; width: 0; height: 0; }
.integ-toggle-slider {
  position: absolute; inset: 0; background: #ccc; border-radius: 24px;
  transition: background .2s; cursor: pointer;
}
.integ-toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.integ-toggle input:checked + .integ-toggle-slider { background: var(--brand); }
.integ-toggle input:checked + .integ-toggle-slider::before { transform: translateX(18px); }
.integ-toggle-label { font-size: .8rem; color: #555; }

/* ═══ CHAT IA WIDGET ════════════════════════════════════════════ */
.chat-widget { position: fixed; bottom: 80px; right: 20px; z-index: 900; }
.chat-fab {
  width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(220,53,69,.4); transition: transform .2s, box-shadow .2s;
  position: relative;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(220,53,69,.5); }
.chat-fab-badge {
  position: absolute; top: -4px; right: -4px; background: #25d366; color: #fff;
  border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.chat-box {
  position: absolute; bottom: 64px; right: 0; width: 320px;
  background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
  flex-direction: column; overflow: hidden;
  animation: slideUpModal .25s cubic-bezier(.4,0,.2,1);
}
.chat-box-header {
  background: var(--brand); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.chat-box-title { display: flex; align-items: center; gap: 10px; }
.chat-bot-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700;
}
.chat-box-title strong { font-size: .85rem; display: block; }
.chat-online-dot {
  display: inline-block; width: 7px; height: 7px; background: #6dff9a;
  border-radius: 50%; margin-left: 4px; vertical-align: middle;
}
.chat-box-close {
  background: none; border: none; color: rgba(255,255,255,.8);
  cursor: pointer; padding: 4px; border-radius: 6px;
}
.chat-box-close:hover { color: #fff; background: rgba(255,255,255,.15); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px; max-height: 340px;
}
.chat-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: .82rem; line-height: 1.45; }
.chat-msg.bot  { background: #f0f0f0; color: #111; align-self: flex-start; border-radius: 4px 12px 12px 12px; }
.chat-msg.user { background: var(--brand); color: #fff; align-self: flex-end; border-radius: 12px 12px 4px 12px; }
.chat-msg.typing { background: #f0f0f0; color: #888; align-self: flex-start; border-radius: 4px 12px 12px 12px; font-style: italic; }
.chat-input-row { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid #f0f0f0; background: #fff; }
.chat-input {
  flex: 1; border: 1.5px solid #e0e0e0; border-radius: 20px; padding: 7px 14px;
  font-size: .82rem; outline: none; transition: border-color .15s; background: #fafafa;
}
.chat-input:focus { border-color: var(--brand); background: #fff; }
.chat-send-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.chat-send-btn:hover { background: #b52030; }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed; }
@media (max-width: 480px) {
  .chat-widget { bottom: 70px; right: 12px; }
  .chat-box { width: calc(100vw - 32px); right: -8px; }
  .integ-panel { width: 100vw; }
}

/* ═══════════════════════════════════════════════════════════════
   PANEL DE RESEÑAS
   ═══════════════════════════════════════════════════════════════ */
.reviews-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 3999; backdrop-filter: blur(2px);
}
.reviews-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff; z-index: 4000;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  overflow: hidden;
  animation: reviewsSlideIn .28s cubic-bezier(.4,0,.2,1);
}
@keyframes reviewsSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.reviews-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid #f0f0f0;
  background: #fff; flex-shrink: 0;
}
.reviews-panel-title {
  font-size: 1.05rem; font-weight: 700; color: #1a1a1a;
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.reviews-panel-close {
  background: none; border: none; cursor: pointer;
  color: #666; padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: background .15s;
}
.reviews-panel-close:hover { background: #f0f0f0; color: #111; }

/* ── Stats ── */
.reviews-stats {
  padding: 18px 20px 14px; border-bottom: 1px solid #f0f0f0;
  display: flex; gap: 20px; align-items: center; flex-shrink: 0;
}
.reviews-avg-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; min-width: 90px;
  background: linear-gradient(135deg, #fff9f0 0%, #fffbf5 100%);
  padding: 16px 12px; border-radius: 12px;
  border: 1px solid #ffe8cc;
  box-shadow: 0 2px 8px rgba(251, 188, 4, 0.1);
}
.reviews-avg-num {
  font-size: 2.8rem; font-weight: 900;
  background: linear-gradient(135deg, #fbbc04 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.reviews-avg-stars {
  display: flex; gap: 3px;
  font-size: 18px;
}
.reviews-avg-star { color: #fbbc04; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.reviews-avg-star.empty { color: #ffe8cc; }
.reviews-avg-total {
  font-size: 0.7rem; color: #999; text-align: center;
  font-weight: 500; letter-spacing: 0.3px;
}

.reviews-dist { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.reviews-dist-row {
  display: flex; align-items: center; gap: 8px; font-size: .78rem;
}
.reviews-dist-label { color: #555; width: 20px; text-align: right; }
.reviews-dist-bar-wrap {
  flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden;
}
.reviews-dist-bar {
  height: 100%; background: #fbbc04; border-radius: 4px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.reviews-dist-count { color: #888; width: 22px; }

/* ── Write section ── */
.reviews-write-section {
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
}
.reviews-cta-text { font-size: .88rem; color: #555; margin: 0 0 10px; }
.reviews-google-btn {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid #dadce0; border-radius: 8px;
  padding: 10px 18px; font-size: .9rem; font-weight: 600; color: #3c4043;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
  width: 100%;
}
.reviews-google-btn:hover {
  box-shadow: 0 1px 8px rgba(0,0,0,.12); border-color: #bbb;
}
.reviews-user-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.reviews-user-photo {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid #eee;
}
.reviews-user-name { font-size: .9rem; font-weight: 600; color: #1a1a1a; display: block; }
.reviews-sign-out-btn {
  background: none; border: none; color: #1a73e8; font-size: .78rem;
  cursor: pointer; padding: 0; text-decoration: underline;
}

/* Star picker */
.reviews-star-picker { display: flex; gap: 4px; margin-bottom: 12px; }
.rsp-star {
  background: none; border: none; font-size: 2rem; color: #ddd;
  cursor: pointer; padding: 0; line-height: 1;
  transition: color .1s, transform .1s;
}
.rsp-star.active, .rsp-star:hover { color: #fbbc04; transform: scale(1.15); }

.reviews-textarea {
  width: 100%; border: 1.5px solid #e0e0e0; border-radius: 8px;
  padding: 10px 12px; font-size: .88rem; color: #222; resize: vertical;
  font-family: inherit; box-sizing: border-box;
  transition: border-color .15s;
}
.reviews-textarea:focus { outline: none; border-color: #1a73e8; }

.reviews-emoji-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.reviews-emoji-label {
  font-size: .72rem;
  color: #9ca3af;
  margin-right: 2px;
  white-space: nowrap;
}
.emoji-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: background .15s, transform .1s;
}
.emoji-btn:hover { background: #f3f4f6; transform: scale(1.2); }
.emoji-btn:active { transform: scale(.95); }

.reviews-form-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 10px;
}
.reviews-form-msg { font-size: .8rem; color: #e53935; flex: 1; }
.reviews-form-msg.ok { color: #1e7e34; }
.reviews-submit-btn {
  background: #1a73e8; color: #fff; border: none; border-radius: 8px;
  padding: 9px 20px; font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.reviews-submit-btn:disabled { background: #b0c4f5; cursor: not-allowed; }
.reviews-submit-btn:not(:disabled):hover { background: #1557b0; }

/* ── Reviews list ── */
.reviews-list {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.reviews-loading { color: #888; font-size: .88rem; text-align: center; padding: 24px 0; }
.reviews-empty { color: #888; font-size: .88rem; text-align: center; padding: 24px 0; }
.review-card { display: flex; flex-direction: column; gap: 6px; }
.review-card-header {
  display: flex; align-items: center; gap: 10px;
}
.review-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid #eee; flex-shrink: 0; background: #f0f0f0;
}
.review-avatar-initials {
  width: 36px; height: 36px; border-radius: 50%; background: #e8f0fe;
  color: #1a73e8; font-size: .85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.review-meta { flex: 1; }
.review-name { font-size: .88rem; font-weight: 600; color: #1a1a1a; }
.review-date { font-size: .75rem; color: #999; }
.review-stars { display: flex; gap: 2px; }
.review-star { font-size: 13px; color: #fbbc04; }
.review-star.empty { color: #ddd; }
.review-comment { font-size: .85rem; color: #444; line-height: 1.55; }
.review-del-btn {
  background: none; border: none; color: #bbb; cursor: pointer;
  font-size: .75rem; padding: 2px 6px; border-radius: 4px;
  transition: color .15s;
}
.review-del-btn:hover { color: #e53935; }
.reviews-divider { border: none; border-top: 1px solid #f0f0f0; margin: 0; flex-shrink: 0; }

/* ─────────────────────────── REPLY SYSTEM ───────────────────────────── */

.review-reply-section {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: 8px;
}

.review-reply-section.review-reply-empty {
  align-items: center; justify-content: center;
  padding: 12px 0;
}

.reply-btn {
  background: #E71433; color: white;
  border: none; border-radius: 6px;
  padding: 8px 16px; font-size: .85rem;
  font-weight: 500; cursor: pointer;
  transition: background .15s;
}

.reply-btn:hover { background: #c0102a; }

.reply-header {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: #10b981; font-weight: 600;
}

.reply-content {
  background: #f0fdf4; padding: 10px 12px;
  border-radius: 6px; font-size: .85rem;
  color: #166534; line-height: 1.5;
  border-left: 3px solid #10b981;
}

.reply-footer {
  display: flex; justify-content: space-between;
  align-items: center; font-size: .75rem;
  color: #888; gap: 8px;
}

.reply-date { color: #888; }

.reply-actions {
  display: flex; gap: 8px;
}

.reply-edit-btn, .reply-del-btn {
  background: none; border: none;
  color: #0084ff; font-size: .75rem;
  cursor: pointer; transition: color .15s;
  padding: 2px 4px;
}

.reply-edit-btn:hover { color: #0073e6; }

.reply-del-btn {
  color: #e53935;
}

.reply-del-btn:hover { color: #d32f2f; }

/* ─────────────────────────── REPLY MODAL ───────────────────────────── */

#replyModal {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
}

.reply-modal-content {
  background: white; border-radius: 12px;
  width: 90%; max-width: 500px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
}

.reply-modal-header {
  display: flex; justify-content: space-between;
  align-items: center; padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.reply-modal-header h3 {
  margin: 0; font-size: 1.1rem;
  color: #111; font-weight: 600;
}

.reply-modal-close {
  background: none; border: none;
  font-size: 24px; color: #ccc;
  cursor: pointer; transition: color .15s;
  padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}

.reply-modal-close:hover { color: #333; }

.reply-modal-body {
  padding: 20px; display: flex;
  flex-direction: column; gap: 8px;
}

.reply-textarea {
  width: 100%; border: 1px solid #d1d5db;
  border-radius: 8px; padding: 10px;
  font-family: "Inter", sans-serif;
  font-size: .9rem; color: #111;
  resize: vertical; min-height: 120px;
  transition: border-color .15s;
}

.reply-textarea:focus {
  outline: none; border-color: #E71433;
  box-shadow: 0 0 0 2px rgba(231,20,51,.1);
}

.reply-char-count {
  font-size: .75rem; color: #888;
  text-align: right;
}

.reply-modal-footer {
  display: flex; gap: 10px;
  padding: 16px 20px; border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.reply-modal-cancel {
  background: #f3f4f6; border: none;
  color: #111; padding: 10px 20px;
  border-radius: 6px; font-size: .9rem;
  font-weight: 500; cursor: pointer;
  transition: background .15s;
}

.reply-modal-cancel:hover { background: #e5e7eb; }

.reply-modal-submit {
  background: #E71433; border: none;
  color: white; padding: 10px 20px;
  border-radius: 6px; font-size: .9rem;
  font-weight: 500; cursor: pointer;
  transition: background .15s;
}

.reply-modal-submit:hover { background: #c0102a; }

/* Badge de calificación en floating bar */
#reviewsRatingBadge {
  background: transparent !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
  font-size: .62rem !important;
  box-shadow: none !important;
}
