/* ==== GALERÍA MEJORADA ==== */
.gallery-section {
    background: var(--theme-background-primary);
    position: relative;
    overflow: hidden;
    padding: 100px 5% 120px;
    box-shadow: inset 0 15px 30px -10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .gallery-section {
    background: var(--theme-dark-background-primary);
    box-shadow: inset 0 15px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Patrones sutiles de fondo */
.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    animation: patternFloat 30s linear infinite;
}

body.dark-mode .gallery-section::before {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-visible .gallery-container {
    opacity: 1;
    transform: translateY(0);
}

/* Contenedor principal del carousel mejorado */
.gallery-carousel {
    position: relative;
    height: 550px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.5s var(--transition-bounce);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 30px;
    will-change: transform;
    /* Borde interior iluminado */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2),
                0 15px 30px rgba(0, 0, 0, 0.1),
                inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.dark-mode .gallery-carousel {
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35),
                0 15px 30px rgba(0, 0, 0, 0.2),
                inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* Efecto 3D mejorado al pasar el mouse */
.gallery-carousel:hover {
    transform: translateY(-15px) rotateX(2deg) rotateY(1deg);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.25),
                0 25px 40px rgba(0, 0, 0, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Overlay para las imágenes con gradiente mejorado - siempre visible */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.1) 0%,
                rgba(0, 0, 0, 0.2) 50%,
                rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1; /* Siempre visible */
    z-index: 4;
}

/* Botón de galería mejorado - siempre visible */
.gallery-btn {
    background-color: var(--brand-yellow);
    color: #000;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 1; /* Siempre visible */
    transform: translateY(0); /* Posición normal sin offset */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 10; /* Mayor z-index para asegurar visibilidad */
}

/* Efecto de brillo deslizante para el botón */
.gallery-btn::after {
    content: '';
    position: absolute;
    top: -10%;
    left: -100%;
    width: 80%;
    height: 120%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: all 0.7s ease;
    opacity: 0.6;
    z-index: 0;
}

.gallery-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #ffcc30;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.gallery-btn:hover::after {
    left: 130%;
    transition: all 0.9s ease;
}

.gallery-btn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.gallery-carousel:hover .gallery-btn:hover i {
    transform: translateX(5px);
}

/* Diapositivas de galería mejoradas */
.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), transform 10s ease-out;
    will-change: opacity, transform;
    transform: scale(1.1);
}

.gallery-slide.active {
    opacity: 1;
    transform: scale(1.2);
}

/* Caption mejorado con borde luminoso */
.gallery-carousel-caption {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 18px;
    z-index: 3;
    padding: 15px 20px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 1);
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: linear-gradient(to bottom, 
                rgba(0, 0, 0, 0), 
                rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gallery-slide.active .gallery-carousel-caption {
    opacity: 0.95;
    transform: translateY(0);
}

/* Contenedor de miniaturas mejorado */
.gallery-thumbs {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    position: relative;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

body.dark-mode .gallery-thumbs {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-thumbs:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

/* Miniaturas individuales mejoradas */
.gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 0.4s var(--transition-bounce);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
    position: relative;
}

.gallery-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.gallery-thumb.active {
    border: 2px solid var(--brand-yellow);
    opacity: 1;
    transform: scale(1.1);
}

.gallery-thumb.active::after {
    background: rgba(0, 0, 0, 0);
}

.gallery-thumb:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.gallery-thumb:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

/* Botón "Ver más" mejorado */
.gallery-thumb-more {
    width: 80px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--theme-accent) 0%, rgba(23, 165, 137, 0.85) 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.4s var(--transition-bounce);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .gallery-thumb-more {
    background: linear-gradient(135deg, var(--theme-dark-accent) 0%, rgba(175, 83, 154, 0.85) 100%);
}

.gallery-thumb-more:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Efecto de brillo para el botón "Ver más" */
.gallery-thumb-more::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 80%;
    height: 200%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: all 0.9s ease;
    opacity: 0;
}

.gallery-thumb-more:hover::after {
    left: 150%;
    opacity: 1;
}

/* Eliminados controles de navegación laterales según lo solicitado */

/* Indicador para dispositivos móviles */
.gallery-mobile-indicator {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

.gallery-mobile-indicator i {
    margin-left: 5px;
    animation: swipeHint 1.5s infinite ease-in-out;
}

/* Contador de imágenes */
.gallery-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 15px;
    z-index: 5;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-carousel:hover .gallery-counter {
    opacity: 1;
    transform: translateY(0);
}

/* Paginación de puntos para versión móvil */
.gallery-dots {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
}

.gallery-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-dot.active {
    background-color: var(--brand-yellow);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 185, 0, 0.5);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

@keyframes patternFloat {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

/* Adaptaciones Responsivas */
@media (max-width: 992px) {
    .gallery-section {
        padding: 70px 5% 90px;
    }
    
    .gallery-carousel {
        height: 450px;
    }
    
    .gallery-counter {
        top: 15px;
        right: 15px;
        font-size: 12px;
    }
    
    .gallery-carousel::before,
    .gallery-carousel::after {
        width: 45px;
        height: 45px;
    }
    
    .gallery-carousel-caption {
        font-size: 16px;
        padding: 12px 15px;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 60px 5% 80px;
    }
    
    .gallery-carousel {
        height: 380px;
        border-radius: 15px;
    }
    
    /* Eliminada referencia a los controles de navegación */
    
    /* Eliminado indicador móvil que sugería deslizar */
    .gallery-mobile-indicator {
        display: none;
    }
    
    .gallery-dots {
        display: block;
    }
    
    .gallery-thumbs {
        gap: 10px;
        overflow-x: auto;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        justify-content: flex-start;
        max-width: 100%;
        margin-top: 20px;
        scrollbar-width: none; /* Firefox */
    }
    
    .gallery-thumbs::-webkit-scrollbar {
        display: none;
    }
    
    .gallery-thumb, 
    .gallery-thumb-more {
        flex: 0 0 auto;
        width: 70px;
        height: 50px;
        border-radius: 10px;
    }
    
    .gallery-btn {
        padding: 12px 25px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .gallery-section {
        padding: 50px 5% 70px;
    }
    
    .gallery-carousel {
        height: 300px;
        border-radius: 12px;
    }
    
    .gallery-carousel-caption {
        bottom: 25px;
        font-size: 15px;
        padding: 10px 15px;
    }
    
    .gallery-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .gallery-thumb, 
    .gallery-thumb-more {
        width: 60px;
        height: 45px;
    }
    
    .gallery-carousel::before,
    .gallery-carousel::after {
        width: 35px;
        height: 35px;
        background-size: 14px;
    }
    
    .gallery-counter {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .gallery-mobile-indicator {
        bottom: 15px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .gallery-dots {
        bottom: 50px;
    }
    
    .gallery-dot {
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }
}

/* Optimizaciones para dispositivos con pantalla táctil */
@media (hover: none) {
    .gallery-carousel::before,
    .gallery-carousel::after {
        opacity: 0.8;
    }
    
    .gallery-btn {
        opacity: 1;
        transform: translateY(0);
        background-color: var(--brand-yellow);
    }
    
    .gallery-counter {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación para cuando la sección se vuelve visible */
.gallery-section.section-visible .gallery-carousel {
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-section.section-visible .gallery-thumbs {
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* Mejoras de accesibilidad - asegurarse de que los controles sean visibles en el enfoque */
.gallery-carousel:focus-within::before,
.gallery-carousel:focus-within::after {
    opacity: 0.9;
}

.gallery-carousel:focus-within .gallery-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Estilos para el enfoque del teclado */
.gallery-thumb:focus,
.gallery-thumb-more:focus,
.gallery-btn:focus {
    outline: 2px solid var(--brand-yellow);
    outline-offset: 2px;
}

/* Efectos para el modo claro/oscuro */
body.dark-mode .gallery-dot.active {
    background-color: var(--theme-dark-accent);
    box-shadow: 0 0 10px rgba(175, 83, 154, 0.5);
}

body.dark-mode .gallery-carousel-caption {
    background: linear-gradient(to bottom, 
                rgba(0, 0, 0, 0), 
                rgba(0, 0, 0, 0.7));
}

/* Si hay un contador, añadir JS para actualizar el contenido dinámicamente */
/* Ejemplo:
function updateGalleryCounter() {
    const counter = document.querySelector('.gallery-counter');
    const currentSlide = document.querySelector('.gallery-slide.active');
    const slides = document.querySelectorAll('.gallery-slide');
    
    if (counter && currentSlide && slides.length > 0) {
        const currentIndex = Array.from(slides).indexOf(currentSlide) + 1;
        counter.textContent = `${currentIndex} / ${slides.length}`;
    }
}
*/