#miModal {
    width: 80%;
    max-width: 900px;
    padding: 0;
    background: #003351;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#miModal::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

#miModal .carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #000;
    aspect-ratio: 16 / 9;
}

#miModal .carousel-track {
    display: flex;
    overflow: hidden; 
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
}

#miModal .carousel-track img {
    flex: 0 0 100%; /* Ocupa todo el ancho en horizontal */
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    /* OPTIMIZACIÓN: Indica al navegador que esto se va a mover */
    will-change: scroll-position;
    touch-action: pan-y; /* Permite scroll vertical natural si fuera necesario */
}

/* Botones Navegación */
#miModal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
}

#miModal .prev { left: 0; }
#miModal .next { right: 0; }

#miModal .btn-galeria {
    /* margin: 15px auto;
    padding: 10px 20px;
    display: block;
    cursor: pointer; */
    border-radius: 20px;
    border: none;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 15px auto;
    padding: 8px 30px;
    background-color: #298387;
    color: white;
    font-family: 'FuturaPTCondensed-Bold', sans-serif;
    font-size: clamp(14px, 4vw, 20px);
    text-transform: uppercase;
    transition: transform 0.3s ease;
}

#btnCerrar span {
    pointer-events: none; /* Atravesar span */
}

/* --- MODO VERTICAL --- */
@media (max-width: 768px) and (orientation: portrait) {
    #miModal {
        width: 90%;
        height: 80vh;
    }

    #miModal .carousel-container {
        aspect-ratio: auto;
        height: 70vh;
    }

    #miModal .carousel-track {
        flex-direction: column;
    }

    #miModal .carousel-track img {
        flex: 0 0 33.333%; /* Fuerza a que se vean 3 */
        width: 100%;
        height: 33.333%;
        object-fit: cover;
    }
}