/* ===== LIGHTBOX MODERNO CON BOTÓN DE CERRAR VISIBLE ===== */

/* Overlay principal */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

/* Contenedor de la imagen */
.lightbox-container {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    margin: 20px;
}

/* Imagen */
.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    animation: zoomIn 0.4s ease;
}

/* Botón de cerrar - VISIBLE Y ACCESIBLE */
.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Navegación */
.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.lightbox-prev-btn,
.lightbox-next-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.lightbox-prev-btn:hover,
.lightbox-next-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Contador (1/29) */
.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    opacity: 0.8;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESPONSIVE PARA MÓVIL ===== */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 98%;
        max-height: 98%;
        margin: 10px;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
    
    .lightbox-close-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
    
    .lightbox-prev-btn,
    .lightbox-next-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0 10px;
    }
    
    .lightbox-counter {
        bottom: -30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .lightbox-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .lightbox-prev-btn,
    .lightbox-next-btn {
        width: 45px;
        height: 45px;
        font-size: 22px;
        margin: 0 5px;
    }
    
    .lightbox-counter {
        bottom: -25px;
        font-size: 0.9rem;
    }
}

/* ===== TECLAS DE TECLADO Y GESTOS ===== */
.lightbox-overlay:focus {
    outline: none;
}

/* Efecto de pulsación en botones */
.lightbox-close-btn:active,
.lightbox-prev-btn:active,
.lightbox-next-btn:active {
    transform: scale(0.95);
}

/* Indicador de que es clickeable */
.lightbox-close-btn::after {
    content: 'Cerrar (ESC)';
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    pointer-events: none;
}

.lightbox-close-btn:hover::after {
    opacity: 1;
}

/* Asegurar que el botón sea visible sobre la imagen */
.lightbox-close-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mejorar visibilidad en imágenes claras */
.lightbox-close-btn {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
