/* Estilos para el lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    margin: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

/* Estilo para el caption con botón de información */
.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    max-width: 80%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.lightbox-caption.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lightbox-caption h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.lightbox-caption p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

.lightbox-info-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: background-color 0.3s ease;
}

.lightbox-info-btn:hover {
    background-color: var(--primary-color);
}

.lightbox-info-btn i {
    font-size: 18px;
}

/* Ajustar posición de los botones de navegación */
.lightbox-navigation {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 50px;
    box-sizing: border-box;
    bottom: 50%; /* Centrar verticalmente */
    transform: translateY(50%);
}

.lightbox-prev, .lightbox-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Animación para la transición entre imágenes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content.changing {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-navigation {
        padding: 0 20px;
    }
    
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-caption {
        font-size: 1rem;
        padding: 15px;
    }
}
