.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    z-index: 9999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup {
    width: 80%;
    height: 80vh;
    margin: 5vh auto;
    background: #000;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border-radius: 50%;
    border: none;
    background: #ff6600;
    color: white;
    cursor: pointer;
    z-index: 20;
    transition: .3s ease;
}

.close:hover {
    background: #ff4605;
    border-color: #ff6600;
    transform: translateY(-3px);
    box-shadow: 0 5px 13px rgba(255, 107, 53, 0.4);
}

/* Swiper overrides for Modal */
.modalSwiper {
    width: 100%;
    height: 100%;
}

.modalSwiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.modalSwiper .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

/* Custom Navigation Buttons Position */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    border-radius: 10px;
    font-size: 2.5rem;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 50;
    /* Higher than Swiper default */
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

/* Swiper disables buttons automatically, we can style them if needed */
.nav.swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
}

@media (max-width: 700px) {
    .popup {
        width: 95%;
        height: 70vh;
    }
}

/* ==================== VENTANA MODAL GALERÍA ==================== */
.modal {
    align-items: center;
    backdrop-filter: blur(10px);
    background-color: rgba(10, 14, 23, 0.95);
    display: none;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    overflow: auto;
    position: fixed;
    top: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    z-index: 1000;
}

.modal.mostrar {
    display: flex;
    opacity: 1;
}

.modal_contenido {
    border: 3px solid #fe7a20;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 20px auto;
    max-height: 75vh;
    max-width: 85%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.mostrar .modal_contenido {
    transform: scale(1);
}

.modal_cerrar {
    color: #fff;
    cursor: pointer;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    right: 40px;
    top: 30px;
    transition: all 0.2s ease;
    user-select: none;
}

.modal_cerrar:hover {
    color: #fe7a20;
    transform: scale(1.2);
}

#modal_caption {
    color: #ccc;
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 10px auto;
    max-width: 700px;
    text-align: center;
    text-transform: uppercase;
    width: 80%;
}