/* Listings AD ("Anuncios relacionados") — UX en la single.
   Ver modules/ads-relacionados-ux.php. */

/* ------------------------------------------------------------------ *
 * 1) Botón (i) "¿por qué veo esto?" + popover
 * ------------------------------------------------------------------ */
.tca-adsrel-why-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    margin-left: 8px;
}

.tca-adsrel-why {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .12);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    text-align: center;
    transition: background .15s ease, transform .15s ease;
}
.tca-adsrel-why:hover,
.tca-adsrel-why:focus-visible {
    background: #e3001b; /* rojo TCA */
    transform: scale(1.06);
    outline: none;
}
.tca-adsrel-why span { pointer-events: none; }

.tca-adsrel-pop {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    max-width: 78vw;
    padding: 12px 14px;
    background: #fff;
    color: #5e6d77;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    text-align: left;
    /* El popover vive dentro del <h3> del título: neutralizamos su herencia
       (mayúsculas, peso, tamaño grande) para un tono cercano y legible. */
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    line-height: 1.5;
}
/* Flechita superior */
.tca-adsrel-pop::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: #fff;
}

.tca-adsrel-pop__text {
    margin: 0 0 4px;
    font-size: 11.5px;
    font-weight: 400;
    text-transform: none;
    color: #5e6d77;
}
.tca-adsrel-pop__link {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: #e3001b;
    text-decoration: none;
}
.tca-adsrel-pop__link:hover { text-decoration: underline; }

/* En pantallas estrechas, que el popover no se salga por el borde izquierdo
   cuando el título está pegado al margen. */
@media (max-width: 480px) {
    .tca-adsrel-pop {
        left: 0;
        transform: none;
    }
    .tca-adsrel-pop::before { left: 18px; transform: none; }
}

/* ------------------------------------------------------------------ *
 * 2) Pocos slides (1-2): Swiper se destruye por JS (DOM estático) y aquí
 *    centramos con flex. Sin transforms de Swiper de por medio.
 * ------------------------------------------------------------------ */

/* El wrapper ya no lo controla Swiper: lo convertimos en una fila flexible
   centrada, con separación entre cards. */
.azp_listings_ad_slider.tca-adsrel--few .swiper-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    transform: none !important; /* anula cualquier translate residual */
}

/* Slides en estado estático: ancho cómodo, sin estirar a todo el carril. */
.azp_listings_ad_slider.tca-adsrel--few .swiper-slide {
    width: 320px !important;
    max-width: 100%;
    margin: 0 !important; /* el gap del wrapper gestiona la separación */
    flex: 0 0 auto;
}

/* Oculta las flechas y la paginación, que no aportan nada si no hay scroll. */
.azp_listings_ad_slider.tca-adsrel--few .listing-carousel-button,
.azp_listings_ad_slider.tca-adsrel--few .tc-pagination_wrap {
    display: none !important;
}

/* Cinturón y tirantes: si quedara algún clon de loop, no lo mostramos. */
.azp_listings_ad_slider.tca-adsrel--few .swiper-slide.swiper-slide-duplicate {
    display: none !important;
}
