/* Estilos de la galería */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 20px;
}

.gallery img {
    width: 100%;
    height: 180px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s;
    object-fit: cover;
    object-position: top;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#lightbox.show {
    display: flex !important; /* Forzar que se muestre si la clase se aplica */
}

#lightbox img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 5px;
    display: block;
}

/* Botón cerrar */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

/* Flechas de navegación */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 10px;
    user-select: none;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.prev:hover, .next:hover, .close:hover {
    color: #a5a5a5;
}