/**
 * LIGHTBOX/ZOOM SIMPLE PARA GALERÍA
 * Sistema de zoom en modal para imágenes
 */

/* Contenedor del lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagen dentro del lightbox */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    animation: zoomIn 0.3s ease;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Botón cerrar */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none;
    border: none;
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover,
.lightbox-close:focus {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Caption/Pie de foto */
.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 0;
    max-width: 80%;
}

/* Navegación (anterior/siguiente) */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    transition: all 0.3s ease;
    border-radius: 0;
    user-select: none;
}

.lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Contador de imágenes */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 0;
}

/* Cursor pointer en imágenes clicables */
.gallery-image {
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

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

/* Loading spinner */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 0;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 10px;
    }
    
    .lightbox-nav {
        font-size: 24px;
        padding: 12px 16px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-caption {
        font-size: 14px;
        bottom: 10px;
        padding: 8px 15px;
    }
}

/* Prevenir scroll del body cuando el lightbox está activo */
body.lightbox-open {
    overflow: hidden;
}

