  /* =========================
    CARD INMUEBLE (FINAL)
  ========================= */

  .alv-card{
    background:#fff;
    border-radius:3px;
    overflow:hidden;
    box-shadow:0 2px 12px rgba(0,0,0,.06);
    display:flex;
    flex-direction:column;
    position: relative;
    cursor: default;
  }

  /* =========================
    MEDIA
  ========================= */

  .alv-card__media{
    position:relative;
    aspect-ratio:4 / 3;
    overflow:hidden;
    z-index:1;
  }

  .alv-card__swiper,
  .alv-card__media .swiper{
    height:100%;
  }

  .alv-card__media img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }

  /* Pill tipología */

  .alv-pill{
    position:absolute;
    top:0;
    left:0;
    background:#1E293B;
    color:#fff;
    padding:5px 12px;
    border-radius:0;
    font-size:10px;
    font-weight:500;
    letter-spacing:.08em;
    text-transform:uppercase;
    z-index:4;
    opacity:0;
    transform:translateY(-100%);
    transition:opacity .25s ease, transform .25s ease;
  }

  /* =========================
    CONTENT
  ========================= */

  .alv-card__content{
    padding:22px;
    display:flex;
    flex-direction:column;
    gap:10px;
  }

  /* =========================
    TITLE + FAV
  ========================= */

  .alv-card__row--title{
    display:grid;
    grid-template-columns: 1fr auto;
    align-items:start;
    column-gap:12px;
  }

  .alv-card__title{
    font-size:22px;
    line-height:1.25;
    margin:0;

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }

  /* ======================================================
   FAVORITO · CORAZÓN (SVG XD · PROPORCIÓN REAL)
====================================================== */

.alv-card__fav{
  all: unset;

  width: 18px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  justify-self: end;
  align-self: start;

  background: transparent !important;
}

/* Icono base (outline) */
.alv-card__fav::before{
  content:'';
  width: 16px;
  height: 16px;

  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 32.161'%3E%3Cpath d='M14.962,28.8q-4.419-3.843-7.306-6.631a47.286,47.286,0,0,1-4.594-5A15.755,15.755,0,0,1,.678,13.093,11.008,11.008,0,0,1,0,9.292,8.84,8.84,0,0,1,2.756,2.661,9.5,9.5,0,0,1,9.625,0,10.473,10.473,0,0,1,17.5,3.548,10.473,10.473,0,0,1,25.375,0a9.5,9.5,0,0,1,6.869,2.661A8.84,8.84,0,0,1,35,9.292a11.009,11.009,0,0,1-.678,3.8,15.754,15.754,0,0,1-2.384,4.076,47.286,47.286,0,0,1-4.594,5Q24.456,24.96,20.037,28.8L17.5,31Z' fill='none' stroke='%231E293B' stroke-width='1'/%3E%3C/svg%3E");
}

/* Activo (relleno) */
.alv-card__fav.is-active::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 32.161'%3E%3Cpath d='M14.962,28.8q-4.419-3.843-7.306-6.631a47.286,47.286,0,0,1-4.594-5A15.755,15.755,0,0,1,.678,13.093,11.008,11.008,0,0,1,0,9.292,8.84,8.84,0,0,1,2.756,2.661,9.5,9.5,0,0,1,9.625,0,10.473,10.473,0,0,1,17.5,3.548,10.473,10.473,0,0,1,25.375,0a9.5,9.5,0,0,1,6.869,2.661A8.84,8.84,0,0,1,35,9.292a11.009,11.009,0,0,1-.678,3.8,15.754,15.754,0,0,1-2.384,4.076,47.286,47.286,0,0,1-4.594,5Q24.456,24.96,20.037,28.8L17.5,31Z' fill='%2322AE84'/%3E%3C/svg%3E");
}

/* Hover suave */
.alv-card__fav:hover{
  transform: scale(1.05);
}


  /* =========================
    GRID INFO (2 FILAS · 2 COLUMNAS — ESTABLE)
  ========================= */

  /* Ref en el grid — col 2, fila 1, alineada derecha */
  .alv-ref {
    grid-column: 2 / 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    font-size: 14px;
    color: #58534c;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Descripción fuera del grid — solo visible en vista lista */
  .alv-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    color: #58534c;
    line-height: 1.5;
    margin: 0;
  }

  .alv-card__click{
    display:grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-rows: auto auto;
    row-gap:6px;
    column-gap:8px;
    cursor:pointer;
    margin-top: 4px;
  }

  /* META */
  .alv-card__meta{
    grid-column:1 / 2;
    grid-row:1;
    font-size:16px;
    color:#58534c;
    align-self:center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    position: relative;
    top: -1px;
  }
  /* Vista mosaico: texto completo por defecto, abreviado en 3 columnas (desktop grande) */
  .alv-meta--short { display: none; }
  .alv-meta--full  { display: inline; }

  @media (min-width: 1201px) {
    #alv-listado:not(.is-list-view) .alv-meta--full  { display: none; }
    #alv-listado:not(.is-list-view) .alv-meta--short { display: inline; }
  }

  /* PRECIO */
  .alv-card__price{
    grid-column:1 / 2;
    grid-row:2;
    font-size:17px;
    font-weight:700;
    line-height:1;
    align-self: end;
    white-space: nowrap;
    min-width: 0;
  }

  /* ZONA */
  .alv-card__zone{
    grid-column:2 / 3;
    grid-row:2;
    justify-self: end;
    align-self: end;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
  }

  .alv-card__row--title{
    display:grid;
    grid-template-columns: 1fr auto;
    align-items:start;
    column-gap:12px;
  }

  .alv-card__title{
    min-width:0;
    font-weight: 700;
    color: #0e0e0e;
  }


  /* ICONO ZONA — 1em × 1em, nunca empuja la línea */
  .alv-card__zone::before{
    content:'';
    display: inline-block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E293B' stroke-width='1.6'%3E%3Cpath d='M12 21s6-5.2 6-10a6 6 0 1 0-12 0c0 4.8 6 10 6 10z'/%3E%3Ccircle cx='12' cy='11' r='2.5'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    vertical-align: middle;
    position: relative;
    top: -0.5px;
  }


  /* =========================
    SWIPER (BLINDADO)
  ========================= */

  .alv-card__media .swiper{
    position:relative;
    z-index:1;
  }

  .alv-card__media .swiper-slide{
    cursor: grab;
  }

  .alv-card__media .swiper-slide:active{
    cursor: grabbing;
  }

  .alv-card__media .swiper-button-prev,
  .alv-card__media .swiper-button-next{
    width:28px;
    height:28px;
    border-radius:2px;
    background:rgba(255,255,255,.82);
    color:#1E293B;
    --swiper-navigation-size: 11px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    transition:opacity .25s ease, transform .25s ease;
  }

  .alv-card:hover .swiper-button-prev,
  .alv-card:hover .swiper-button-next{
    opacity:1;
  }

  .alv-card__media .swiper-button-prev:hover,
  .alv-card__media .swiper-button-next:hover{
    transform:scale(1.05);
  }

  /* ===============================
    CLICK CONTROLADO
  ================================ */

  .alv-card__click{
    cursor:pointer;
  }

  .alv-card__media,
  .alv-card__swiper,
  .alv-card__media *{
    pointer-events:auto;
  }

/* ======================================================
   LISTADO · LOADER CENTRADO
====================================================== */

#alv-listado{
  min-height: 200px; /* evita salto visual */
}

#alv-listado .alv-msg{
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
  margin: 32px 0 48px;
  font-size: 14px;
  color: #94A3B8;
}

/* ======================================================
   CONTADOR DE RESULTADOS
====================================================== */

.alv-total{
  margin: 32px 0 24px;
  text-align: center;
  font-size: 14px;
  color: #58534c;
}

/* ======================================================
   PAGINACIÓN (PLACEHOLDER VISUAL)
====================================================== */

.alv-pagination{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 32px 0 64px;
  pointer-events: auto;
  position: relative;
  z-index: 20;
}

.alv-pagination span,
.alv-pagination a{
  cursor: pointer;
  padding: 4px 8px;
}

.alv-pagination .is-active{
  font-weight: 600;
  color: #1E293B;
}

.alv-pagination{
  display:flex;
  justify-content:center;
  gap:8px;
  margin: 0 0 64px;
}

.alv-pagination button{
  border:1px solid #E2E8F0;
  background:#fff;
  padding:6px 10px;
  font-size:13px;
  cursor:pointer;
  border-radius:6px;
}

.alv-pagination button.is-active{
  background:#1E293B;
  color:#fff;
  border-color:#1E293B;
}

/* ======================================================
   FICHA · PROPIEDADES SIMILARES (ESTABLE)
====================================================== */

.alv-ficha-similares {
  background: #fafafa;
  padding: 48px 0;
}

.alv-ficha-similares-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Píldora hover — entra desde arriba */
.alv-card:hover .alv-pill {
  opacity: 1;
  transform: translateY(0);
}

/* Cards: MISMO ADN que listado, sin reflow */
.alv-ficha-similares .alv-card {
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  overflow: hidden;
  transition: box-shadow .25s ease;
  transform: none !important;
}

/* Hover limpio */
.alv-ficha-similares .alv-card:hover {
  box-shadow: 0 14px 36px rgba(0,0,0,.12);
}

/* Ajustes leves de texto (no layout) */
.alv-ficha-similares .alv-card__title {
  font-size: 14px;
  -webkit-line-clamp: 2;
}
/* Similares — píldora igual que listado */
.alv-ficha-similares .alv-pill {
  top: 0;
  left: 0;
  border-radius: 0;
  background: #1E293B;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 12px;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .25s ease, transform .25s ease;
}
.alv-ficha-similares .alv-card:hover .alv-pill {
  opacity: 1;
  transform: translateY(0);
}

.alv-ficha-similares .alv-card__price {
  font-size: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  .alv-ficha-similares-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .alv-ficha-similares-inner {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   FIX PROPORCIÓN IMAGEN — SOLO SIMILARES
====================================================== */
.alv-ficha-similares .alv-card__media{
  aspect-ratio: 4 / 3;
}

.alv-ficha-similares .alv-card__media .swiper,
.alv-ficha-similares .alv-card__media .swiper-wrapper,
.alv-ficha-similares .alv-card__media .swiper-slide{
  height: 100%;
}

/* ======================================================
   LISTADO · 2 COLUMNAS DESKTOP
====================================================== */
@media (min-width: 1025px) {
  #alv-listado {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 28px;
  }
}
@media (min-width: 640px) and (max-width: 1024px) {
  #alv-listado {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 639px) {
  #alv-listado {
    grid-template-columns: 1fr !important;
  }
}

/* ======================================================
   VISTA LISTA — imagen izquierda 2/5, info derecha 3/5
====================================================== */
#alv-listado.is-list-view {
  grid-template-columns: 1fr !important;
  gap: 16px;
}
#alv-listado.is-list-view .alv-card {
  flex-direction: row;
  height: 260px;
}
/* Imagen: 1/3 */
#alv-listado.is-list-view .alv-card__media {
  width: 33.333%;
  flex-shrink: 0;
  aspect-ratio: unset;
  height: 100%;
}
/* Info: 2/3 */
#alv-listado.is-list-view .alv-card__content {
  flex: 1;
  padding: 20px 28px;
  justify-content: space-between;
  min-width: 0;
}
#alv-listado.is-list-view .alv-card__title {
  font-size: 17px;
  -webkit-line-clamp: 1;
}
#alv-listado.is-list-view .alv-card__price {
  font-size: 20px;
}
/* Descripción en vista lista */
#alv-listado.is-list-view .alv-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#alv-listado.is-list-view .alv-pill {
  display: none;
}

/* Paginado numerico (Tarea 38): flechas prev/next y puntos suspensivos
   para el truncado tipo Idealista (1 2 3 ... 31), en vez de pintar
   todos los numeros de pagina seguidos. */
.alv-pagination__arrow {
  font-size: 16px;
  line-height: 1;
  min-width: 34px;
}
.alv-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.alv-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 4px;
  font-size: 13px;
  color: #94A3B8;
  user-select: none;
}
