/* Reset y variables base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

.gallery-section {
    padding: 60px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.section-header p {
    color: #64748b;
    font-size: 1rem;
}

/* Contenedor de Filtros */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #f1f5f9;
    color: #860303;
}

.filter-btn.active {
    background-color: #ac0000;
    color: #ffffff;
    border-color: #4b0200;
    box-shadow: 0 4px 12px rgba(235, 37, 37, 0.25);
}

/* Layout Responsive: 3 Columnas en Desktop | 1 Columna en Móvil */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 columnas por defecto */
    gap: 24px;
}

/* Transición suave para filtrado */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.1);
}

/* Forzar tamaño estándar de imagen con Aspect Ratio */
.gallery-link {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    /* Tamaño estándar (ej: 400x300 proporcional) */
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Adapta la imagen completamente sin distorsionar */
    object-position: center;
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-link img {
    transform: scale(1.06);
}

/* Overlay sutil al pasar el cursor */
.item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.6), transparent);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

.item-overlay span {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ocultar elementos filtrados */
.gallery-item.hide {
    display: none;
}

/* Media Queries: Responsive para Tablets y Móviles */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columnas en pantallas medianas/tablets */
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        /* 1 columna estricta en pantallas pequeñas/móviles */
    }

    .section-header h2 {
        font-size: 1.75rem;
    }
}
