/* CARRUSEL ESTILO TMDB - CORREGIDO POSICIÓN TÍTULOS */
.carousel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* TÍTULOS AHORA A LA IZQUIERDA */
.carousel-section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-texto);
    text-align: left;
    width: auto;
}

/* NUEVO CONTENEDOR PARA CONTROLES + VER TODO - AHORA A LA DERECHA */
.carousel-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* NUEVO BOTÓN VER TODO COMPACTO */
.view-all-btn-compact {
    background: transparent;
    color: var(--color-primario);
    border: 1px solid var(--color-primario);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-all-btn-compact:hover {
    background: var(--color-primario);
    color: var(--color-fondo);
    transform: translateY(-1px);
}

.carousel-controls {
    display: flex;
    gap: 0.5rem;
}

.carousel-nav-btn {
    background: var(--color-surface);
    border: 1px solid var(--color-bordes);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-texto);
}

.carousel-nav-btn:hover:not(:disabled) {
    background: var(--color-primario);
    color: var(--color-fondo);
    border-color: var(--color-primario);
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Contenedor principal del carrusel - SIN DIFUMINADO */
.carousel-container {
    position: relative;
    overflow: hidden;
    margin: 0 -10px;
    padding: 0 10px;
}

/* ELIMINAR DIFUMINADO DE LOS EXTREMOS */
.carousel-container::before,
.carousel-container::after {
    display: none;
}

.carousel {
    display: flex;
    gap: 12px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: grab;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.carousel:active {
    cursor: grabbing;
}

/* Tarjetas del carrusel */
.carousel-item {
    flex: 0 0 auto;
    width: 150px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    background: var(--color-surface);
    border: 1px solid var(--color-bordes);
}

.carousel-item:hover {
    transform: scale(1.05);
    z-index: 2;
    border-color: var(--color-primario);
}

.carousel-item img {
    width: 100%;
    height: 225px;
    object-fit: cover;
    display: block;
}

/* RESPONSIVE - 2 IMÁGENES EN MÓVIL */
@media (max-width: 768px) {
    .carousel-item {
        width: calc(50vw - 30px);
        min-width: calc(50vw - 30px);
    }
    
    .carousel-item img {
        height: calc((50vw - 30px) * 1.5);
    }
    
    .carousel-section-header {
        padding: 0 10px;
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
    }
    
    .carousel-section-header h2 {
        font-size: 1.3rem;
        width: auto;
        text-align: left;
        flex: 1;
    }
    
    .carousel-controls-wrapper {
        width: auto;
        justify-content: flex-end;
        margin-left: 0;
    }
    
    .carousel-nav-btn {
        width: 35px;
        height: 35px;
    }
    
    /* OCULTAR FLECHAS EN MÓVIL */
    .carousel-controls {
        display: none;
    }
    
    .carousel-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .carousel-container::-webkit-scrollbar {
        display: none;
    }
    
    .carousel {
        cursor: default;
        padding-bottom: 10px;
    }
}

/* MOSTRAR FLECHAS SOLO EN ESCRITORIO */
@media (min-width: 769px) {
    .carousel-controls {
        display: flex;
    }
}

/* ============================================ */
/* MEJORAS DE SCROLL SMOOTH PARA MÓVIL */
/* ============================================ */

@media (max-width: 768px) {
    .carousel {
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
    }
    
    .carousel-item {
        scroll-snap-align: start;
    }
    
    .carousel-container {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .carousel-container::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================ */
/* MEJORA VISUAL BOTONES NAVEGACIÓN ESCRITORIO */
/* ============================================ */

@media (min-width: 769px) {
    .carousel-nav-btn {
        background: var(--color-surface);
        border: 1px solid var(--color-bordes);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        color: var(--color-texto);
    }
    
    .carousel-nav-btn:hover:not(:disabled) {
        background: var(--color-primario);
        color: var(--color-fondo);
        border-color: var(--color-primario);
        transform: scale(1.1);
    }
    
    .carousel-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }
}

/* MEJORA CALIDAD IMÁGENES TAUTULLI */
.carousel-item img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    filter: contrast(1.05) brightness(1.02);
}

.movie-card img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    filter: contrast(1.05) brightness(1.02);
}