.contenedor-principal {
    width: 90%;
    max-width: 1200px;
    overflow: hidden;
    margin: auto;
    padding: 60px 0;
}

.titulo-galeria {
    text-align: center;
    font-weight: 700;
    color: #9f8ad0;
    margin-bottom: 40px;
    font-size: 40px;
}

.galeria {
    background: #f2f2f2;
}

.contenedor-imagenes {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

/* Estilo base: 3 columnas */
.imagen-miniatura {
    object-fit: cover;
    width: 30%;
    display: block;
    margin-bottom: 15px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.imagen-miniatura:hover {
    transform: scale(1.1);
}

/* **RESPONSIVIDAD** */

/* Para tablets y pantallas medianas (máximo 768px) */
@media screen and (max-width: 768px) {
    .imagen-miniatura {
        width: 45%; /* 2 imágenes por fila */
    }
}

/* Para móviles pequeños (máximo 480px) */
@media screen and (max-width: 480px) {
    .imagen-miniatura {
        width: 48%; /* Mantiene 2 imágenes por fila */
    }
}

/* Para móviles extra pequeños (menos de 360px) */
@media screen and (max-width: 360px) {
    .imagen-miniatura {
        width: 100%; /* 1 imagen por fila si la pantalla es muy pequeña */
    }
}

/* Estilos de Lightbox */
.vista-lightbox {
    position: fixed;
    background: rgba(0, 0, 0, 0.6);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(100%);
    transition: transform 0.2s ease-in-out;
}

.mostrar {
    transform: translate(0);
}

.imagen-expandida {
    object-fit: cover;
    width: 60%;
    border-radius: 10px;
    transform: scale(0);
    transition: transform 0.3s 0.2s;
}

.mostrarImagen {
    transform: scale(1);
}

/* Ajuste para que la imagen expandida sea más pequeña en móviles */
@media screen and (max-width: 768px) {
    .imagen-expandida {
        width: 80%;
    }
}

@media screen and (max-width: 480px) {
    .imagen-expandida {
        width: 90%;
    }
}

.cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    cursor: pointer;
    color: #fff;
    font-size: 25px;
}
