/* ==========================================================================
   buscar.css · RedVivienda · buscador con vista de listado y de mapa
   ========================================================================== */

.rv-buscar { background: #F7F9FB; margin: 0; }

.buscador {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  gap: 1.25rem;
  width: 95vw;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1rem 0 2rem;
  align-items: start;
}

/* --- columna de filtros ------------------------------------------------------ */
.filtros {
  position: sticky;
  top: 1rem;
  max-height: calc(100dvh - 5.5rem);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #E4E9EE;
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1.3rem;
}
.filtros__form { display: grid; gap: 1.1rem; }
.filtro { display: grid; gap: .35rem; }
.filtro__titulo { margin: 0 0 .15rem; font-size: .92rem; font-weight: 600; color: #16202A; }
.filtro__select,
.filtro__num {
  width: 100%;
  padding: .55rem .7rem;
  font: inherit;
  font-size: .92rem;
  color: #16202A;
  background: #fff;
  border: 1px solid #D5DDE4;
  border-radius: 10px;
}
.filtro__select:focus,
.filtro__num:focus {
  outline: none;
  border-color: #1C7FC4;
  box-shadow: 0 0 0 3px rgba(28, 127, 196, .15);
}
.filtro__par { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.filtro__casilla {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem;
  align-items: center;
  font-size: .89rem;
  color: #33424F;
  cursor: pointer;
  padding: .12rem 0;
}
.filtro__casilla input { width: 1rem; height: 1rem; accent-color: #1C7FC4; }
.filtros__pie {
  position: sticky;
  bottom: -1.3rem;
  display: grid;
  gap: .4rem;
  padding: .8rem 0 .2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 25%);
}
.filtros__pie .boton,
.filtros__pie .boton-fino { text-align: center; text-decoration: none; }

/* --- resultados --------------------------------------------------------------- */
.resultados {
  background: #fff;
  border: 1px solid #E4E9EE;
  border-radius: 18px;
  padding: 1.2rem 1.4rem 1.6rem;
  min-height: calc(100dvh - 6rem);
}
.resultados__cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid #EDF1F5;
  margin-bottom: 1rem;
}
.resultados__titulo { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -.015em; color: #16202A; }
.resultados__zona { margin: .2rem 0 0; font-size: .86rem; color: #6C7A87; }
.resultados__mandos { display: flex; align-items: center; gap: .6rem; }

/* --- conmutador listado / mapa ------------------------------------------------- */
.vistas {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 2px;
  background: #EEF3F8;
  border-radius: 999px;
}
.vista {
  padding: .4rem 1rem;
  font-size: .86rem;
  font-weight: 600;
  color: #5B6B78;
  text-decoration: none;
  border-radius: 999px;
}
.vista:hover { color: #0B4F82; }
.vista.es-activa { color: #fff; background: #16202A; }

/* --- fichas del listado --------------------------------------------------------- */
.listado { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.anuncio {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem;
  padding: .8rem;
  border: 1px solid #E4E9EE;
  border-radius: 16px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.anuncio:hover {
  border-color: #D2DCE4;
  box-shadow: 0 10px 24px -14px rgba(16, 42, 66, .5);
  transform: translateY(-1px);
}
.anuncio__foto {
  display: grid;
  place-items: center;
  height: 9rem;
  font-size: 2.4rem;
  background: #EEF5FB;
  border-radius: 13px;
  text-decoration: none;
}
.anuncio__cuerpo { display: grid; gap: .3rem; align-content: start; min-width: 0; }
.anuncio__titulo {
  font-size: 1.02rem;
  font-weight: 600;
  color: #0B4F82;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anuncio__titulo:hover { text-decoration: underline; }
.anuncio__precio { margin: 0; font-size: 1.35rem; font-weight: 700; color: #16202A; }
.anuncio__precio small { font-size: .6em; font-weight: 600; color: #6C7A87; }
.anuncio__m2 { margin-left: .5rem; font-size: .8rem; font-weight: 600; color: #6C7A87; }
.anuncio__datos { margin: 0; font-size: .89rem; color: #4A5A67; }
.anuncio__extras { margin: .1rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.etiqueta-extra {
  padding: .1rem .5rem;
  font-size: .74rem;
  font-weight: 600;
  color: #14649D;
  background: #EAF3FA;
  border-radius: 999px;
}

/* --- vista de mapa --------------------------------------------------------------- */
.buscador--mapa .resultados { padding-bottom: 1rem; }
.mapa-caja { display: grid; gap: .5rem; }
.mapa-caja__lienzo {
  height: calc(100dvh - 14rem);
  min-height: 26rem;
  border-radius: 16px;
  overflow: hidden;
  background: #E9EEF3;
}
.mapa-caja__nota { margin: 0; font-size: .82rem; color: #6C7A87; }

/* --- vacío y páginas -------------------------------------------------------------- */
.vacio-buscar {
  display: grid;
  gap: .4rem;
  justify-items: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: #6C7A87;
  background: #FBFCFD;
  border: 1px solid #E4E9EE;
  border-radius: 16px;
}
.vacio-buscar strong { font-size: 1.05rem; color: #23303B; }

.paginas { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1.2rem; }
.pagina {
  min-width: 2.2rem;
  padding: .4rem .6rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: #33424F;
  text-decoration: none;
  border: 1px solid #DDE3E9;
  border-radius: 10px;
}
.pagina:hover { border-color: #B9C6D2; }
.pagina.es-activa { color: #fff; background: #16202A; border-color: #16202A; }

@media (max-width: 60rem) {
  .buscador { grid-template-columns: 1fr; width: 96vw; }
  .filtros { position: static; max-height: none; }
  .anuncio { grid-template-columns: 1fr; }
  .anuncio__foto { height: 11rem; }
}


/* ==========================================================================
   Piezas al estilo de los grandes portales inmobiliarios
   ========================================================================== */

/* --- caja de «guardar búsqueda» ---------------------------------------------- */
.guardar {
  display: grid;
  gap: .5rem;
  padding: .85rem;
  margin-bottom: 1rem;
  background: #F2F8E9;
  border: 1px solid #DDEBC6;
  border-radius: 14px;
  text-align: center;
}
.guardar__texto { margin: 0; font-size: .86rem; font-weight: 600; color: #3F5B22; }
.guardar__boton {
  padding: .6rem .9rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  background: #1C7FC4;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.guardar__boton:hover { background: #14649D; }
.filtros__aviso {
  margin: 0 0 .8rem;
  padding: .6rem .75rem;
  font-size: .84rem;
  color: #0B4F82;
  background: #EAF3FA;
  border: 1px solid #CFE4F4;
  border-radius: 10px;
}

/* --- enlace a la otra vista -------------------------------------------------- */
.minimapa {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .55rem;
  padding: .7rem .8rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: #14649D;
  text-decoration: none;
  background: #F4F9FD;
  border: 1px solid #D7E6F2;
  border-radius: 12px;
}
.minimapa:hover { background: #EAF3FA; border-color: #B9D6EC; }
.minimapa__icono { font-size: 1.1rem; }

/* --- pestañas de operación ---------------------------------------------------- */
.ops {
  display: flex;
  gap: 1.4rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid #EDF1F5;
}
.op {
  position: relative;
  padding: .1rem 0 .7rem;
  font-size: .98rem;
  font-weight: 600;
  color: #5B6B78;
  text-decoration: none;
}
.op:hover { color: #16202A; }
.op.es-activa { color: #0B4F82; }
.op.es-activa::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: #1C7FC4;
  border-radius: 2px;
}

/* --- orden en píldoras --------------------------------------------------------- */
.orden { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.orden__texto { font-size: .84rem; color: #6C7A87; margin-right: .1rem; }
.orden__pildora {
  padding: .32rem .75rem;
  font-size: .84rem;
  font-weight: 600;
  color: #33424F;
  text-decoration: none;
  border: 1px solid #DDE3E9;
  border-radius: 999px;
}
.orden__pildora:hover { border-color: #B9C6D2; }
.orden__pildora.es-activa { color: #fff; background: #16202A; border-color: #16202A; }
.orden__mas {
  padding: .32rem .6rem;
  font: inherit;
  font-size: .84rem;
  color: #33424F;
  background: #fff;
  border: 1px solid #DDE3E9;
  border-radius: 999px;
}

/* --- acciones de cada ficha ------------------------------------------------------ */
.anuncio__acciones { margin: .25rem 0 0; display: flex; align-items: center; gap: .5rem; }
.accion {
  padding: .38rem .8rem;
  font-size: .84rem;
  font-weight: 600;
  color: #fff;
  background: #1C7FC4;
  border-radius: 9px;
  text-decoration: none;
}
.accion:hover { background: #14649D; }
.accion--suave { color: #14649D; background: #fff; border: 1px solid #C7D9E7; }
.accion--suave:hover { background: #F2F8FD; }
.accion__corazon { margin-left: auto; font-size: 1.15rem; color: #9AA8B4; cursor: pointer; }
.accion__corazon:hover { color: #C2185B; }

/* --- vista de mapa a pantalla ancha ---------------------------------------------- */
.buscador--mapa { grid-template-columns: 19rem minmax(0, 1fr); }
.buscador--mapa .resultados { padding: .9rem 1rem 1rem; }
.buscador--mapa .mapa-caja__lienzo { height: calc(100dvh - 13rem); }


/* Dirección de cada ficha: exacta por defecto, «zona aproximada» si el
   anunciante ha contratado ocultarla. */
.anuncio__donde { margin: 0; font-size: .86rem; font-weight: 600; color: #14649D; }
.anuncio__donde.es-aproximada { color: #8A7300; font-weight: 500; font-style: italic; }


/* Desglose de un grupo de tipos («Pisos, áticos y dúplex» → sus tres). */
.filtro__desglose { margin: -.1rem 0 .15rem 1.5rem; }
.filtro__desglose summary {
  font-size: .8rem;
  color: #14649D;
  cursor: pointer;
  list-style: none;
  padding: .05rem 0;
}
.filtro__desglose summary::-webkit-details-marker { display: none; }
.filtro__desglose summary::after { content: " ▾"; }
.filtro__desglose[open] summary::after { content: " ▴"; }
.filtro__desglose .filtro__casilla { font-size: .85rem; }


/* Botones del formulario de filtros. Se definen aquí porque esta hoja la
   cargan tanto el listado como el mapa; panel.css no llega al mapa. */
.filtros__pie .boton,
.filtros__pie .boton-fino {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
}
.boton {
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.boton--principal {
  color: #fff;
  background: linear-gradient(180deg, #2A8FD4 0%, #1C7FC4 100%);
  box-shadow: 0 8px 18px -10px rgba(28, 127, 196, .9);
}
.boton--principal:hover { background: linear-gradient(180deg, #2385CB 0%, #14649D 100%); }
.boton-fino {
  padding: .5rem .85rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  color: #14649D;
  background: #fff;
  border: 1px solid #C7D9E7;
  border-radius: 9px;
  cursor: pointer;
}
.boton-fino:hover { background: #F2F8FD; }


/* --- familias de tipo de vivienda ------------------------------------------- */
.familia { margin-bottom: .1rem; }
.familia__cabecera {
  display: flex;
  align-items: center;
  gap: .3rem;
  list-style: none;
  cursor: pointer;
}
.familia__cabecera::-webkit-details-marker { display: none; }
.familia__cabecera::after {
  content: "⌄";
  font-size: .95rem;
  color: #6C7A87;
  line-height: 1;
}
.familia[open] .familia__cabecera::after { content: "⌃"; }
.familia__cabecera .filtro__casilla { margin: 0; }
.familia__hijos { display: grid; gap: .05rem; margin: .1rem 0 .35rem 1.6rem; }



/* --- «Ver más» de las denominaciones ------------------------------------------
   El resumen se coloca DEBAJO de la lista, como en los portales al uso: el
   enlace queda al final del bloque tanto abierto como cerrado.
   ---------------------------------------------------------------------------- */
.mas-denominaciones { display: grid; }
.mas-denominaciones__lista { display: none; gap: .05rem; }
.mas-denominaciones[open] .mas-denominaciones__lista { display: grid; }
.mas-denominaciones__boton {
  order: 2;
  padding: .25rem 0 .1rem;
  font-size: .86rem;
  font-weight: 600;
  color: #14649D;
  cursor: pointer;
  list-style: none;
}
.mas-denominaciones__boton::-webkit-details-marker { display: none; }
.mas-denominaciones__boton::after { content: " ⌄"; }
.mas-denominaciones[open] .mas-denominaciones__boton::after { content: " ⌃"; }
.mas-denominaciones .es-abierto { display: none; }
.mas-denominaciones[open] .es-abierto { display: inline; }
.mas-denominaciones[open] .es-cerrado { display: none; }
