/* Galería Masonry para Index - Estilo Pinterest Limpio */

.gallery-section {
    max-width: 1400px;
    margin: 8rem auto 4rem;
    padding: 0 2rem;
}

.gallery-section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-family: var(--font-heading);
    color: #2c3e50;
    font-weight: 600;
}

/* Grid Masonry CSS - Centrado y compacto */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    grid-auto-flow: dense;
    max-width: 1000px;
    margin: 0 auto;
}

/* Tarjetas de productos */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Tamaños destacados */
.gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

/* Imagen del producto */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

/* Overlay con información */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem 1.2rem 1.2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    font-size: 1.1rem;
    color: white;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    font-family: var(--font-heading);
}

.gallery-overlay p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badge de categoría - OCULTO */
.gallery-badge {
    display: none;
}

/* Loading skeleton */
.gallery-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skeleton-item {
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Botón de "Ver todos los trabajos" */
.view-all-btn {
    display: block;
    width: fit-content;
    margin: 3rem auto 0;
    padding: 1rem 2.5rem;
    background: #556b5d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(85, 107, 93, 0.3);
}

.view-all-btn:hover {
    background: #3f5246;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(85, 107, 93, 0.4);
}

/* Mensaje cuando no hay productos */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-products i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-products h3 {
    font-size: 1.5rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.no-products p {
    color: #aaa;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        max-width: 900px;
    }

    .gallery-item.featured {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        margin-top: 6rem;
        padding: 0 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
        max-width: 100%;
    }

    .gallery-item.featured,
    .gallery-item.wide,
    .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-overlay h3 {
        font-size: 0.9rem;
    }

    .gallery-overlay p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-overlay {
        padding: 0.8rem 0.6rem 0.6rem;
    }
}