/* ===== Ventana emergente con carrusel ===== */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(70, 70, 70, 0.75);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.popup-overlay[hidden] { display: none; }
.popup-overlay.show { opacity: 1; visibility: visible; }

.popup-box {
    position: relative;
    width: min(92vw, 900px);
    max-height: 92vh;
    background: #fff;
    border-radius: 16px;
    border-top: 5px solid #0000ff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
    transform: translateY(20px) scale(.97);
    transition: transform .3s ease;
}
.popup-overlay.show .popup-box { transform: none; }

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #0000ff;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.popup-close:hover { background: #32dbfd; color: #464646; transform: rotate(90deg); }

.popup-carousel { position: relative; overflow: hidden; }
.popup-track { display: flex; transition: transform .5s ease; }
.popup-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
}
.popup-slide a { display: block; width: 100%; }
/* La imagen se ve completa (sin recortes) en cualquier pantalla */
.popup-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 82vh;
    object-fit: contain;
    margin: 0 auto;
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 255, .85);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
}
.popup-nav:hover { background: #32dbfd; color: #464646; }
.popup-prev { left: 10px; }
.popup-next { right: 10px; }

.popup-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.popup-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(70, 70, 70, .6);
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.popup-dot.active { background: #32dbfd; transform: scale(1.25); }

@media (max-width: 600px) {
    .popup-box { width: 94vw; border-radius: 12px; }
    .popup-nav { width: 36px; height: 36px; font-size: 14px; }
    .popup-close { width: 34px; height: 34px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .popup-overlay, .popup-box, .popup-track { transition: none; }
}
