/* Estilos de la galería */
.galeria-section {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Grid de imágenes */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.galeria-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.galeria-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.galeria-item:hover img {
    transform: scale(1.1);
}

/* Estilos del modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    animation: modalFade 0.3s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-contenido {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-imagen-container {
    position: relative;
    width: 100%;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-imagen {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Botones de navegación */
.modal-navegacion {
    width: 100%;
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    padding: 0 20px;
    pointer-events: none;
}

.modal-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.1);
}

/* Botón cerrar */
.modal-cerrar {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: 0.3s ease;
}

.modal-cerrar:hover {
    color: #bbb;
    transform: rotate(90deg);
}

/* Contador de imágenes */
.modal-contador {
    position: absolute;
    bottom: 30px;
    right: 40px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .galeria-item img {
        height: 180px;
    }
    
    .modal-contenido {
        padding: 10px;
        width: 95%;
    }
    
    #modal-imagen {
        max-height: 65vh;
    }
    
    .modal-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 10px;
    }
    
    .modal-cerrar {
        font-size: 30px;
        right: 15px;
        top: 10px;
    }
    
    .modal-contador {
        bottom: 15px;
        right: 15px;
        font-size: 12px;
        padding: 5px 12px;
    }
}

@media (max-width: 480px) {
    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    
    .galeria-item img {
        height: 140px;
    }
}