/* Galería Principal */
.gallery-section {
    padding: 80px 0;
    background-color: #f8fafc;
}

.gallery-section .container {
    max-width: 90%; /* Aumenta este valor si es necesario */
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.gallery-desc {
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    margin-bottom: 10px;
}

.gallery-item:hover .gallery-desc {
    opacity: 1;
}

/* Popup */
.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    z-index: 1;
    animation: popupFadeIn 0.4s ease-out;
}

.popup-img {
    max-height: 80vh;
    max-width: 60%;
    object-fit: contain;
    display: block;
}

.popup-info {
    padding: 30px;
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popup-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #1e293b;
}

.popup-desc {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #ef4444;
}

/* Animaciones */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .popup-content {
        flex-direction: column;
        max-height: 90vh;
        width: 90%;
    }
    
    .popup-img {
        max-width: 100%;
        max-height: 50vh;
    }
    
    .popup-info {
        width: 100%;
        padding: 20px;
    }
}
/* Estilos para las pestañas */
/* ============================================= */
/* ESTILOS GENERALES DE LA GALERÍA */
/* ============================================= */

.gallery-section {
    padding: 80px 0;
    background-color: #f8fafc;
    position: relative;
}

.gallery-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    color: #1e293b;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

.divider {
    width: 80px;
    height: 4px;
    background: #2563eb;
    margin: 0 auto 40px;
    border-radius: 2px;
}

/* ============================================= */
/* ESTILOS DE LAS PESTAÑAS */
/* ============================================= */

.gallery-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-tab {
    padding: 12px 28px;
    border: none;
    background-color: #e2e8f0;
    color: #475569;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.gallery-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50px;
}

.gallery-tab:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.gallery-tab:hover::before {
    opacity: 1;
}

.gallery-tab.active {
    background-color: #2563eb;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.gallery-tab.active::before {
    opacity: 1;
}

/* ============================================= */
/* ESTILOS DEL GRID DE LA GALERÍA */
/* ============================================= */

.gallery-grid-container {
    width: 100%;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    aspect-ratio: 4/3;
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.gallery-desc {
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    margin-bottom: 10px;
    line-height: 1.5;
}

.gallery-item:hover .gallery-desc {
    opacity: 1;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.category-badge.web {
    background-color: rgba(37, 99, 235, 0.8);
}

.category-badge.news {
    background-color: rgba(234, 88, 12, 0.8);
}

.category-badge.shop {
    background-color: rgba(22, 163, 74, 0.8);
}

/* ============================================= */
/* ESTILOS DEL POPUP */
/* ============================================= */

.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    z-index: 1;
    animation: popupFadeIn 0.4s ease-out;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.popup-img {
    max-height: 80vh;
    max-width: 60%;
    object-fit: contain;
    display: block;
}

.popup-info {
    padding: 30px;
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popup-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #1e293b;
    font-weight: 700;
}

.popup-desc {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.popup-link {
    display: inline-block;
    padding: 12px 24px;
    background-color: #2563eb;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.popup-link:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 78, 216, 0.3);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #ef4444;
}

/* ============================================= */
/* ANIMACIONES */
/* ============================================= */

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================= */
/* DISEÑO RESPONSIVE */
/* ============================================= */

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .popup-content {
        flex-direction: column;
        max-height: 90vh;
        width: 90%;
    }
    
    .popup-img {
        max-width: 100%;
        max-height: 50vh;
    }
    
    .popup-info {
        width: 100%;
        padding: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .gallery-tabs {
        gap: 8px;
    }
    
    .gallery-tab {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 576px) {
    .gallery-section {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* Muestra exactamente 2 columnas */
        gap: 15px; /* Reduce el espacio entre elementos */
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .popup-title {
        font-size: 1.4rem;
    }
    
    .popup-desc {
        font-size: 0.9rem;
    }
    
    .gallery-info {
        padding: 15px;
    }
    
    .gallery-title {
        font-size: 1.1rem;
    }
    
    .gallery-desc {
        font-size: 0.8rem;
    }
}