/* Estructura Base del Overlay Oscuro */
.emm-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    will-change: opacity;
    transition: opacity 0.3s ease;
}

/* Contenedor del Contenido Interno */
.emm-lightbox-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    will-change: transform, opacity;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

/* Adaptación Responsiva para el Contenedor de Video (Proporción 16:9) */
.emm-lightbox-content {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Relación de aspecto estándar */
    background: #000;
    overflow: hidden;
}

.emm-lightbox-content img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.emm-lightbox-content video,
.emm-lightbox-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Botón de Cierre Fluido (X) */
.emm-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 35px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.emm-lightbox-close:hover {
    transform: scale(1.15);
}

/* Títulos y Descripciones del Modal */
.emm-modal-title {
    margin: 0 0 10px 0;
    font-family: inherit;
    font-size: 1.5rem;
    color: #222222;
}

.emm-modal-desc {
    margin: 0 0 15px 0;
    font-family: inherit;
    font-size: 0.95rem;
    color: #666666;
    line-height: 1.4;
}

/* ==========================================
   ANIMACIONES MEDIANTE ACELERACIÓN DE HARDWARE
   ========================================== */

/* Animación Zoom In */
.emm-anim-zoom {
    opacity: 0;
    transform: scale(0.7);
}
.emm-lightbox-overlay .emm-anim-zoom {
    opacity: 1;
    transform: scale(1);
}

/* Animación Fade */
.emm-anim-fade {
    opacity: 0;
}
.emm-lightbox-overlay .emm-anim-fade {
    opacity: 1;
}

/* Animación Slide Up */
.emm-anim-slide-up {
    opacity: 0;
    transform: translateY(50px);
}
.emm-lightbox-overlay .emm-anim-slide-up {
    opacity: 1;
    transform: translateY(0);
}

/* Estado de Salida Global (Fade Out Efecto) */
.emm-lightbox-overlay.emm-closing {
    opacity: 0;
}

/* Ajustes para Pantallas de Teléfonos Móviles */
@media (max-width: 767px) {
    .emm-lightbox-container {
        padding: 15px;
    }
    .emm-lightbox-close {
        top: 10px;
        right: 15px;
        color: #000000; /* Colocarlo adentro del modal para mejor visibilidad táctil */
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        width: 30px;
        height: 30px;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        z-index: 10;
    }
    .emm-modal-title {
        font-size: 1.2rem;
        padding-right: 35px; /* Prevenir colisión con el botón cerrar móvil */
    }
}