/* =========================================================================
   Portal Provincial · Template base
   Mobile-first · Theming via CSS custom properties (inyectadas por config.js)
   ========================================================================= */

:root {
  --color-primary:      #0c74bb;
  --color-primary-700:  #075e99;
  --color-primary-900:  #0a3a5e;
  --color-secondary:    #f59e0b;
  --color-secondary-700:#d97706;
  --color-accent:       #0ea5e9;

  --color-bg:      #f5f7fa;
  --color-card:    #ffffff;
  --color-text:    #1e293b;
  --color-muted:   #64748b;
  --color-muted-2: #94a3b8;
  --color-border:  #e2e8f0;

  --color-venta:    var(--color-primary);
  --color-alquiler: var(--color-secondary);
  --color-temp:     #7c3aed;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
  --shadow-md: 0 4px 14px rgba(15,23,42,0.10);
  --shadow-lg: 0 10px 30px rgba(15,23,42,0.12);
  --shadow-xl: 0 22px 44px rgba(15,23,42,0.16);

  --radius:     14px;
  --radius-sm:  10px;
  --radius-xs:  8px;

  --transition: all 0.18s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

  --navbar-h: 64px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* El atributo `hidden` gana siempre. Sin esto, cualquier clase que fije
   `display` lo pisa (el UA style es menos específico) y el elemento sigue
   visible aunque el JS lo haya ocultado. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body.app-fixed .navbar { flex-shrink: 0; position: relative; }
body.app-fixed .app-shell { flex: 1; min-height: 0; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

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

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 1024px) { .container { padding: 0 24px; } }

.scroll-y { overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 8px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,0.25);
  border-radius: 8px;
}
.scroll-y::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.45); }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 8px rgba(15,23,42,0.04);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 12px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.navbar-brand img {
  height: 40px;
  width: auto;
  border-radius: 6px;
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.navbar-brand-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.navbar-brand-text span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.navbar-menu {
  display: none;
  list-style: none;
  gap: 2px;
  align-items: center;
}

.navbar-menu a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.navbar-menu a:hover {
  background: rgba(12,116,187,0.08);
  color: var(--color-primary);
}

.navbar-menu a.active {
  color: var(--color-primary);
  background: rgba(12,116,187,0.1);
}

.navbar-cta {
  display: none;
  padding: 7px 14px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.navbar-cta:hover {
  background: var(--color-primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.navbar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(12,116,187,0.08);
  color: var(--color-primary);
  border-radius: var(--radius-xs);
  font-size: 18px;
}

@media (min-width: 1024px) {
  .navbar-menu { display: flex; }
  .navbar-toggle { display: none; }
  .navbar-cta { display: inline-flex; }
  .navbar-brand img { height: 44px; }
  .navbar-brand-text strong { font-size: 14px; max-width: none; }
}

/* ---------- Menú móvil ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255,255,255,0.99);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
}

.mobile-menu.open { display: flex; }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu-header strong { font-size: 15px; font-weight: 600; }

.mobile-menu-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(15,23,42,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-muted);
}

.mobile-menu-list {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  list-style: none;
}

.mobile-menu-list a {
  padding: 14px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  color: var(--color-text);
}

.mobile-menu-footer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

/* ---------- Hero (Home) ---------- */
.hero {
  position: relative;
  padding: 56px 0 48px;
  background:
    linear-gradient(135deg, rgba(10,58,94,0.90) 0%, rgba(12,116,187,0.80) 100%),
    radial-gradient(circle at top right, rgba(245,158,11,0.25), transparent 60%),
    #0a3a5e;
  color: #fff;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
}

.hero-kicker::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--color-secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.3);
}

.hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero h1 em {
  font-style: normal;
  color: var(--color-secondary);
}

.hero-lead {
  font-size: 15px;
  color: rgba(255,255,255,0.82);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.55;
}

@media (min-width: 768px) {
  .hero { padding: 88px 0 72px; }
  .hero h1 { font-size: 44px; }
  .hero-lead { font-size: 17px; margin-bottom: 36px; }
}
@media (min-width: 1024px) {
  .hero { padding: 110px 0 90px; }
  .hero h1 { font-size: 52px; }
}

/* ---------- Buscador hero ---------- */
.hero-search {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-xl);
  max-width: 780px;
  margin: 0 auto;
  text-align: left;
}

.hero-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-tabs button {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  border-radius: 999px;
  transition: var(--transition);
}

.hero-tabs button.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.hero-search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hero-search-grid .field { display: flex; flex-direction: column; gap: 4px; }

.hero-search-grid label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.hero-search-grid select,
.hero-search-grid input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--color-text);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  transition: var(--transition);
}

.hero-search-grid select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  cursor: pointer;
}

.hero-search-grid select:focus,
.hero-search-grid input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12,116,187,0.12);
}

.hero-search-cta {
  margin-top: 10px;
  width: 100%;
  padding: 13px;
  background: var(--color-secondary);
  color: #fff;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(245,158,11,0.35);
}

.hero-search-cta:hover {
  background: var(--color-secondary-700);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(245,158,11,0.45);
}

@media (min-width: 720px) {
  .hero-search { padding: 20px; }
  .hero-search-grid {
    grid-template-columns: 1fr 1fr 2fr auto;
    align-items: end;
    gap: 12px;
  }
  .hero-search-cta { margin-top: 0; width: auto; padding: 13px 28px; white-space: nowrap; }
}

/* ---------- Hero stats chips (debajo del search) ---------- */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(6px);
  transition: var(--transition);
}

.hero-chip:hover {
  background: rgba(255,255,255,0.2);
}

.hero-chip strong { font-weight: 700; color: var(--color-secondary); }

/* ---------- Botones comunes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-700); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-secondary { background: var(--color-secondary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--color-secondary-700); box-shadow: var(--shadow-md); }

.btn-outline { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-ghost { background: transparent; color: var(--color-muted); }
.btn-ghost:hover { color: var(--color-primary); background: rgba(12,116,187,0.08); }

.btn-whatsapp { background: #22c55e; color: #fff; }
.btn-whatsapp:hover { background: #16a34a; }

.btn-block { width: 100%; }

/* ---------- Secciones del home ---------- */
.section {
  padding: 48px 0;
}

@media (min-width: 1024px) { .section { padding: 72px 0; } }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary-900);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.section-header h2 em {
  font-style: normal;
  color: var(--color-secondary);
}

.section-header p {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 4px;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.section-link:hover { color: var(--color-primary-700); }
.section-link::after { content: '→'; transition: transform 0.2s ease; }
.section-link:hover::after { transform: translateX(3px); }

@media (min-width: 768px) {
  .section-header h2 { font-size: 28px; }
}

/* ---------- Carrusel de destacadas ---------- */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 14px;
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,0.25);
  border-radius: 999px;
}

.carousel-track > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 78%;
  max-width: 280px;
}

@media (min-width: 640px) { .carousel-track > * { width: 42%; } }
@media (min-width: 1024px) { .carousel-track > * { width: 24%; } }

.carousel-nav {
  position: absolute;
  top: calc(50% - 14px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
  z-index: 2;
  transition: var(--transition);
  transform: translateY(-50%);
}

.carousel-nav:hover { background: var(--color-primary); color: #fff; }
.carousel-nav.prev { left: -14px; }
.carousel-nav.next { right: -14px; }
.carousel-nav[disabled] { opacity: 0.3; pointer-events: none; }

@media (min-width: 1024px) { .carousel-nav { display: flex; } }

/* ---------- Property card (grid / carrusel) ---------- */
.property-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.property-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.property-card .card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--color-border);
}

.property-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.property-card:hover .card-img img { transform: scale(1.05); }

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-venta { background: var(--color-venta); color: #fff; }
.badge-alquiler { background: var(--color-alquiler); color: #fff; }
.badge-temp { background: var(--color-temp); color: #fff; }

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-loc {
  font-size: 12px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.card-specs {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.card-specs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.card-inmo {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.card-inmo img,
.inmo-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-border);
  border: 1.5px solid #fff;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.inmo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
}

.card-inmo .inmo-name {
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Zonas populares (chips grandes) ---------- */
.zonas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) { .zonas { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .zonas { grid-template-columns: repeat(6, 1fr); } }

.zona {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 14px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  transition: var(--transition);
  cursor: pointer;
}

.zona::before {
  content: '📍';
  filter: saturate(1.3);
}

.zona:hover {
  border-color: var(--color-primary);
  background: rgba(12,116,187,0.05);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Stats ---------- */
.stats {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-700) 100%);
  color: #fff;
  padding: 40px 0;
  position: relative;
  overflow: hidden;
}

.stats::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 70%; height: 200%;
  background: radial-gradient(rgba(245,158,11,0.18), transparent 60%);
  pointer-events: none;
}

.stats-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}

@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-item h3 {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-item h3 em {
  font-style: normal;
  color: var(--color-secondary);
}

.stat-item p {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .stat-item h3 { font-size: 44px; }
}

/* ---------- CTA banner inmobiliarias ---------- */
.cta-banner {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(12,116,187,0.08), transparent 65%);
  pointer-events: none;
}

.cta-banner h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-900);
  position: relative;
}

.cta-banner p {
  font-size: 14px;
  color: var(--color-muted);
  max-width: 520px;
  line-height: 1.55;
  position: relative;
}

.cta-banner .btn { position: relative; }

@media (min-width: 768px) {
  .cta-banner { flex-direction: row; text-align: left; padding: 36px 40px; gap: 28px; }
  .cta-banner > div { flex: 1; }
  .cta-banner h3 { font-size: 22px; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-primary-900);
  color: rgba(255,255,255,0.72);
  padding: 40px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer h4 {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.footer p { font-size: 13px; line-height: 1.6; }

.footer ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer ul a { font-size: 13px; color: rgba(255,255,255,0.6); transition: var(--transition); }
.footer ul a:hover { color: #fff; }

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

.footer-bottom p { font-size: 11px; color: rgba(255,255,255,0.45); }

.footer-social {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.footer-social a {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
  font-size: 13px;
}

.footer-social a:hover {
  background: var(--color-secondary);
  color: #fff;
}

/* =========================================================================
   VISTA LISTADO (grilla con filtros)
   ========================================================================= */

.listing-layout {
  padding: 24px 0 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .listing-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
    padding: 28px 0 60px;
  }
}

.listing-sidebar {
  display: none;
  position: sticky;
  top: calc(var(--navbar-h) + 16px);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  max-height: calc(100vh - var(--navbar-h) - 32px);
  overflow-y: auto;
}

@media (min-width: 1024px) { .listing-sidebar { display: block; } }

.listing-sidebar h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.filter-group {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.filter-group:last-of-type { border-bottom: none; margin-bottom: 10px; }

.listing-main { min-width: 0; }

.listing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.listing-topbar .count { font-size: 13px; color: var(--color-muted); }
.listing-topbar .count strong { color: var(--color-text); font-weight: 700; }

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn-show-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

@media (min-width: 1024px) { .btn-show-filters { display: none; } }

.btn-show-filters:hover { border-color: var(--color-primary); color: var(--color-primary); }

.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) { .listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .listing-grid { grid-template-columns: repeat(3, 1fr); } }

/* =========================================================================
   VISTA MAPA
   ========================================================================= */

.map-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.map-container {
  flex: 1;
  position: relative;
  min-width: 0;
  background: #dbeafe;
}

#map { width: 100%; height: 100%; }

.map-results-chip {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-results-chip.loading { background: var(--color-muted); }

/* --- Sidebar cards en mapa --- */
.map-sidebar {
  display: none;
  width: 380px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--color-border);
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
}

@media (min-width: 1200px) { .map-sidebar { display: flex; } }

.map-sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-sidebar-header strong {
  font-size: 13px;
  font-weight: 700;
}

.sort-select {
  padding: 5px 24px 5px 10px;
  font-size: 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
  cursor: pointer;
}

.map-sidebar-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card mini (sidebar + sheet) */
.card-mini {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.card-mini:hover,
.card-mini.highlighted {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-mini-img {
  width: 110px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border);
}

.card-mini-img img { width: 100%; height: 100%; object-fit: cover; }

.card-mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-mini-info .loc {
  font-size: 11px;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-mini-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-mini-info .price {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: auto;
}

.card-mini-info .inmo {
  font-size: 10px;
  color: var(--color-muted-2);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-mini-info .inmo img,
.card-mini-info .inmo .inmo-avatar {
  width: 14px; height: 14px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 7px;
}

/* --- Bottom sheet móvil (mapa) --- */
.mobile-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 28px rgba(15,23,42,0.18);
  z-index: 5;
  transform: translateY(calc(100% - 104px - env(safe-area-inset-bottom, 0px)));
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.12, 1);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 1200px) { .mobile-sheet { display: none; } }

.mobile-sheet.open { transform: translateY(0); }

.mobile-sheet-handle {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 16px;
  border: none;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-700) 100%);
  color: #fff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 -2px 10px rgba(12,116,187,0.25);
}

.mobile-sheet-grip {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 5px;
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
}

.mobile-sheet-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mobile-sheet-cta .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  font-size: 16px;
  font-weight: 700;
  transition: transform 0.28s ease;
}

.mobile-sheet.open .mobile-sheet-cta .arrow { transform: rotate(180deg); }

.mobile-sheet-handle strong { font-size: 14px; font-weight: 700; color: #fff; }
.mobile-sheet-handle .count { font-size: 11px; color: rgba(255,255,255,0.78); }

.mobile-sheet-cta .labels { display: flex; flex-direction: column; line-height: 1.15; }

.mobile-sheet-body {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* --- InfoWindow --- */
.gm-style .gm-style-iw-c { border-radius: 14px !important; padding: 0 !important; box-shadow: 0 10px 30px rgba(15,23,42,0.2) !important; }
.gm-style .gm-style-iw-d { overflow: hidden !important; padding: 0 !important; max-height: none !important; }
.gm-style .gm-style-iw-tc::after { display: none; }

.iw-card { width: 260px; font-family: var(--font); }
.iw-card img { width: 100%; height: 150px; object-fit: cover; }
.iw-card-body { padding: 10px 12px 12px; }
.iw-card-body .badge { font-size: 10px; padding: 2px 8px; margin-bottom: 6px; display: inline-block; }
.iw-card-body h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; color: var(--color-text); }
.iw-card-body .loc { font-size: 11px; color: var(--color-muted); margin-bottom: 8px; }
.iw-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.iw-price { font-size: 16px; font-weight: 800; color: var(--color-primary); }
.iw-btn {
  padding: 6px 12px;
  background: var(--color-secondary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* =========================================================================
   MODAL, FORMS, PAGINACIÓN, SKELETON, LOADER
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 768px) { .modal-backdrop { align-items: center; } }

.modal-backdrop.open { display: flex; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) { .modal { border-radius: 18px; } }

.modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-header p { font-size: 12px; color: var(--color-muted); margin-top: 2px; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) { .field-grid { grid-template-columns: 1fr 1fr; } }

.field > label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--color-text);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12,116,187,0.12);
}

/* --- Paginación --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.pagination button,
.pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  transition: var(--transition);
}

.pagination button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination button.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination button[disabled] { opacity: 0.4; cursor: not-allowed; }
.pagination .dots { border: 0; color: var(--color-muted-2); }

/* --- Skeleton --- */
.card-mini-skel {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.skel-box {
  background: linear-gradient(90deg, #eef2f6 0%, #dbe3ec 50%, #eef2f6 100%);
  background-size: 200% 100%;
  animation: rf-shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}

.card-mini-skel .skel-img { width: 110px; height: 90px; flex-shrink: 0; }
.card-mini-skel .skel-info { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }

.property-card-skel {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.property-card-skel .skel-img { aspect-ratio: 16/10; }
.property-card-skel .skel-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }

@keyframes rf-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(12,116,187,0.25);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loader-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--color-muted);
  gap: 8px;
  font-size: 13px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.list-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 16px;
  color: var(--color-muted);
  font-size: 14px;
}
.list-empty i { font-size: 32px; margin-bottom: 10px; display: block; font-style: normal; }

/* =========================================================================
   FICHA DE PROPIEDAD
   ========================================================================= */

.detail-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.detail-breadcrumb a { color: var(--color-muted); }
.detail-breadcrumb a:hover { color: var(--color-primary); }
.detail-breadcrumb .sep { margin: 0 6px; color: var(--color-muted-2); }
.detail-breadcrumb .code {
  padding: 3px 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
}

.detail-hero {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) { .detail-hero { grid-template-columns: 2fr 1fr; } }

.gallery {
  position: relative;
  background: #0a3a5e;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.gallery-main {
  aspect-ratio: 4/3;
  max-height: 300px;
  overflow: hidden;
  position: relative;
  background: var(--color-border);
}

@media (min-width: 640px) {
  .gallery-main { aspect-ratio: 16/10; max-height: 380px; }
}

@media (min-width: 1024px) {
  .gallery-main { aspect-ratio: auto; height: 460px; max-height: 460px; }
}

.gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.gallery-nav:hover { background: rgba(0,0,0,0.75); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.gallery-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(10,58,94,0.9);
  overflow-x: auto;
}

.gallery-thumb {
  width: 80px; height: 54px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-thumb.active { border-color: #fff; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-summary {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
  .detail-summary { border-top: 0; border-left: 1px solid var(--color-border); }
}

.detail-summary h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary-900);
}

@media (min-width: 640px) { .detail-summary h1 { font-size: 22px; } }

.detail-loc { font-size: 13px; color: var(--color-muted); }

.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 5px 10px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-text);
}

.detail-price-block {
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.detail-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.detail-price-sub { font-size: 12px; color: var(--color-muted); margin-top: 2px; }

.detail-inmo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
}

.detail-inmo-card img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
}
.detail-inmo-card .info { flex: 1; min-width: 0; }
.detail-inmo-card strong { font-size: 13px; font-weight: 600; display: block; color: var(--color-text); }
.detail-inmo-card span { font-size: 11px; color: var(--color-muted); }

.detail-cta-row { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 480px) { .detail-cta-row { flex-direction: row; } .detail-cta-row .btn { flex: 1; } }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 1024px) {
  .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

.detail-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.detail-card h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-900);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-card p { font-size: 14px; line-height: 1.65; color: var(--color-text); }

.detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}

@media (min-width: 640px) { .detail-specs-grid { grid-template-columns: repeat(3, 1fr); } }

.spec-item { display: flex; flex-direction: column; gap: 2px; }
.spec-item dt { font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.spec-item dd { font-size: 14px; font-weight: 600; color: var(--color-text); }

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

.amenity {
  padding: 6px 12px;
  background: rgba(12,116,187,0.08);
  color: var(--color-primary-700);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.detail-map { height: 280px; border-radius: var(--radius-sm); overflow: hidden; background: var(--color-border); }

.detail-embed {
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.detail-embed iframe { width: 100%; height: 100%; border: 0; }

.detail-aside { display: flex; flex-direction: column; gap: 14px; }

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 14px 0;
}

.contact-list .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 10px;
}
.contact-list .row span:first-child { color: var(--color-muted); }
.contact-list .row span:last-child { font-weight: 500; word-break: break-all; text-align: right; }

/* =========================================================================
   INMOBILIARIAS
   ========================================================================= */

.inmo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 24px 0 40px;
}

@media (min-width: 640px) { .inmo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .inmo-grid { grid-template-columns: repeat(3, 1fr); } }

.inmo-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inmo-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.inmo-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inmo-card-logo {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-700));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.inmo-card-info { flex: 1; min-width: 0; }
.inmo-card-info h3 { font-size: 15px; font-weight: 700; color: var(--color-primary-900); line-height: 1.2; }
.inmo-card-info span { font-size: 12px; color: var(--color-muted); }

.inmo-card-count {
  padding: 10px 12px;
  background: rgba(12,116,187,0.06);
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inmo-card-count strong { color: var(--color-primary); font-weight: 700; font-size: 14px; }

/* ---------- Page header (listado / inmobiliarias) ---------- */
.page-header {
  padding: 32px 0 8px;
  text-align: center;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-primary-900);
  letter-spacing: -0.01em;
}
.page-header p {
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 6px;
}
@media (min-width: 768px) { .page-header h1 { font-size: 34px; } }

/* --- Sidebar de filtros del listado: estilos modernos --- */
.listing-sidebar {
  padding: 20px 18px;
}

.listing-sidebar h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-900);
  margin-bottom: 10px;
}

.listing-sidebar h4::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 2px;
}

.listing-sidebar select,
.listing-sidebar input[type="text"],
.listing-sidebar input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--color-text);
  background: #fff;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.listing-sidebar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  cursor: pointer;
}

.listing-sidebar input[type="text"],
.listing-sidebar input[type="number"] {
  padding-left: 36px;
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 14px;
}

.listing-sidebar input[type="text"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3Cpath d='M9.5 9.5l3 3' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.listing-sidebar input[type="number"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ctext x='4' y='10' font-family='sans-serif' font-size='9' font-weight='700' fill='%2394a3b8'%3E$%3C/text%3E%3C/svg%3E");
}

.listing-sidebar select:hover,
.listing-sidebar input:hover {
  border-color: var(--color-muted-2);
}

.listing-sidebar select:focus,
.listing-sidebar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12,116,187,0.12);
}

.filter-group {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.filter-group:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Fila de "Desde/Hasta" lado a lado */
.listing-sidebar .filter-range {
  display: flex;
  gap: 8px;
}

.listing-sidebar .filter-range > * { flex: 1; min-width: 0; }

/* Header estilizado del listado (count + sort + view-mapa) */
.listing-topbar {
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  border: 1px solid var(--color-border);
  padding: 12px 16px;
}

.listing-topbar .count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.listing-topbar .count strong { color: var(--color-primary-900); font-weight: 800; font-size: 15px; }

.topbar-actions .sort-select {
  padding: 7px 26px 7px 12px;
  font-size: 13px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background-color: #fff;
  color: var(--color-text);
  font-weight: 500;
}

/* --- Logo real de inmobiliaria (fallback a iniciales por onerror) --- */
.inmo-card-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

/* Si el body tiene app-fixed (vista mapa full-height), cualquier footer
   que haya quedado por error queda oculto para no achicar el contenido. */
body.app-fixed .footer,
body.app-fixed #slot-footer { display: none !important; }

/* =========================================================================
   Layout shell (mapa full-height) — corrige bug de colapso cuando no hay
   propiedades en el viewport.
   ========================================================================= */
body.app-fixed .app-shell {
  display: flex;
  flex-direction: column;
}
body.app-fixed .app-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
body.app-fixed .map-layout {
  flex: 1;
  min-height: 0;
}

/* --- Topbar del mapa --- */
.map-topbar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.map-topbar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 10px 4px 14px;
  flex: 1 1 200px;
  max-width: 360px;
  color: var(--color-muted-2);
  transition: var(--transition);
}
.map-topbar-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(12,116,187,0.12); }
.map-topbar-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--color-text);
  padding: 5px 0;
}
.map-topbar-btn { padding: 8px 16px; font-size: 13px; }
.filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  margin-left: 4px;
}

/* --- Checkbox de amenities (en modal filtros) --- */
.pop-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
}
.pop-check:hover { background: rgba(12,116,187,0.06); }
.pop-check input { accent-color: var(--color-primary); width: 16px; height: 16px; }

/* Badge "Apto crédito" en cards */
.badge-credito {
  background: #f1f5f9;
  color: var(--color-primary-700);
  border: 1px solid rgba(12,116,187,0.25);
}

.inmo-more {
  display: flex;
  justify-content: center;
  padding: 8px 0 40px;
}

.inmo-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  width: 100%;
  max-width: 420px;
  transition: var(--transition);
}
.inmo-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12,116,187,0.12);
}
.inmo-search .icon { color: var(--color-muted-2); font-size: 14px; }
.inmo-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--color-text);
}

/* --- Typeahead del search (sugerencias loc/barrio) --- */
.search-typeahead {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 70;
  max-height: 320px;
  overflow-y: auto;
}
.ta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}
.ta-item:hover { background: rgba(12,116,187,0.06); }
.ta-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12,116,187,0.08);
  border-radius: 50%;
  font-size: 13px;
}
.ta-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ta-info strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ta-info span {
  font-size: 11px;
  color: var(--color-muted);
}
.ta-item.active { background: rgba(12,116,187,0.10); }
.ta-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Cantidad de propiedades publicadas en esa zona (columna derecha). */
.ta-meta {
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
