/* ============================================================
   Inmuebles Filter — Frontend Styles
   Identidad: Inmobiliaria de lujo — moderno y clásico
   Paleta: Verde #1d4e3f  ·  Crema #e4e0cc
   ============================================================ */

/* ── Variables de marca ─────────────────────────────────────── */
:root {
  --imf-green:        #1d4e3f;
  --imf-green-dark:   #163c30;
  --imf-green-light:  #2a6b57;
  --imf-cream:        #e4e0cc;
  --imf-cream-light:  #f5f3ec;
  --imf-cream-dark:   #d4cfb8;

  --imf-text:         #1a1a1a;
  --imf-muted:        #7a7a6e;
  --imf-border:       #dddbd0;
  --imf-bg:           #ffffff;
  --imf-bg-hover:     #f5f3ec;
  --imf-shadow:       0 4px 24px rgba(29,78,63,.10);
  --imf-shadow-sm:    0 2px 10px rgba(29,78,63,.07);
  --imf-radius:       2px;
  --imf-font:         inherit;
  --imf-gap:          24px;
  --imf-transition:   all .2s ease;
}

/* ── Wrapper ────────────────────────────────────────────────── */
.imf-listing-wrapper {
  position: relative;
  font-family: var(--imf-font);
  color: var(--imf-text);
}

/* ══════════════════════════════════════════════════════════════
   BARRA DE FILTROS
   ══════════════════════════════════════════════════════════════ */

.imf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--imf-border);
  margin-bottom: 32px;
}


/* ── Grupo de tabs principales (Todos / En venta / Vendidos) ────────────── */
.imf-tab-group {
  display: flex;
  border-right: 1px solid var(--imf-border);
  margin-right: 4px;
}

.imf-filter-tab {
  background: none;
  border: none;
  padding: 14px 20px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--imf-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--imf-transition);
  white-space: nowrap;
}
.imf-filter-tab:hover {
  color: var(--imf-green);
}
.imf-filter-tab.imf-tab-active {
  color: var(--imf-green);
  border-bottom-color: var(--imf-green);
}

.imf-filter-reset {
  background: none;
  border: none;
  padding: 14px 22px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--imf-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--imf-transition);
}
.imf-filter-reset.imf-btn-active,
.imf-filter-reset:hover {
  color: var(--imf-green);
  border-bottom-color: var(--imf-green);
}

.imf-filter-group {
  position: relative;
}

.imf-dropdown-toggle {
  background: none;
  border: none;
  padding: 14px 22px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--imf-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--imf-transition);
  white-space: nowrap;
}
.imf-dropdown-toggle:hover,
.imf-dropdown-toggle[aria-expanded="true"] {
  color: var(--imf-green);
  border-bottom-color: var(--imf-green);
}
.imf-dropdown-toggle.imf-has-value {
  color: var(--imf-green);
  border-bottom-color: var(--imf-green);
}

.imf-caret {
  font-size: 9px;
  opacity: .6;
  transition: transform .2s ease;
  display: inline-block;
}
.imf-dropdown-toggle[aria-expanded="true"] .imf-caret {
  transform: rotate(180deg);
}

/* ── Panel desplegable ──────────────────────────────────────── */
.imf-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--imf-bg);
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  box-shadow: var(--imf-shadow);
  z-index: 9999;
  padding: 6px 0;
}
.imf-dropdown-panel[hidden] { display: none; }

/* ── Opciones (provincia, estado…) ──────────────────────────── */
.imf-option-list,
.imf-checkbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.imf-option-list li,
.imf-checkbox-list li { margin: 0; }

.imf-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 18px;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  color: var(--imf-text);
  transition: background .15s, color .15s;
}
.imf-option:hover { background: var(--imf-cream-light); color: var(--imf-green); }
.imf-option.imf-selected {
  font-weight: 600;
  color: var(--imf-green);
  background: var(--imf-cream-light);
}

.imf-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.imf-checkbox-list label:hover { background: var(--imf-cream-light); color: var(--imf-green); }
.imf-checkbox-list input[type="checkbox"] {
  accent-color: var(--imf-green);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Acciones del panel ─────────────────────────────────────── */
.imf-dropdown-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 6px;
  border-top: 1px solid var(--imf-border);
  margin-top: 6px;
}
.imf-dropdown-actions button {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  background: var(--imf-bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--imf-transition);
}
.imf-dropdown-actions button:first-child {
  background: var(--imf-green);
  color: #fff;
  border-color: var(--imf-green);
}
.imf-dropdown-actions button:first-child:hover {
  background: var(--imf-green-dark);
  border-color: var(--imf-green-dark);
}
.imf-dropdown-actions button:last-child { color: var(--imf-muted); }
.imf-dropdown-actions button:last-child:hover {
  background: var(--imf-cream-light);
  color: var(--imf-green);
  border-color: var(--imf-cream-dark);
}

/* ══════════════════════════════════════════════════════════════
   PANEL NUMÉRICO — Habitaciones / Baños
   ══════════════════════════════════════════════════════════════ */

.imf-number-panel {
  min-width: 280px;
  padding: 16px 14px 6px;
}

.imf-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.imf-num-btn {
  flex: 1;
  min-width: 48px;
  height: 38px;
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  background: var(--imf-bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--imf-transition);
  color: var(--imf-text);
}
.imf-num-btn:hover {
  background: var(--imf-cream-light);
  border-color: var(--imf-green);
  color: var(--imf-green);
}
.imf-num-btn.imf-num-active {
  background: var(--imf-green);
  color: #fff;
  border-color: var(--imf-green);
  font-weight: 700;
}

.imf-exact-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--imf-muted);
  padding: 0 2px 12px;
  cursor: pointer;
  letter-spacing: .03em;
}
.imf-exact-label input {
  accent-color: var(--imf-green);
  cursor: pointer;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   PANEL DE CARACTERÍSTICAS — Grid de iconos
   ══════════════════════════════════════════════════════════════ */

.imf-icons-panel {
  min-width: 340px;
  padding: 14px 14px 6px;
}

.imf-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 4px;
  padding-right: 2px;
}
.imf-icon-grid::-webkit-scrollbar { width: 3px; }
.imf-icon-grid::-webkit-scrollbar-track { background: transparent; }
.imf-icon-grid::-webkit-scrollbar-thumb { background: var(--imf-cream-dark); border-radius: 2px; }

.imf-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  background: var(--imf-bg);
  font-size: 11px;
  letter-spacing: .02em;
  cursor: pointer;
  text-align: center;
  transition: var(--imf-transition);
  line-height: 1.3;
  color: var(--imf-muted);
}
.imf-icon-card:hover {
  background: var(--imf-cream-light);
  border-color: var(--imf-green);
  color: var(--imf-green);
}
.imf-icon-card.imf-icon-active {
  border-color: var(--imf-green);
  background: var(--imf-green);
  color: #fff;
  font-weight: 600;
}
.imf-icon-card.imf-icon-active .imf-icon-img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.imf-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  opacity: .7;
  transition: opacity .2s;
}
.imf-icon-card:hover .imf-icon-img { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   PANEL DE PRECIO
   ══════════════════════════════════════════════════════════════ */

.imf-price-panel {
  min-width: 320px;
  padding: 16px 14px 6px;
}

.imf-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.imf-price-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.imf-price-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--imf-muted);
}

.imf-price-min,
.imf-price-max,
.imf-sup-min,
.imf-sup-max {
  width: 100%;
  padding: 9px 28px 9px 12px;
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  font-size: 13px;
  background: var(--imf-bg);
  color: var(--imf-text);
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7a6e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.imf-price-min:focus,
.imf-price-max:focus,
.imf-sup-min:focus,
.imf-sup-max:focus {
  outline: none;
  border-color: var(--imf-green);
}
.imf-price-min:hover,
.imf-price-max:hover,
.imf-sup-min:hover,
.imf-sup-max:hover { border-color: var(--imf-cream-dark); }

/* ══════════════════════════════════════════════════════════════
   BARRA DE ESTADO (chips de filtros activos)
   ══════════════════════════════════════════════════════════════ */

.imf-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--imf-muted);
  letter-spacing: .02em;
}

.imf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.imf-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--imf-cream-light);
  border: 1px solid var(--imf-cream-dark);
  border-radius: 20px;
  padding: 3px 10px 3px 12px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--imf-green);
  font-weight: 500;
}
.imf-tag button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  color: var(--imf-green);
  line-height: 1;
  opacity: .55;
  transition: opacity .15s;
}
.imf-tag button:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   GRID DE TARJETAS
   ══════════════════════════════════════════════════════════════ */

.imf-grid {
  display: grid;
  gap: var(--imf-gap);
}
.imf-cols-4 { grid-template-columns: repeat(4, 1fr); }
.imf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.imf-cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1199px) {
  .imf-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 899px) {
  .imf-cols-4,
  .imf-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .imf-cols-4,
  .imf-cols-3,
  .imf-cols-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   TARJETA DE INMUEBLE — estética Novara / YOOtheme
   ══════════════════════════════════════════════════════════════ */

/* ── Artículo ───────────────────────────────────────────────── */
.imf-card {
  background:    #fff;
  display:       flex;
  flex-direction: column;
  overflow:      hidden;
  position:      relative;
  /* Sin borde ni sombra: igual que YOOtheme sobre fondo claro */
}

/* ── Enlace ──────────────────────────────────────────────────── */
.imf-card-link {
  display:         flex;
  flex-direction:  column;
  color:           inherit;
  text-decoration: none;
  height:          100%;
}
.imf-card-link:hover { text-decoration: none; }

/* ── Imagen ──────────────────────────────────────────────────── */
.imf-card-img-wrap {
  overflow:   hidden;
  position:   relative;
  /* Ratio 8:5 — idéntico al grid YOOtheme (800×500) */
  aspect-ratio: 8 / 5;
  background: var(--imf-cream-light);
}
.imf-card-img {
  display:    block;
  width:      100%;
  height:     100%;
  object-fit: cover;
  /* zoom suave al hover — mirror de uk-transition-scale-up */
  transition: transform .5s ease;
}
.imf-card:hover .imf-card-img {
  transform: scale(1.04);
}
.imf-card-no-img {
  width:      100%;
  height:     100%;
  background: var(--imf-cream-light);
}

/* ── Badge vendido ───────────────────────────────────────────── */
.imf-vendido-badge {
  position:       absolute;
  top:            14px;
  left:           14px;
  background:     var(--imf-green);
  color:          #fff;
  font-size:      10px;
  font-weight:    700;
  letter-spacing: .1em;
  padding:        4px 10px;
  border-radius:  var(--imf-radius);
  pointer-events: none;
  z-index:        2;
}

/* Tarjeta vendida: imagen desaturada */
.imf-card-vendido .imf-card-img {
  filter: grayscale(30%) brightness(.95);
}

/* ── Cuerpo ──────────────────────────────────────────────────── */
.imf-card-body {
  padding:    12px 0 4px;
  display:    flex;
  flex-direction: column;
  gap:        2px;
  flex:       1;
}

/* ── Meta (ciudad) ───────────────────────────────────────────── */
.imf-card-meta {
  margin:         0;
  font-size:      11px;
  font-weight:    600;
  letter-spacing: .1em;
  color:          var(--imf-muted);
  text-transform: uppercase;
  line-height:    1.4;
}

/* ── Fila título + precio ─────────────────────────────────────── */
.imf-card-row {
  display:     flex;
  align-items: baseline;
  gap:         8px;
  margin-top:  2px;
}

/* ── Título (sitio / barrio) ─────────────────────────────────── */
.imf-card-title {
  margin:      0;
  font-size:   17px;
  font-weight: 700;
  line-height: 1.25;
  color:       var(--imf-text);
  flex:        1;
  /* Evitar que el precio empuje el título a multilínea */
  min-width:   0;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

/* ── Precio ──────────────────────────────────────────────────── */
.imf-card-price {
  font-size:   15px;
  font-weight: 700;
  color:       #c0392b;   /* rojo uk-text-danger */
  white-space: nowrap;
  flex-shrink: 0;
  margin:      0;
}
.imf-price-vendido {
  color:       var(--imf-muted);
  font-size:   12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* Vendido: precio atenuado */
.imf-card-vendido .imf-card-price { color: var(--imf-muted); }

/* ── Specs (m², hab, baños) ──────────────────────────────────── */
.imf-card-specs {
  display:     flex;
  gap:         14px;
  list-style:  none;
  margin:      6px 0 0;
  padding:     0;
  flex-wrap:   wrap;
}
.imf-spec {
  display:     flex;
  align-items: center;
  gap:         5px;
  font-size:   12px;
  color:       var(--imf-muted);
  line-height: 1;
}
.imf-spec svg {
  color:       var(--imf-muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   PAGINACIÓN
   ══════════════════════════════════════════════════════════════ */

.imf-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}

.imf-page-btn {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--imf-border);
  border-radius: var(--imf-radius);
  background: var(--imf-bg);
  font-size: 13px;
  cursor: pointer;
  transition: var(--imf-transition);
  padding: 0 12px;
  color: var(--imf-muted);
}
.imf-page-btn:hover {
  background: var(--imf-cream-light);
  border-color: var(--imf-green);
  color: var(--imf-green);
}
.imf-page-btn.imf-page-active {
  background: var(--imf-green);
  color: #fff;
  border-color: var(--imf-green);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   SIN RESULTADOS
   ══════════════════════════════════════════════════════════════ */

.imf-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--imf-muted);
  font-size: 15px;
}

/* ══════════════════════════════════════════════════════════════
   ESTADO DE CARGA
   ══════════════════════════════════════════════════════════════ */

/* Overlay: solo sirve para la barra de progreso, no cubre el grid */
.imf-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;        /* Solo la altura de la barra */
  background: transparent;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}
.imf-loading-overlay[hidden] { display: none; }

/* Barra de progreso animada */
.imf-loading-overlay::before {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--imf-green) 30%,
    var(--imf-green-light) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: imf-progress 1s ease-in-out infinite;
}

/* El grid se atenúa ligeramente mientras carga */
.imf-listing-wrapper.imf-is-loading .imf-grid {
  opacity: 0.75;
  transition: opacity .1s;
  pointer-events: none;
}
.imf-listing-wrapper:not(.imf-is-loading) .imf-grid {
  opacity: 1;
  transition: opacity .2s;
}

/* Spinner ya no es necesario — lo eliminamos */
.imf-spinner { display: none; }

@keyframes imf-spin { to { transform: rotate(360deg); } }
@keyframes imf-progress {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN — Botón primario
   ══════════════════════════════════════════════════════════════ */

.button-primary-imf {
  background: var(--imf-green) !important;
  color: #fff !important;
  border-color: var(--imf-green-dark) !important;
  font-weight: 600 !important;
  letter-spacing: .04em !important;
}
.button-primary-imf:hover {
  background: var(--imf-green-dark) !important;
  border-color: var(--imf-green-dark) !important;
}

/* ══════════════════════════════════════════════════════════════
   ESCRITORIO — Forzar layout horizontal de la barra de filtros
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 861px) {
  /* El drawer-body envuelve tabs + filtros pero en escritorio
     debe desaparecer del layout para que sus hijos participen
     directamente en el flex horizontal del filter-bar.
     display:contents hace exactamente eso. */
  .imf-drawer-body {
    display: contents;
  }

  /* Barra visible y horizontal, sin posición fija */
  .imf-filter-bar {
    display:        flex !important;
    flex-direction: row !important;
    flex-wrap:      wrap !important;
    align-items:    center !important;
    position:       static !important;
    transform:      none !important;
    overflow:       visible !important;
    height:         auto !important;
    background:     transparent !important;
    padding:        0 !important;
  }

  /* Paneles desplegables: posición absoluta, ocultos por defecto */
  .imf-filter-bar .imf-dropdown-panel {
    display:   none !important;
    position:  absolute !important;
  }
  .imf-filter-bar .imf-dropdown-toggle[aria-expanded="true"] + .imf-dropdown-panel,
  .imf-filter-bar .imf-dropdown-panel:not([hidden]) {
    display:   block !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   MÓVIL — Drawer de filtros
   ══════════════════════════════════════════════════════════════ */

/* Elementos solo-drawer: ocultos en escritorio */
.imf-drawer-header,
.imf-drawer-footer,
.imf-mobile-fab-bar {
  display: none;
}

@media (max-width: 860px) {

  /* ── Ocultar barra de escritorio ──────────────────────────── */
  .imf-filter-bar {
    display:        none;
    /* Drawer: ocupa toda la pantalla, por encima de WhatsApp y cualquier widget */
    position:       fixed;
    top:            0;
    left:           0;
    right:          0;
    bottom:         0;
    z-index:        2147483647; /* Máximo z-index posible en CSS */
    flex-direction: column;
    gap:            0;
    height:         100%;
    /* El contenedor NO scrollea — lo hace .imf-drawer-body */
    overflow:       hidden;
    background:     #fff;
    border-radius:  0;
    box-shadow:     none;
    padding:        0;
    border-bottom:  none;
    transform:      translateY(100%);
    transition:     transform .32s cubic-bezier(.4,0,.2,1);
    box-sizing:     border-box;
    width:          100%;
  }

  /* ── Zona scrollable del drawer (única zona que hace scroll en iOS) ─ */
  .imf-drawer-body {
    flex:                       1 1 auto;
    min-height:                 0;       /* CRÍTICO: sin esto el flex item no se limita y overflow no activa */
    overflow-y:                 scroll;  /* scroll, no auto — iOS necesita scroll explícito */
    overflow-x:                 hidden;
    -webkit-overflow-scrolling: touch;   /* Inercia en iOS */
    overscroll-behavior:        contain;
    padding:                    0 16px 16px;
    box-sizing:                 border-box;
    width:                      100%;
    touch-action:               pan-y;
  }

  /* Drawer abierto */
  .imf-listing-wrapper.imf-drawer-open .imf-filter-bar {
    display:    flex;
    transform:  translateY(0);
  }

  /* ── Backdrop (ahora oculto porque el drawer es pantalla completa) ── */
  .imf-drawer-backdrop { display: none !important; }

  /* ── Cabecera del drawer ──────────────────────────────────── */
  .imf-drawer-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         18px 20px 14px;
    border-bottom:   1px solid var(--imf-border);
    position:        sticky;
    top:             0;
    background:      #fff;
    z-index:         1;
    flex-shrink:     0;
  }
  .imf-drawer-title {
    font-size:      15px;
    font-weight:    700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color:          var(--imf-green);
  }
  .imf-drawer-close {
    background:  none;
    border:      none;
    cursor:      pointer;
    font-size:   20px;
    line-height: 1;
    color:       var(--imf-muted);
    padding:     4px 8px;
    border-radius: var(--imf-radius);
    transition:  color .15s;
  }
  .imf-drawer-close:hover { color: var(--imf-text); }

  /* ── Todos los hijos respetan el ancho del drawer ────────────── */
  .imf-filter-bar *,
  .imf-filter-bar *::before,
  .imf-filter-bar *::after {
    box-sizing: border-box;
    max-width:  100%;
  }

  /* ── Grupos de filtro en el drawer: expandidos, sin dropdown ─ */
  .imf-filter-bar .imf-tab-group {
    order:          -1;
    border-right:   none;
    border-bottom:  1px solid var(--imf-border);
    padding:        12px 20px;
    gap:            8px;
    flex-shrink:    0;
    flex-wrap:      wrap;   /* tabs se envuelven si no caben */
  }
  .imf-filter-bar .imf-filter-tab {
    padding:     10px 18px;
    border:      1.5px solid var(--imf-border);
    border-bottom: 2px solid transparent;
    border-radius: 100px;
    font-size:   12px;
  }
  .imf-filter-bar .imf-filter-tab.imf-tab-active {
    border-color:     var(--imf-green);
    color:            var(--imf-green);
    background:       var(--imf-cream-light);
  }

  .imf-filter-bar .imf-filter-group {
    border-bottom:  1px solid var(--imf-border);
    flex-direction: column;
    padding:        0;
    width:          100%;
  }

  /* Label de sección (no-interactivo en el drawer) */
  .imf-filter-bar .imf-dropdown-toggle {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    width:           100%;
    padding:         14px 20px;
    font-size:       12px;
    font-weight:     700;
    letter-spacing:  .06em;
    text-transform:  uppercase;
    color:           var(--imf-text);
    background:      none;
    border:          none;
    cursor:          default;
    pointer-events:  none;
  }
  .imf-filter-bar .imf-dropdown-toggle .imf-caret { display: none; }

  /* Paneles siempre visibles en el drawer */
  .imf-filter-bar .imf-dropdown-panel {
    display:        block !important;
    position:       static !important;
    box-shadow:     none !important;
    border:         none !important;
    padding:        0 20px 14px !important;
    min-width:      0 !important;
    width:          100% !important;
    visibility:     visible !important;
    opacity:        1 !important;
    overflow:       visible !important;
  }
  .imf-listing-wrapper.imf-drawer-open .imf-filter-bar [hidden] {
    display: block !important;
  }

  /* Acciones dentro de cada sección: ocultar en drawer (hay footer global) */
  .imf-filter-bar .imf-dropdown-actions { display: none; }

  /* Número de habitaciones/baños */
  .imf-filter-bar .imf-btn-group {
    flex-wrap: wrap;
    gap:       8px;
    padding:   0;
  }
  .imf-filter-bar .imf-num-btn {
    flex:          0 0 auto;
    min-width:     52px;
    padding:       9px 14px;
    border-radius: 100px;
  }

  /* Opciones de lista (provincia, estado): chips en líneas */
  .imf-filter-bar .imf-option-list {
    display:    flex;
    flex-wrap:  wrap;
    gap:        8px;
    list-style: none;
    margin:     0;
    padding:    0;
    width:      100%;
  }
  .imf-filter-bar .imf-option {
    padding:       8px 16px;
    border-radius: 100px;
    border:        1.5px solid var(--imf-border);
    background:    none;
    font-size:     13px;
    cursor:        pointer;
    transition:    all .15s;
    white-space:   nowrap;
  }
  .imf-filter-bar .imf-option.imf-selected,
  .imf-filter-bar .imf-option:hover {
    border-color: var(--imf-green);
    color:        var(--imf-green);
    background:   var(--imf-cream-light);
  }

  /* Precio: selects apilados y full-width */
  .imf-filter-bar .imf-price-row   { flex-direction: column; gap: 10px; width: 100%; }
  .imf-filter-bar .imf-price-col   { width: 100%; }
  .imf-filter-bar .imf-price-min,
  .imf-filter-bar .imf-price-max,
  .imf-filter-bar .imf-sup-min,
  .imf-filter-bar .imf-sup-max    { width: 100%; min-width: 0; }

  /* Características: grid adaptable, sin desbordamiento */
  .imf-filter-bar .imf-icons-panel { min-width: 0; width: 100%; }
  .imf-filter-bar .imf-icon-grid {
    grid-template-columns: repeat(3, 1fr);
    gap:                   8px;
    max-height:            none;   /* Eliminar scroll interno en drawer */
    width:                 100%;
  }
  .imf-filter-bar .imf-icon-card  { padding: 10px 6px; font-size: 11px; }

  /* ── Pie del drawer ───────────────────────────────────────── */
  .imf-drawer-footer {
    display:         flex;
    gap:             12px;
    padding:         16px 20px calc(16px + env(safe-area-inset-bottom, 0));
    border-top:      1px solid var(--imf-border);
    /* NO position:sticky — no funciona dentro de overflow:hidden.
       El flex col + flex-shrink:0 ya lo ancla abajo. */
    background:      #fff;
    flex-shrink:     0;
  }
  .imf-drawer-clear {
    flex:            1;
    padding:         14px;
    background:      none;
    border:          1.5px solid var(--imf-border);
    border-radius:   var(--imf-radius);
    font-size:       13px;
    font-weight:     600;
    cursor:          pointer;
    color:           var(--imf-text);
    transition:      border-color .15s;
  }
  .imf-drawer-clear:hover { border-color: var(--imf-green); color: var(--imf-green); }

  .imf-drawer-apply {
    flex:            2;
    padding:         14px;
    background:      var(--imf-green);
    border:          none;
    border-radius:   var(--imf-radius);
    font-size:       13px;
    font-weight:     700;
    letter-spacing:  .04em;
    color:           #fff;
    cursor:          pointer;
    transition:      background .15s;
  }
  .imf-drawer-apply:hover { background: var(--imf-green-dark); }

  /* ── Botón FAB ────────────────────────────────────────────── */
  .imf-mobile-fab-bar {
    display:         flex;
    position:        sticky;
    bottom:          16px;
    z-index:         500;
    justify-content: center;
    pointer-events:  none;
    margin:          12px 0 4px;
  }
  .imf-mobile-filtros-btn {
    display:         flex;
    align-items:     center;
    gap:             8px;
    pointer-events:  all;
    padding:         14px 28px;
    background:      var(--imf-green);
    color:           #fff;
    border:          none;
    border-radius:   100px;
    font-size:       14px;
    font-weight:     700;
    letter-spacing:  .05em;
    box-shadow:      0 4px 20px rgba(29,78,63,.35);
    cursor:          pointer;
    transition:      background .15s, transform .1s, box-shadow .15s;
  }
  .imf-mobile-filtros-btn:hover {
    background:  var(--imf-green-dark);
    box-shadow:  0 6px 24px rgba(29,78,63,.45);
    transform:   translateY(-1px);
  }
  .imf-mobile-filtros-btn:active { transform: translateY(0); }

  .imf-mobile-count {
    display:        inline-flex;
    align-items:    center;
    justify-content: center;
    background:     #fff;
    color:          var(--imf-green);
    border-radius:  100px;
    font-size:      11px;
    font-weight:    800;
    min-width:      20px;
    height:         20px;
    padding:        0 5px;
    margin-left:    2px;
  }

  /* En drawer abierto, el FAB queda detrás del backdrop */
  .imf-listing-wrapper.imf-drawer-open .imf-mobile-fab-bar { z-index: 0; }

  /* Ocultar barra de tabs en desktop (las tabs están en el drawer en móvil) */
  /* ya están dentro del filter-bar, así que se muestran dentro del drawer */

}

/* ── Mapa Leaflet ───────────────────────────────────────────────────────────── */
.imf-map-section {
  margin-top: 3rem;
}

.imf-map-title {
  font-size:      26px;
  font-weight:    600;
  letter-spacing: 0.1em;
  text-transform: none;
  color:          #002c1a;
  margin-bottom:  1.25rem;
}

.imf-map {
  width:         100%;
  border-radius: 8px;
  overflow:      hidden;
  border:        1px solid var(--imf-border);
  box-shadow:    0 2px 12px rgba(0,0,0,.06);
}

/* Icono personalizado (div-icon) */
.imf-map-marker {
  background: none !important;
  border:     none !important;
}
.imf-map-marker svg {
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.35));
  transition: filter .2s;
}
.imf-map-marker:hover svg {
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.5));
}

/* Popup */
.leaflet-popup-content-wrapper {
  border-radius: 6px !important;
  box-shadow:    0 4px 20px rgba(0,0,0,.15) !important;
}
.imf-popup-link {
  display:         block;
  text-decoration: none;
  color:           var(--imf-text);
}
.imf-popup-title {
  display:       block;
  font-size:     .875rem;
  font-weight:   600;
  line-height:   1.35;
  margin-bottom: .3rem;
}
.imf-popup-precio {
  display:     block;
  font-size:   .8rem;
  font-weight: 700;
  color:       var(--imf-green);
}
