/* HotVal — Loop de anuncios (compartido: home, taxonomías, etc.). */

/* El wrap del loop ocupa el 100% del ancho. */
.anuncios-wrap {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Máximo 4 columnas; cada card como mucho 400px de ancho; grid centrado. */
.anuncios-loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 400px));
  gap: 14px;
  justify-content: center;
}
.anuncios-empty { grid-column: 1 / -1; text-align: center; color: var(--hv-muted); padding: 40px; }

/* --- Caja --- */
.anuncio-card {
  background: #1b1b1b;
  border: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Reserva el área de imagen (mismo tamaño con o sin foto) para que las cards
   respeten su altura y el texto quede alineado aunque falte la foto. */
.anuncio-card__link { display: block; line-height: 0; aspect-ratio: 400 / 600; overflow: hidden; background: #111; }
.anuncio-card__link img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Marcador cuando no hay foto aprobada (coherente con la ficha, que oculta la galería). */
.anuncio-card__noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: #1b1b1b; }
.anuncio-card__noimg::after { content: "hotvalencia"; color: #3a3a3a; font-weight: 800; font-size: 15px; letter-spacing: 1px; }

/* Banner: solo imagen, sin franja de info. La imagen llena toda la celda. */
.anuncio-card--banner .anuncio-card__link { aspect-ratio: auto; height: 100%; flex: 1 1 auto; }

/* Casa: título "Ver chicas / nombre / Tel." centrado, sin descripción ni tarifa. */
.anuncio-card--casa .hot-title { text-align: center; font-size: 16px; line-height: 1.3; }
.anuncio-card--casa .hot-title a { display: block; }

/* Botones de acción (bandera + oferta + play): círculos solapando la imagen. */
.hot-action-buttons {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  margin-top: -30px; position: relative; z-index: 2;
}
.hot-action-buttons > div {
  width: 58px; height: 58px; border-radius: 50%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; text-align: center;
  overflow: hidden; border: 5px solid #1b1b1b;
}
.hot-action-buttons img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hab-oferta { font-size: 10px; font-weight: bold; line-height: 1.1; color: #111; padding: 4px; }
.hab-oferta--activa { background: #00cc00; }
.hab-oferta--prox { background: #CC0000; color: #fff; }
.btn-video { background: #222; cursor: pointer; }
.btn-video svg { width: 22px; height: 22px; margin-left: 2px; color: #fff; }
.btn-video:focus-visible { outline: 2px solid #6aa9ff; }

/* Vídeo cargado dentro de la card (oculta la imagen). */
.anuncio-card.has-video .anuncio-card__link { display: none; }
.anuncio-card__video { width: 100%; display: block; background: #000; aspect-ratio: 400 / 600; }

.anuncio-card__info { padding: 8px 14px 14px; display: flex; flex-direction: column; flex: 1 1 auto; }

.anuncio-card .hot-title {
  font-size: 18px; font-weight: 400; line-height: 1.2; margin: 0 0 6px; color: #fff;
}
.anuncio-card .hot-title a { color: #fff; text-decoration: none; }

.anuncio-card .hot-descripcion {
  font-size: 14px; line-height: 1.35; color: #cccccc; margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.anuncio-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.anuncio-card .meta .tag {
  border: 1px solid #555555; color: #cccccc; background: transparent; border-radius: 4px;
  padding: 3px 8px; font-size: 13px; line-height: 1.2; white-space: nowrap; font-weight: 700;
}
/* Etiqueta "Disponible" (según horario de hoy): texto verde. */
.anuncio-card .meta .tag--disponible { color: #2bbd2b; border-color: #2bbd2b; }
/* Etiqueta de distancia ("cerca de mí"): fondo rojo. */
.anuncio-card .meta .tag--distancia {
  background: #e23b3b; border-color: #e23b3b; color: #fff; font-weight: 700;
}
/* Badge de novedad: amarillo = primera vez, rojo = republicada. */
.anuncio-card .meta .tag--novedad { color: #111; font-weight: 700; }
.anuncio-card .meta .tag--novedad-nueva { background: #ffcc33; border-color: #ffcc33; }
.anuncio-card .meta .tag--novedad-repu  { background: #CC0000; border-color: #CC0000; color: #fff; }
/* Página "cerca de mí": título centrado con inicial en mayúscula. */
.cerca .home-intro { text-align: center; }
.cerca .home-intro__title { text-align: center; }
.cerca .home-intro__title::first-letter { text-transform: uppercase; }
/* Texto de estado. */
.cerca__estado { color: var(--hv-muted); font-size: 16px; margin-top: 8px; text-align: center; }

/* Overlay de carga (igual estilo que el del mapa). */
.cerca-loading {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(0,0,0,.55); transition: opacity .3s ease;
}
.cerca-loading.is-hidden { opacity: 0; pointer-events: none; }
.cerca-loading__spin {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25); border-top-color: var(--hv-accent, #CC0000);
  animation: hv-spin .8s linear infinite;
}
.cerca-loading__txt { margin: 0; color: #fff; font-family: var(--hv-font, sans-serif); font-size: 15px; font-weight: 600; }

/* Responsive: reducir columnas manteniendo el 100% de ancho. */
@media (max-width: 1200px) { .anuncios-loop { grid-template-columns: repeat(3, minmax(0, 400px)); } }
@media (max-width: 820px)  { .anuncios-loop { grid-template-columns: repeat(2, minmax(0, 400px)); } }
/* Móvil: un anuncio por fila. */
@media (max-width: 600px)  { .anuncios-loop { grid-template-columns: 1fr; } }
@media (max-width: 420px)  { .anuncios-loop { gap: 20px; } }

/* ===== Franja del mapa dentro del loop (solo home, tras los TOP) ===== */
/* Ocupa toda la fila del grid (como .anuncios-empty). */
.home-mapstrip { grid-column: 1 / -1; margin: 10px 0; }
.home-mapstrip__inner {
  background: #0d0d0d; border: 1px solid var(--hv-hairline, #2a2a2a); border-radius: 16px;
  padding: 20px; overflow: hidden;
}
.home-mapstrip__head { text-align: center; margin: 0 0 16px; }
.home-mapstrip__title { margin: 0; color: var(--hv-heading, #fff); font-size: 24px; font-weight: 800; }
.home-mapstrip__sub { margin: 4px 0 0; color: var(--hv-muted, #999); font-size: 15px; }

.home-mapstrip__mapwrap {
  position: relative; height: 340px; border-radius: 12px; overflow: hidden;
  background: #111; isolation: isolate;
}
.home-mapstrip__map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* Aspecto oscuro de los tiles (igual que el mapa grande). */
.home-mapstrip__map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.85); }
.home-mapstrip__map .leaflet-container { background: #111; font: inherit; }

/* Overlay/CTA. Base = botón en la esquina (escritorio: mapa interactivo). */
.home-mapstrip__overlay {
  position: absolute; right: 14px; bottom: 14px; z-index: 500;
  display: inline-flex; align-items: center; text-decoration: none;
}
.home-mapstrip__cta {
  background: #CC0000; color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.5);
  transition: background .2s ease;
}
.home-mapstrip__overlay:hover .home-mapstrip__cta { background: #e0132a; }

/* Marcadores con foto (replicados del mapa grande, sin depender de mapa.css). */
.home-mapstrip .leaflet-div-icon.hv-marker-icon { background: none; border: 0; }
.home-mapstrip .hv-marker { position: relative; width: 42px; height: 48px; cursor: pointer; }
.home-mapstrip .hv-marker img {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block;
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); background: #333;
}
.home-mapstrip .hv-marker.is-on img { border-color: #1db954; }
.home-mapstrip .hv-marker::after {
  content: ""; position: absolute; left: 50%; top: 40px; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #fff;
}
.home-mapstrip .hv-marker.is-on::after { border-top-color: #1db954; }

/* Globo simple (solo escritorio). */
.home-mapstrip .hv-map-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 12px; overflow: hidden; background: #000; }
.home-mapstrip .hv-map-popup .leaflet-popup-content { margin: 0; width: 220px !important; }
.home-mapstrip .hv-map-popup .leaflet-popup-tip { background: #000; }
.home-mapstrip .hv-iw__body { padding: 12px 14px; background: #000; }
.home-mapstrip .hv-iw__title { font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 .5rem !important; }
.home-mapstrip .hv-iw__actions { display: flex; }
.home-mapstrip .hv-iw__btn--ver {
  flex: 1 1 0; text-align: center; padding: 6px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-decoration: none; background: #fff; color: #000;
}
.home-mapstrip .hv-iw__btn--ver:hover { background: #e6e6e6; }

/* Móvil/tablet (≤820px): el mapa es una previa; el overlay cubre todo y lleva
   al mapa completo para no atrapar el scroll. */
@media (max-width: 820px) {
  .home-mapstrip__mapwrap { height: 230px; }
  .home-mapstrip__overlay {
    inset: 0; right: auto; bottom: auto; justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45));
  }
}
@media (max-width: 420px) {
  .home-mapstrip__inner { padding: 14px; }
  .home-mapstrip__title { font-size: 20px; }
}

/* ===== Slider (carrusel) — compartido: home + taxonomías ===== */
.home-slider { position: relative; padding: 60px 0; overflow: hidden; }
.home-slider__viewport { overflow: hidden; height: 416px; touch-action: pan-y; cursor: grab; }
.home-slider__viewport:active { cursor: grabbing; }
.home-slider__track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0; align-items: flex-start;
  /* Sin will-change: en un track muy ancho (carrusel con muchos slides) forzaba
     una capa de composición permanente enorme que reventaba la memoria GPU en
     iOS. El navegador compone la animación de transform de forma transitoria. */
  transition: transform .55s cubic-bezier(.22,.61,.36,1);
}
.home-slider__item {
  flex: 0 0 auto; width: 276px; aspect-ratio: 276 / 416; overflow: hidden;
  /* Desplazamiento vertical con transform (componible, en GPU) en vez de
     margin-top: anima sin provocar layout/reflow en cada frame → mejor INP. */
  transform: translateY(46px); opacity: .5; transition: transform .45s ease, opacity .45s ease;
  background: #111; /* fondo mientras la foto (diferida) aún no se ha cargado */
}
.home-slider__item.is-active { transform: translateY(0); opacity: 1; }
.home-slider__link, .home-slider__item img { display: block; width: 100%; height: 100%; }
.home-slider__item img { object-fit: cover; }
.home-slider__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.home-slider__nav:hover { background: #000; }
.home-slider__nav svg { width: 22px; height: 22px; }
.home-slider__nav--prev { left: 16px; }
.home-slider__nav--next { right: 16px; }
@media (max-width: 980px) {
  .home-slider__viewport { height: 380px; }
  .home-slider__item { width: 252px; transform: translateY(34px); }
  .home-slider__nav { width: 40px; height: 40px; }
}
/* Teléfonos: slide lo más grande posible dejando hueco para las flechas
   (la altura escala con el ancho para conservar la proporción 276:416). */
@media (max-width: 600px) {
  .home-slider { padding-top: 40px; padding-bottom: 40px; }
  .home-slider__item { width: calc(100vw - 68px); transform: translateY(28px); }
  .home-slider__viewport { height: calc((100vw - 68px) * 416 / 276); }
  .home-slider__nav { width: 38px; height: 38px; }
  .home-slider__nav--prev { left: 4px; }
  .home-slider__nav--next { right: 4px; }
}

/* ===== Cabecera y botón de archivos de taxonomía ===== */
.archivo-titulo { text-align: center; padding: 60px var(--hv-gutter) 0; }
.archivo-titulo h1 { font-size: 30px; margin: 0; }
@media (max-width: 640px) { .archivo-titulo { padding-top: 0; } .archivo-titulo h1 { font-size: 24px; } }
.archivo-cta { text-align: center; padding: 40px var(--hv-gutter) 60px; }
.archivo-cta a {
  display: inline-block; background: #222; border: 1px solid #999; color: #999;
  font-weight: bold; padding: 12px 22px; border-radius: 4px;
  transition: color .2s ease, border-color .2s ease;
}
.archivo-cta a:hover { color: #fff; border-color: #fff; }

/* Infinite scroll: sentinela / cargando */
.anuncios-sentinel { height: 60px; display: flex; align-items: center; justify-content: center; }
.anuncios-sentinel.is-loading::after {
  content: ""; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: hv-spin .8s linear infinite;
}
@keyframes hv-spin { to { transform: rotate(360deg); } }

/* ===== Tarjeta de OFERTA (página /ofertas/) ===== */
/* Panel oscuro con las tarifas y la cuenta atrás, bajo la foto. El padding
   inferior deja hueco para que los botones de acción solapen el límite con la
   caja clara de info. */
.anuncio-card--oferta .oferta-panel { background: #333; padding: 14px 14px 34px; }
.oferta-tarifas { list-style: none; margin: 0; padding: 6px 0 2px; }
.oferta-tarifas__row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.oferta-tarifas__row:last-child { border-bottom: 0; }
.oferta-tarifas__dur { color: #cfcfcf; font-style: italic; font-weight: 700; font-size: 18px; }
.oferta-tarifas__dur::after { content: ""; }
.oferta-tarifas__precio { font-size: 20px; color: #fff; display: inline-flex; align-items: baseline; gap: 6px; }
.oferta-tarifas__orig { color: #e23b3b; font-weight: 700; }
.oferta-tarifas__arrow { color: #e23b3b; }
.oferta-tarifas__new { color: #00e000; font-weight: 800; font-size: 24px; }

/* Cuenta atrás */
.oferta-cd { text-align: center; padding: 12px 0 8px; }
.oferta-cd__label { display: block; color: var(--hv-muted, #aaa); font-style: italic; font-weight: 700; margin-bottom: 8px; }
.oferta-cd__row { display: flex; justify-content: center; gap: 10px; }
.oferta-cd__box {
  width: 52px; height: 52px; border-radius: 50%; border: 3px solid #00cc00;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; line-height: 1;
}
.oferta-cd__box b { font-size: 16px; }
.oferta-cd__box small { font-size: 10px; color: var(--hv-muted, #aaa); }
.oferta-cd.is-ended .oferta-cd__box { border-color: #777; }

/* Botones de acción centrados sobre el límite panel oscuro / caja clara
   (reutilizan .hot-action-buttons del loop con su solape -30px). */
.anuncio-card--oferta .hot-action-buttons { position: relative; z-index: 2; }
/* Distintivo "oferta activa / próx." como círculo (igual que el loop). */
.anuncio-card--oferta .hab-oferta { font-size: 10px; }

/* La caja blanca de info es de altura FIJA; el panel oscuro de oferta es el que
   crece para ocupar el resto (así todas las cajas blancas quedan alineadas).
   El panel es flex-column y la cuenta atrás se ancla abajo (margin-top:auto),
   de modo que todas las cuentas atrás quedan alineadas en la parte inferior. */
.anuncio-card--oferta .oferta-panel { flex: 1 1 auto; display: flex; flex-direction: column; }
.anuncio-card--oferta .oferta-cd { margin-top: auto; }
.anuncio-card--oferta .anuncio-card__info {
  flex: 0 0 auto; height: 160px; overflow: hidden;
}
.anuncio-card--oferta .anuncio-card__info .hot-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
