/*=============================================
                GALLERY MODULE CSS
                COMPLETAMENTE INDEPENDIENTE
=============================================*/

/* Sección de galería */
.gallery-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* Títulos de la galería */
.gallery-title {
    background: linear-gradient(135deg, #1e293b 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gallery-subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    color: #475569;
}

/* Items de la galería */
.gallery-item {
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -10px rgba(13, 110, 253, 0.3) !important;
}

/* Wrapper de imagen */
.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    min-height: 250px;
}

.gallery-image-wrapper.gallery-featured {
    aspect-ratio: 2/1;
}

/* Imagen */
.gallery-image {
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        transparent 100%);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 2rem 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Contenido del overlay */
.overlay-content {
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.gallery-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-category {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    opacity: 0.9;
}

.overlay-title {
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botón en overlay */
.gallery-overlay .btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gallery-overlay .btn-outline-light:hover {
    background: white;
    color: #0d6efd !important;
    transform: scale(1.05);
}

/* Botón ver todos */
.gallery-section .btn-outline-primary {
    border-width: 2px;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.gallery-section .btn-outline-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(13, 110, 253, 0.4);
}

.gallery-section .btn-outline-primary i {
    transition: transform 0.3s ease;
}

.gallery-section .btn-outline-primary:hover i {
    transform: translateX(5px);
}

/* Grid con efecto de entrada */
.gallery-grid .col-md-6 {
    animation: galleryFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.gallery-grid .col-md-6:nth-child(1) { animation-delay: 0.1s; }
.gallery-grid .col-md-6:nth-child(2) { animation-delay: 0.2s; }
.gallery-grid .col-md-6:nth-child(3) { animation-delay: 0.3s; }
.gallery-grid .col-md-6:nth-child(4) { animation-delay: 0.4s; }

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-section {
        padding: 3rem 0;
    }
    
    .gallery-image-wrapper {
        min-height: 220px;
    }
    
    .gallery-image-wrapper.gallery-featured {
        aspect-ratio: 1/1;
    }
    
    .gallery-grid .col-lg-6,
    .gallery-grid .col-lg-3 {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 2rem 0;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-subtitle {
        font-size: 1rem;
    }
    
    .gallery-grid .col-md-6 {
        width: 100%;
    }
    
    .gallery-image-wrapper {
        min-height: 280px;
    }
    
    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top, 
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.3) 70%,
            transparent 100%);
    }
    
    .overlay-content {
        transform: translateY(0);
    }
    
    .gallery-section .btn-outline-primary {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .gallery-image-wrapper {
        min-height: 240px;
    }
    
    .overlay-title {
        font-size: 1rem;
    }
    
    .gallery-overlay {
        padding: 1.5rem;
    }
}

/* Soporte para modo oscuro (si lo implementas después) */
[data-bs-theme="dark"] .gallery-section {
    background: linear-gradient(135deg, #0b1120 0%, #111827 100%);
}

[data-bs-theme="dark"] .gallery-subtitle {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] .gallery-item {
    background: #1f2937;
}