.popup-ads-overlay {
    /* Reservan el espacio de los controles (cerrar arriba, flechas a los
       costados, puntos abajo) para que nunca queden encima de la imagen. */
    --popup-pad-x: 80px;
    --popup-pad-y: 70px;

    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    padding: var(--popup-pad-y) var(--popup-pad-x);
}

.popup-ads-overlay.is-open {
    display: flex;
}

body.popup-ads-lock-scroll {
    overflow: hidden;
}

.popup-ads-modal {
    display: inline-flex;
    max-width: calc(100vw - (var(--popup-pad-x) * 2));
    max-height: calc(100vh - (var(--popup-pad-y) * 2));
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.popup-ads-viewport {
    display: flex;
    max-width: calc(100vw - (var(--popup-pad-x) * 2));
    max-height: calc(100vh - (var(--popup-pad-y) * 2));
}

.popup-ads-track {
    display: flex;
}

/* Solo se muestra la diapositiva activa: cada imagen conserva su propia
   relación de tamaño en vez de forzarla a un contenedor de ancho fijo. */
.popup-ads-slide {
    display: none;
}

.popup-ads-slide.is-active {
    display: flex;
}

.popup-ads-slide a {
    display: flex;
}

.popup-ads-slide img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - (var(--popup-pad-x) * 2));
    max-height: calc(100vh - (var(--popup-pad-y) * 2));
}

.popup-ads-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.popup-ads-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.popup-ads-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.popup-ads-nav:hover {
    background: rgba(0, 0, 0, 0.75);
}

.popup-ads-prev {
    left: 20px;
}

.popup-ads-next {
    right: 20px;
}

.popup-ads-dots {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}

.popup-ads-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.popup-ads-dot.is-active {
    background: #e30513;
}

/* Móviles */
@media (max-width: 640px) {
    .popup-ads-overlay {
        --popup-pad-x: 46px;
        --popup-pad-y: 54px;
    }

    .popup-ads-nav {
        width: 32px;
        height: 32px;
    }

    .popup-ads-prev {
        left: 7px;
    }

    .popup-ads-next {
        right: 7px;
    }

    .popup-ads-close {
        top: 11px;
        right: 7px;
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }

    .popup-ads-dots {
        bottom: 16px;
    }
}
