:root {
  --navy: #1E3A66;
  --navy-600: #2E5090;
  --gold: #C9A24B;
  --gold-light: #E4C77D;
  --ochre: #BD7E2A;
  --marengo-950: #2B2E34;
  --marengo-900: #3C4149;
  --pearl-100: #DEE0E3;
  --pearl-200: #D2D5D9;
  --pearl-300: #BEC2C8;
  --cream-50: #FAF7F0;
  --cream-100: #F1EAD9;
  --ink-900: #22252A;
  --ink-600: #565C66;
  --ink-400: #8B8F97;
  --danger: #B4432E;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* Red de seguridad: pase lo que pase con el contenido de cualquier
   pantalla (calendarios, grids, lo que sea), nunca debe poder
   desplazarse en horizontal — todo tiene que entrar en el ancho de
   la pantalla de una vez. */
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream-50);
  color: var(--ink-900);
  width: 100%;
}
a { color: inherit; }
.serif { font-family: 'Fraunces', Georgia, serif; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 56px; background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 50;
}
.brand { font-family: 'Poppins', Arial, sans-serif; font-weight: 700; font-size: 26px; color: #fff; letter-spacing: 1.5px; }
.brand .gold { color: var(--gold-light); }
.topbar-links { display: flex; gap: 36px; align-items: center; }
.btn-menu-movil { display: none; background: none; border: none; color: #fff; padding: 4px; cursor: pointer; }
.btn-menu-movil svg { width: 22px; height: 22px; }
.btn-publicar-externo {
  display: none; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 100px;
  background: var(--gold); color: var(--navy); text-decoration: none; flex-shrink: 0; white-space: nowrap;
  font-weight: 800; font-size: 13px; box-shadow: 0 4px 10px -2px rgba(0,0,0,0.4);
}
.btn-publicar-externo svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-publicar-externo:hover { filter: brightness(1.08); }
.topbar-links-app { gap: 34px; }
.topbar-links-app a { display: flex; align-items: center; gap: 8px; }
.badge-mensajes {
  position: absolute; top: -6px; right: -8px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--danger); color: #fff; border-radius: 100px; font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1; font-family: sans-serif;
}
.topbar-link-icono { font-size: 16px; line-height: 1; display: inline-flex; position: relative; color: var(--gold-light); }
.topbar-link-icono svg { width: 17px; height: 17px; }
#link-publicar {
  background: var(--gold); color: var(--navy) !important; padding: 8px 16px 8px 12px; border-radius: 100px; font-weight: 800;
}
#link-publicar .topbar-link-icono { color: var(--navy); }
#link-publicar:hover { color: var(--navy) !important; filter: brightness(1.06); }
.topbar-link-icono-publicar { background: transparent; color: var(--navy); width: auto; height: auto; border-radius: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.topbar-link-icono-publicar svg { width: 15px; height: 15px; }
.menu-con-icono { text-decoration: none; color: inherit; }
.menu-con-icono svg { width: 16px; height: 16px; flex-shrink: 0; }
.menu-icono-mensajes { position: relative; display: inline-flex; }
.perfil-item .icono { position: relative; }
.topbar-links a { text-decoration: none; font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,0.85); cursor: pointer; }
.topbar-links a:hover { color: var(--gold-light); }
.topbar-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.btn-ghost { text-decoration: none; font-size: 14.5px; font-weight: 700; color: #fff; cursor: pointer; }
.btn-download { background: var(--gold); color: var(--navy); padding: 11px 22px; border-radius: 10px; font-size: 14px; font-weight: 800; text-decoration: none; }
.btn-download:hover { filter: brightness(1.05); }
.idioma-selector { position: relative; }
.pais-selector { position: relative; }
.usuario-selector { position: relative; }
.footer-bottom-row { max-width: 1360px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom-row .footer-bottom { margin: 0; padding: 0; border: none; }
.footer-bottom-row .pais-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.65); }
.footer-bottom-row .pais-btn span#pais-actual { color: #fff; }
.footer-bottom-row .idioma-menu { top: auto; bottom: calc(100% + 8px); }
.pais-btn { background: #fff; border: 1.5px solid var(--pearl-200); border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--ink-600); }
.pais-btn:hover { border-color: var(--gold); }
.pais-btn span { color: var(--navy-600); }
.idioma-btn { width: 48px; height: 48px; border-radius: 24px; background: #fff; border: 2px solid var(--pearl-200); cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden; }
.idioma-btn:hover { border-color: var(--gold); }
.idioma-btn span { font-size: 24px; line-height: 1; }
.bandera-svg { display: inline-block; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; vertical-align: middle; line-height: 0; }
.bandera-svg svg { width: 100%; height: 100%; display: block; }
.idioma-menu { display: none; position: absolute; top: calc(100% + 10px); right: 0; background: #fff; border-radius: 12px; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.25); border: 1px solid var(--pearl-100); min-width: 190px; overflow: hidden; z-index: 60; }
.idioma-menu.abierto { display: block; }
.idioma-opcion { padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-900); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.idioma-opcion:hover { background: var(--cream-100); }
.idioma-opcion.activa { color: var(--navy-600); font-weight: 800; }
.idioma-opcion span.bandera { display: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(160deg, var(--pearl-200) 0%, var(--pearl-100) 100%);
  padding: 18px 56px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(201,162,75,0.14), transparent 55%);
  pointer-events: none;
}
.logo-grande { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 2px; }
.logo-mark { width: 122px; height: 122px; object-fit: contain; }
.logo-word { font-family: 'Poppins', Arial, sans-serif; font-weight: 700; font-size: 34px; letter-spacing: 3px; color: var(--navy); text-transform: uppercase; }
.logo-word .bix { color: var(--ochre); }
.hero-tag { position: relative; z-index: 1; color: var(--ink-600); font-size: 15px; font-weight: 500; margin-bottom: 12px; }

.search-panel {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35);
  overflow: hidden;
}
.search-tabs { display: flex; background: var(--cream-100); flex-wrap: wrap; }
.search-tab {
  flex: 1; min-width: 140px; text-align: center; padding: 16px 8px;
  font-size: 14px; font-weight: 700; color: var(--ink-600);
  cursor: pointer; border-bottom: 3px solid transparent;
  user-select: none;
}
.search-tab.active { background: #fff; color: var(--navy-600); border-bottom-color: var(--gold); }
.search-row { display: flex; align-items: center; padding: 13px 20px; gap: 14px; flex-wrap: wrap; }
.search-input-wrap { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; }
.search-input-wrap svg { flex-shrink: 0; }
.search-input-wrap input {
  border: none; outline: none; font-size: 14.5px; width: 100%;
  font-family: inherit; color: var(--ink-900);
}
.search-input-wrap input::placeholder { color: var(--ink-400); }
.search-divider { width: 1px; height: 24px; background: var(--pearl-100); }
.btn-search {
  background: var(--gold); color: var(--navy); border: none;
  padding: 11px 26px; border-radius: 11px; font-size: 14px; font-weight: 800;
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.btn-search:hover { filter: brightness(1.05); }
.btn-buscar-resultados {
  width: 100%; height: 50px; font-size: 15px; margin-top: 4px;
  position: sticky; bottom: 0;
  box-shadow: 0 -6px 14px -8px rgba(0,0,0,0.15);
}

.btn-toggle-filtros { display: none; }

/* ===== Mapa con laterales ===== */
.map-section {
  max-width: 1520px; margin: 20px auto 0; padding: 0 56px 70px;
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 270px 1fr 270px; gap: 20px;
}
.side-panel {
  background: #fff; border-radius: 18px; border: 1px solid var(--pearl-100); border-top: 3px solid var(--navy);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 10px 30px -15px rgba(0,0,0,0.12);
  max-height: 600px; overflow-y: auto;
}
.side-panel-title { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; color: var(--navy-600); text-transform: uppercase; padding-bottom: 6px; border-bottom: 2px solid var(--cream-100); }
.rango-fechas-wrap { margin: 10px 0 20px; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; min-width: 0; }
.side-item { font-size: 13.5px; color: var(--ink-900); }
.side-item label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.side-item-sub { font-size: 11.5px; color: var(--ink-400); }

/* Alquiler por fechas: fechas exactas vs fechas flexibles (mes + duración) */
.fechas-modo-toggle { display: flex; gap: 6px; margin-bottom: 12px; }
.fechas-modo-btn { flex: 1; border: 1.5px solid var(--pearl-200); background: #fff; color: var(--ink-600); font-size: 12px; font-weight: 800; padding: 8px 6px; border-radius: 100px; cursor: pointer; font-family: inherit; }
.fechas-modo-btn.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.fecha-flexible-wrap select.modal-input { margin-bottom: 12px; }
.duracion-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.duracion-chip { border: 1.5px solid var(--pearl-200); background: #fff; color: var(--ink-600); font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 100px; cursor: pointer; font-family: inherit; }
.duracion-chip.activo { background: var(--ochre); border-color: var(--ochre); color: #fff; }

/* Precio: barra de rango con dos tiradores */
.rango-precio-wrap { margin-bottom: 2px; }
.moneda-toggle-wrap { display: flex; gap: 6px; margin-bottom: 10px; }
.moneda-punto { border: 1.5px solid var(--pearl-200); background: #fff; color: var(--ink-600); font-size: 11.5px; font-weight: 800; padding: 5px 12px; border-radius: 100px; cursor: pointer; font-family: inherit; }
.moneda-punto.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.rango-precio-valores { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--navy-600); margin-bottom: 14px; }
.rango-precio-slider { position: relative; height: 20px; }
.rango-precio-track { position: absolute; top: 50%; left: 0; right: 0; height: 4px; background: var(--pearl-200); border-radius: 4px; transform: translateY(-50%); }
.rango-precio-relleno { position: absolute; top: 50%; height: 4px; background: var(--gold); border-radius: 4px; transform: translateY(-50%); }
.rango-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 20px; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none;
}
.rango-input::-webkit-slider-runnable-track { background: transparent; }
.rango-input::-moz-range-track { background: transparent; }
.rango-input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--navy); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); cursor: pointer; margin-top: 0;
}
.rango-input::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--navy); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); cursor: pointer;
}

/* Tipo de inmueble — chips en vez de checkboxes sueltos */
.tipo-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tipo-chip { position: relative; }
.tipo-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tipo-chip span {
  display: block; padding: 7px 12px; border-radius: 100px; font-size: 12px; font-weight: 700;
  color: var(--ink-600); background: var(--cream-100); border: 1.5px solid transparent; user-select: none;
}
.tipo-chip input:checked + span { background: var(--navy); color: #fff; }
.tipo-chip input:focus-visible + span { border-color: var(--gold); }
.filtro-select { width: 100%; height: 36px; border-radius: 9px; border: 1.5px solid var(--pearl-200); padding: 0 10px; font-size: 12.5px; font-family: inherit; background: #fff; margin-bottom: 4px; }
.contador-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.contador-chip { border: 1.5px solid var(--pearl-200); background: #fff; color: var(--ink-600); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 100px; cursor: pointer; font-family: inherit; }
.contador-chip.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.filtro-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.filtro-chip { position: relative; }
.filtro-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.filtro-chip span {
  display: block; padding: 7px 12px; border-radius: 100px; font-size: 12px; font-weight: 700;
  color: var(--ink-600); background: var(--cream-100); border: 1.5px solid transparent; user-select: none;
}
.filtro-chip input:checked + span { background: var(--ochre); color: #fff; }
.filtro-chip input:focus-visible + span { border-color: var(--gold); }
.filtro-chip.oculto { display: none; }
.tipo-chip.oculto { display: none; }
.oculto { display: none; }
.resultados-lista { display: flex; flex-direction: column; gap: 10px; }
.resultado-mini { display: flex; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--cream-100); cursor: pointer; }
.resultado-mini:last-child { border-bottom: none; }
.resultado-mini-foto { width: 44px; height: 44px; border-radius: 8px; background: var(--cream-100); flex-shrink: 0; object-fit: cover; }
.resultado-mini-precio { font-weight: 700; font-size: 12.5px; color: var(--navy-600); }
.resultado-mini-dir { font-size: 10.5px; color: var(--ink-400); }
.resultado-mini-info { min-width: 0; }
.resultado-mini-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.resultado-mini-tag { font-size: 9.5px; font-weight: 700; color: var(--navy-600); background: var(--cream-100); padding: 2px 7px; border-radius: 100px; }

/* Fechas flexibles: los "packs" de fechas + precio total que sustituyen
   a las etiquetas normales cuando un inmueble tiene varios huecos
   posibles en el mes elegido. */
.packs-flexibles { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.pack-flexible { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; }
.resultado-mini-info .pack-flexible { color: var(--ink-600); }
.resultado-mini-info .pack-flexible-precio { font-weight: 800; color: var(--navy-600); }

.map-box {
  border-radius: 20px; border: 1px solid var(--pearl-100);
  min-height: 620px; position: relative; overflow: hidden;
  box-shadow: 0 20px 45px -20px rgba(0,0,0,0.25);
}
.map-box-wrap { position: relative; }
.map-error {
  position: absolute; inset: 0; z-index: 10;
  background: var(--cream-100); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px;
}
.map-error p { color: var(--ink-600); font-size: 14px; font-weight: 600; max-width: 320px; }
.map-error button {
  background: var(--navy); color: #fff; border: none; padding: 10px 24px;
  border-radius: 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.map-error.oculto { display: none; }
.map-base {
  position: absolute; inset: 0; z-index: 6; cursor: pointer;
  background: var(--cream-100); transition: opacity .4s ease;
}
.map-base.oculto { opacity: 0; pointer-events: none; }
.map-base-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-base-pista {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: rgba(30,58,102,0.88); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.35);
}
.map-base.cargando .map-base-pista { opacity: .85; }
.preview-card {
  position: absolute; left: 14px; right: 14px; bottom: 16px; z-index: 20;
  background: #fff; border-radius: 16px; padding: 10px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,0.35);
}
.preview-card .preview-card-foto { width: 120px; height: 90px; border-radius: 12px; background: var(--cream-100); flex: 0 0 120px; position: relative; overflow: hidden; }
.preview-card-foto .listing-fotos-tira { height: 100%; cursor: grab; }
.preview-card-foto .listing-fotos-flecha { width: 22px; height: 22px; font-size: 13px; }
.preview-card-foto .listing-fotos-flecha.izq { left: 4px; }
.preview-card-foto .listing-fotos-flecha.der { right: 4px; }
.preview-card-foto .listing-fotos-puntos { bottom: 5px; gap: 3px; }
.preview-card-foto .listing-fotos-punto { width: 4px; height: 4px; }
/* .preview-card-fotos (marcador) */
.preview-card-body { flex: 1; min-width: 0; padding-right: 20px; }
.preview-card-precio { font-weight: 800; font-size: 14px; color: var(--ochre); margin-bottom: 2px; }
.preview-card-titulo { font-weight: 700; font-size: 13.5px; color: var(--ink-900); overflow-wrap: anywhere; line-height: 1.25; } /* el título sale siempre entero */
.preview-card-desc { font-size: 11.5px; color: var(--ink-400); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-card-cerrar { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--ink-400); font-size: 13px; cursor: pointer; padding: 4px; }
.map-pin {
  background: var(--navy-600); color: #fff; font-size: 11.5px; font-weight: 800;
  padding: 6px 12px; border-radius: 100px; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  white-space: nowrap; cursor: pointer; transform: translate(-50%, -100%);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.map-pin.gold { background: var(--gold); color: var(--navy); }
.preview-card-aprox-nota { font-size: 9px; font-weight: 600; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.preview-card-aprox { font-size: 10.5px; font-weight: 800; color: var(--ochre); letter-spacing: 0.3px; text-transform: uppercase; margin: 2px 0 4px; }

/* ===== Listados ===== */
.listings-section { max-width: 1360px; margin: 0 auto; padding: 10px 56px 90px; }
.listings-head { margin-bottom: 28px; }
.listings-head h2 { font-size: 28px; color: var(--navy-600); font-weight: 700; }
.listings-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 190px;
  gap: 18px;
  max-height: 832px; /* 4 filas visibles (190px x 4 + huecos) — si hay más anuncios, se hacen scroll aquí dentro */
  overflow-y: auto;
  padding-right: 4px; /* para que la barra de scroll no pegue justo con las tarjetas */
}

/* ===== Página de resultados (resultados.html) ===== */
/* Sin el tercer panel de la lista pequeña — el mapa aprovecha ese
   espacio, y los resultados de verdad van en la cuadrícula grande de
   debajo, no aquí al lado. */
.resultados-map-section { grid-template-columns: 270px 1fr 270px; }
.resultados-header-wrap { max-width: 1520px; margin: 20px auto 0; padding: 0 56px; }
.btn-volver-resultados {
  display: inline-block; margin-bottom: 14px; color: var(--navy-600) !important;
  font-size: 14px; font-weight: 700;
}
.btn-volver-resultados:hover { color: var(--gold); }
.resultados-grid-wrap { max-width: 1520px; margin: 36px auto 0; padding: 0 56px 70px; }
.resultados-grid-titulo { font-size: 13px; margin-bottom: 18px; padding-bottom: 10px; }
.listings-grid-grande {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 24px;
  max-height: none; /* aquí sí se scrollea la página entera, no un recuadro dentro */
  overflow-y: visible;
}
.listings-grid-grande .listing-price { font-size: 20px; }
.listings-grid-grande .listing-loc { font-size: 13.5px; }
.listings-grid-grande .listing-tag { font-size: 11.5px; padding: 4px 10px; }
.listing-card {
  background: var(--navy); border-radius: 16px; overflow: hidden; border-top: 3px solid var(--gold);
  box-shadow: 0 8px 20px -12px rgba(0,0,0,0.35); cursor: pointer; text-decoration: none; display: flex; flex-direction: column;
}
.listing-photo { flex: 1; background: linear-gradient(135deg,#D9CDB0,#C7B78F); background-size: cover; background-position: center; }
.listing-fotos-tira {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  position: relative; background: linear-gradient(135deg,#D9CDB0,#C7B78F);
}
.listing-fotos-tira::-webkit-scrollbar { display: none; }
.listing-fotos-tira img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.listing-fotos-puntos {
  position: absolute; bottom: 9px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none;
}
.listing-fotos-punto { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: background 0.15s, transform 0.15s; }
.listing-fotos-punto.activo { background: #fff; transform: scale(1.3); }
.listing-fotos-flecha {
  position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: rgba(20,20,25,0.4); border: none; color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s; z-index: 2;
}
.listing-photo-wrap:hover .listing-fotos-flecha { opacity: 1; }
.listing-fotos-flecha.izq { left: 8px; }
.listing-fotos-flecha.der { right: 8px; }
.listing-photo-wrap { flex: 1; position: relative; overflow: hidden; }
@media (hover: none) {
  .listing-fotos-flecha { display: none; } /* en pantallas táctiles basta con deslizar */
}
.listing-body { padding: 14px; }
.listing-price { font-family: 'Fraunces', serif; font-weight: 700; font-size: 17px; color: var(--gold-light); }
.precio-equivalente { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 0.72em; opacity: 0.75; }
.listing-loc { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 3px; }
.listing-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.listing-tag { font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(255,255,255,0.14); padding: 3px 8px; border-radius: 100px; }
.listing-body .pack-flexible { color: rgba(255,255,255,0.75); }
.listing-body .pack-flexible-precio { font-weight: 800; color: #fff; }

/* ===== Footer ===== */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.7); padding: 56px; }
.footer-grid { max-width: 1360px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid p { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.footer-grid h4 { color: #fff; font-size: 13px; margin-bottom: 14px; }
.footer-grid a { display: block; font-size: 13px; text-decoration: none; margin-bottom: 10px; color: rgba(255,255,255,0.7); }
.footer-bottom { font-size: 12px; }

/* ===== Modal login ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,22,40,0.55);
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.abierto { display: flex; }
.modal-box { background: #fff; border-radius: 20px; padding: 30px; max-width: 420px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-400); }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 22px; background: var(--cream-100); border-radius: 12px; padding: 4px; }
.modal-divider { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; position: relative; }
.modal-divider::before, .modal-divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--pearl-200); }
.modal-divider::before { left: 0; }
.modal-divider::after { right: 0; }
.modal-tab { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; }
.modal-tab.active { background: #fff; color: var(--navy-600); }
.modal-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; color: var(--navy-600); margin: 14px 0 6px; }
.marca-obligatorio { color: var(--danger); font-weight: 800; }
.campo-con-error { border-color: var(--danger) !important; background: #FBE9E5 !important; }
.modal-label.label-con-error { color: var(--danger); }
.modal-input { width: 100%; height: 46px; border-radius: 13px; border: 1.5px solid var(--pearl-200); padding: 0 14px; font-size: 14px; font-family: inherit; }
.modal-input:focus { outline: none; border-color: var(--gold); }
select.modal-input {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23142850' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center;
  background-size: 16px; padding-right: 40px; cursor: pointer; color: var(--ink-900); font-weight: 600;
}
select.modal-input:hover { border-color: var(--gold); }
/* Departamento / Barrios o zonas — más grande y en dorado, para que
   destaquen frente al resto de campos del filtro, más discretos. */
select.select-zona-dorado {
  height: 52px; font-size: 15.5px; font-weight: 800; color: var(--navy);
  border: 2px solid var(--gold); background-color: #FEFBF3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A24B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  border-radius: 14px;
}
select.select-zona-dorado:hover { border-color: var(--gold-light); box-shadow: 0 2px 10px -2px rgba(201,162,75,0.35); }
select.select-zona-dorado:focus { outline: none; box-shadow: 0 0 0 3px rgba(199,154,46,0.2); }
.modal-input-pass-wrap { position: relative; }
.modal-input-pass-wrap .modal-input { padding-right: 44px; }
.modal-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.55; }
.tipo-cuenta-row { display: flex; gap: 8px; margin-bottom: 6px; }
.tipo-cuenta-btn { flex: 1; padding: 11px; border-radius: 12px; border: 1.5px solid var(--pearl-200); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-600); font-family: inherit; }
.tipo-cuenta-btn.active { background: var(--navy-600); color: #fff; border-color: var(--navy-600); }
.modal-error { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 1px; }

/* ===== Alquiler por fechas / reservas ===== */
.allinone-section { max-width: 1360px; margin: 0 auto; padding: 36px 56px 60px; text-align: center; }
.allinone-eyebrow { color: var(--ochre); font-weight: 800; font-size: 12px; letter-spacing: 1.5px; margin-bottom: 10px; }
.allinone-sub { max-width: 640px; margin: 10px auto 34px; color: var(--ink-400); font-size: 14.5px; line-height: 1.6; }
.operaciones-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.operacion-card {
  aspect-ratio: 3/4; border-radius: 18px; position: relative; overflow: hidden;
  background-size: cover; background-position: center; text-align: left;
  border: 1.5px solid var(--pearl-100); box-shadow: 0 10px 24px -14px rgba(11,30,61,0.3);
}
.operacion-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 14px;
  background: linear-gradient(to top, rgba(11,30,61,0.92) 10%, rgba(11,30,61,0.55) 55%, transparent 100%);
}
.operacion-nombre { font-weight: 800; font-size: 15px; color: #fff; margin-bottom: 4px; }
.operacion-destacada { border-color: var(--gold); border-width: 2.5px; }
.operacion-badge { position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--gold); color: var(--navy); font-size: 10px; font-weight: 800; letter-spacing: 0.5px; padding: 4px 12px; border-radius: 100px; }
.operacion-detalle { color: rgba(255,255,255,0.85); font-size: 11.5px; line-height: 1.5; }
.allinone-section h2 { max-width: 760px; margin: 0 auto; font-size: 26px; line-height: 1.3; color: var(--navy-600); }
.reservas-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--pearl-100); border-radius: 18px; padding: 26px 32px; flex-wrap: wrap; }
.reservas-cta span { font-size: 15px; font-weight: 700; color: var(--navy-600); }

@media (max-width: 900px) {
  .allinone-section { padding: 24px 20px 40px; }
  .operaciones-grid { grid-template-columns: 1fr 1fr; }
  .allinone-section h2 { font-size: 21px; }
  .reservas-cta { flex-direction: column; text-align: center; }

  /* Barra superior: dos filas fijas en vez de dejar que todo se
     amontone y salte de línea sin control. Arriba: logo a la
     izquierda, hamburguesa/publicar/descargar a la derecha. Debajo:
     usuario (o "Entrar") a la izquierda, idioma al lado contrario. */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, auto) minmax(0, auto) minmax(0, 1fr);
    grid-template-areas:
      "brand hamburger publicar download"
      "usuario usuario . idioma";
    align-items: center;
    row-gap: 10px; column-gap: 8px;
    padding: 10px 16px;
    max-width: 100%;
    /* Nada de "overflow-x: hidden" aquí: combinado con overflow-y
       distinto de hidden, el navegador convierte automáticamente ese
       "visible" en "auto" (lo manda la propia especificación de CSS
       overflow), y "auto" sigue recortando igual que "hidden" todo lo
       que cuelgue por debajo — así quedaban cortados tanto el menú de
       usuario como el de las 3 rayitas. El desborde horizontal ya
       está cubierto por min-width:0 + ellipsis en cada hijo y por el
       "overflow-x:hidden" de html/body más abajo, así que esta barra
       no necesita recortar nada por su cuenta. */
  }
  /* Todo elemento de la barra debe poder encogerse por debajo de su
     tamaño de contenido — si no, cualquier texto largo (el nombre, un
     idioma, etc.) fuerza el ensanche de la barra entera y aparece el
     scroll horizontal que no debe existir nunca. */
  .topbar > * { min-width: 0; }
  .brand { grid-area: brand; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #btn-menu-movil { grid-area: hamburger; justify-self: start; }
  .topbar-actions { display: contents; }
  #link-publicar-externo { grid-area: publicar; justify-self: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-download { grid-area: download; justify-self: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .usuario-selector { grid-area: usuario; justify-self: start; min-width: 0; }
  .usuario-selector > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .usuario-selector .idioma-menu { left: 0; right: auto; min-width: 170px; }
  .idioma-selector { grid-area: idioma; justify-self: end; }
  .btn-menu-movil { display: flex; }
  .btn-publicar-externo { display: flex; }
  .topbar-links-app {
    display: none; position: absolute; top: calc(100% + 3px); left: 16px; right: auto;
    background: #fff; border-radius: 14px; box-shadow: 0 14px 34px -10px rgba(0,0,0,0.35);
    flex-direction: column; gap: 0; padding: 8px; min-width: 200px; z-index: 60;
  }
  .topbar-links-app.abierto { display: flex; }
  .topbar-links-app a { padding: 10px 12px; border-radius: 10px; color: var(--ink-900) !important; }
  .topbar-links-app a:active, .topbar-links-app a:hover { background: var(--cream-100); }
  .topbar-link-icono { color: var(--navy-600); }
  .brand { font-size: 21px; }
  .topbar-actions { gap: 8px; }
  .pais-prefijo { display: none; } /* "Hausbix España" -> "España", ya se ve el logo al lado */
  .pais-btn { padding: 7px 10px; font-size: 11.5px; }
  .idioma-btn { width: 40px; height: 40px; }
  .idioma-btn span { font-size: 19px; }
  .btn-ghost { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-download { padding: 8px 12px; font-size: 12px; }

  .hero { padding: 20px 16px 26px; }
  .logo-mark { width: 84px; height: 84px; }
  .logo-word { font-size: 33px; }
  .hero-tag { font-size: 13.5px; margin-bottom: 12px; }
  .search-tab { min-width: 0; padding: 10px 6px; font-size: 12px; }
  .search-row { padding: 10px 14px; }

  /* Filtros plegables: en el móvil no tiene sentido enseñarlos siempre
     abiertos ocupando toda la pantalla antes de ver el mapa. */
  .btn-toggle-filtros {
    display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 0 16px 14px;
    background: #fff; border: 1.5px solid var(--pearl-200); border-radius: 12px;
    padding: 12px 16px; font-size: 13.5px; font-weight: 700; color: var(--navy-600);
    font-family: inherit; cursor: pointer;
  }
  .map-section { grid-template-columns: 1fr; padding: 0 16px 50px; gap: 14px; margin-top: 10px; }
  .filtros-panel { display: none; }
  .filtros-panel.abierto { display: flex; }
  .side-panel { max-height: none; }
  .map-box { min-height: 380px; }

  .listings-section { padding: 10px 16px 60px; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; gap: 12px; max-height: 748px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .site-footer { padding: 40px 16px; }
}

@media (max-width: 480px) {
  .idioma-selector { order: 3; } /* la bandera pasa a una segunda fila si no cabe */
  .pais-btn span#pais-actual { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
  .listings-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; max-height: 934px; }

  /* Con el botón de publicar añadido, la barra queda muy justa en
     pantallas pequeñas — "Log in" llegaba a partirse en dos líneas.
     Se compactan los tres botones y se deja sitio de sobra. */
  .topbar-actions { gap: 6px; }
  .btn-ghost { white-space: nowrap; font-size: 13px; }
  .btn-publicar-externo { padding: 0 10px; font-size: 12px; }
  .btn-download { padding: 8px 10px; font-size: 11px; }

  /* En alemán ("Miete nach Datum") y otros idiomas con palabras largas,
     4 pestañas en una sola fila hacían que el texto se partiera a media
     palabra y desbordara hacia la barra de búsqueda de abajo (el
     contenedor tenía overflow:hidden, así que se veía cortado/solapado
     en vez de simplemente crecer). Con 2 filas de 2, cada pestaña tiene
     el doble de ancho disponible, y ya no hace falta que el texto se
     parta en ningún idioma. */
  .search-tab { flex: 1 1 50%; }

  /* El desplegable de "Hausbix [País]" en el footer se anclaba solo por la
     derecha (right:0) con un ancho mínimo fijo — en pantallas estrechas
     eso lo hacía salirse por la izquierda, quedando la mayor parte fuera
     de la pantalla. Aquí se ancla a los dos lados con margen fijo, así
     nunca puede desbordar sea cual sea el ancho de pantalla. */
  .footer-bottom-row .idioma-menu { left: 8px; right: 8px; min-width: 0; width: auto; }
  .footer-bottom-row .idioma-menu .idioma-opcion { font-size: 12.5px; padding: 10px 12px; }
}



/* ===== Destacados: la foto manda; la franja azul es mínima (~20%) ===== */
/* Solo la cuadrícula de destacados (no la de resultados, que es .listings-grid-grande).
   Tarjetas más altas (formato retrato) para que la foto se vea grande y limpia. */
.listings-grid:not(.listings-grid-grande) { grid-auto-rows: 300px; max-height: 940px; }
.listings-grid:not(.listings-grid-grande) .listing-photo-wrap { flex: 1 1 0; min-height: 0; display: flex; }
.listings-grid:not(.listings-grid-grande) .listing-fotos-tira { flex: 1; min-width: 0; }
.listing-body-compacto {
  flex: 0 0 auto; padding: 7px 10px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.listing-body-compacto .listing-price { font-size: 14.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.listing-body-compacto .precio-equivalente { display: none; } /* el equivalente en otra moneda queda para la ficha */
.listing-fila-1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.listing-caract { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); white-space: nowrap; flex: 0 0 auto; }
.listing-titulo { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.25; overflow-wrap: anywhere; min-width: 0; } /* el título sale siempre entero */
.listing-zona { font-size: 11px; color: rgba(255,255,255,0.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.listing-zona:empty { display: none; }
@media (max-width: 900px) {
  .listings-grid:not(.listings-grid-grande) { grid-auto-rows: 300px; max-height: 930px; }
}
@media (max-width: 480px) {
  .listings-grid:not(.listings-grid-grande) { grid-auto-rows: 340px; max-height: 1050px; }
  .listing-body-compacto { padding: 9px 12px 10px; }
  .listing-body-compacto .listing-price { font-size: 16.5px; }
  .listing-titulo { font-size: 13px; }
  .listing-zona, .listing-caract { font-size: 12px; }
}

/* Resultados junto al mapa: fotos del anuncio deslizables en la propia fila. */
.resultado-mini-fotos { flex: 0 0 104px; width: 104px; height: 78px; border-radius: 10px; background: var(--cream-100); }
.resultado-mini-fotos .listing-fotos-tira { height: 100%; cursor: grab; }
.resultado-mini-fotos .listing-fotos-flecha { width: 20px; height: 20px; font-size: 12px; }
.resultado-mini-fotos .listing-fotos-flecha.izq { left: 3px; }
.resultado-mini-fotos .listing-fotos-flecha.der { right: 3px; }
.resultado-mini-fotos .listing-fotos-puntos { bottom: 4px; gap: 3px; }
.resultado-mini-fotos .listing-fotos-punto { width: 4px; height: 4px; }

/* ===== Inicio (PC): filtros plegables ===== */
.filtros-cabecera, .filtros-resumen { display: none; }
@media (min-width: 901px) {
  .filtros-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .filtros-cabecera .side-panel-title { border-bottom: none; padding-bottom: 0; }
  .filtros-toggle {
    border: 1.5px solid var(--pearl-200); background: #fff; color: var(--navy-600); border-radius: 100px;
    padding: 6px 12px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer;
  }
  .filtros-toggle:hover { border-color: var(--gold); color: var(--gold); }
  .filtros-panel.compacto > *:not(.filtros-cabecera):not(.filtros-resumen) { display: none !important; }
  .filtros-panel.compacto .filtros-resumen { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
  .filtro-resumen-chip { font-size: 11px; font-weight: 700; color: var(--navy-600); background: var(--cream-100); padding: 4px 9px; border-radius: 100px; }
  .filtros-resumen-vacio { font-size: 11px; color: var(--ink-400); width: 100%; }

  /* Plegado: filtros a la mitad de ancho (270 -> 135) y esa mitad se suma a
     los resultados (270 -> 405), que pasan a 2 columnas. El mapa (1fr) no cambia. */
  .map-section.filtros-plegados { grid-template-columns: 135px 1fr 405px; }
  .filtros-panel.compacto { padding: 14px 12px; }
  .filtros-panel.compacto .filtros-cabecera { flex-direction: column; align-items: stretch; gap: 8px; }
  .filtros-panel.compacto .filtros-toggle { width: 100%; padding: 6px 8px; font-size: 11px; }
  .resultados-lista.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; align-items: start; }
  .resultados-lista.dos-columnas .resultado-mini { flex-direction: column; gap: 6px; border-bottom: none; padding-bottom: 0; }
  .resultados-lista.dos-columnas .resultado-mini-fotos { flex: none; width: 100%; height: 96px; }
}

/* Resultados: lista lateral a la derecha (como en el inicio); en móvil ya está la cuadrícula de debajo. */
@media (max-width: 900px) { .resultados-map-section .resultados-lateral { display: none; } }
@media (min-width: 901px) { .resultados-lateral { max-height: 620px; } }

.resultado-mini-titulo { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.25; overflow-wrap: anywhere; min-width: 0; margin: 1px 0 2px; }

.map-pin-nota { display: block; font-size: 9px; font-weight: 600; opacity: 0.85; text-align: center; margin-top: 1px; }
.map-pin:has(.map-pin-nota) { border-radius: 14px; text-align: center; }
.preview-card { max-height: calc(100% - 28px); }
.preview-card-body { max-height: 100%; overflow-y: auto; }
.preview-card-desc { -webkit-line-clamp: 2; }
.detalle-ubicacion-titulo { font-size: 18px; font-weight: 800; color: var(--navy); margin: 8px 0 10px; }
.detalle-mapa { height: 280px; border-radius: 16px; overflow: hidden; background: var(--cream-100); }
.detalle-ubicacion-nota { font-size: 12px; color: var(--ink-400); margin: 8px 0 24px; }

/* Tarjetas con toda la información: precio, título, hab/baños/m², zona, descripción y tags. */
.preview-card-meta { font-size: 11.5px; font-weight: 700; color: var(--ink-600); margin-top: 2px; }
.resultado-mini-meta { font-size: 11px; font-weight: 700; color: var(--ink-600); margin-top: 1px; }
.resultado-mini-desc { font-size: 10.5px; color: var(--ink-400); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resultado-mini-desc:empty { display: none; }
.listing-meta { font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,0.9); margin-top: 2px; }
.listing-desc { font-size: 12px; color: rgba(255,255,255,0.72); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.listing-desc:empty { display: none; }
.listing-desc-completa { font-size: 11.5px; color: rgba(255,255,255,0.75); line-height: 1.35; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.listing-desc-completa:empty { display: none; }
.listing-body:not(.listing-body-compacto) .listing-titulo { font-size: 14px; margin-top: 3px; }
/* Con más texto, las filas ya no pueden ser de alto fijo: la foto tiene el suyo y el resto crece. */
.listings-grid, .listings-grid-grande, .listings-grid:not(.listings-grid-grande) { grid-auto-rows: auto; }
.listings-grid .listing-photo-wrap, .listings-grid:not(.listings-grid-grande) .listing-photo-wrap { flex: 0 0 auto; height: 170px; min-height: 170px; }
.listings-grid-grande .listing-photo-wrap { height: 200px; min-height: 200px; }
@media (max-width: 480px) { .listings-grid .listing-photo-wrap, .listings-grid:not(.listings-grid-grande) .listing-photo-wrap { height: 200px; min-height: 200px; } }

/* Resultados (cuadrícula grande): sin alto máximo ni scroll interno en ningún ancho; la página entera es la que scrollea. */
.listings-grid.listings-grid-grande { max-height: none; overflow-y: visible; }
