/**
 * ESTILOS DEL CARRUSEL CON AUTOPLAY
 * Versión con esquinas ovaladas y fondo semitransparente
 * 
 * @package TuChildTheme
 */

.carrusel-nutricion {
    position: relative;
    width: 100%;
    margin: var(--spacing-md) 0 var(--spacing-xl) 0;
    overflow: hidden;
}

.carrusel-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    padding: var(--spacing-xs) 0 var(--spacing-md) 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.carrusel-container::-webkit-scrollbar {
    height: 6px;
}

.carrusel-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 20px;
}

.carrusel-item {
    flex: 0 0 320px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 24px !important;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.carrusel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.carrusel-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.carrusel-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.carrusel-item:hover img {
    transform: scale(1.05);
}

.sin-imagen-carrusel {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    border-radius: 24px;
}

.carrusel-item h4 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    font-size: 1.1rem;
    line-height: 1.4;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(1px);
}

.carrusel-item:hover h4 {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
}

.carrusel-prev,
.carrusel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-color);
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    border: 1px solid rgba(255,255,255,0.5);
}

.carrusel-prev:hover,
.carrusel-next:hover {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.carrusel-prev {
    left: var(--spacing-md);
}

.carrusel-next {
    right: var(--spacing-md);
}

@media (max-width: 768px) {
    .carrusel-item {
        flex: 0 0 280px;
        border-radius: 20px !important;
    }
    
    .carrusel-item img,
    .sin-imagen-carrusel {
        height: 200px;
        border-radius: 20px;
    }
    
    .carrusel-item h4 {
        padding: var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
        font-size: 1rem;
    }
    
    .carrusel-prev,
    .carrusel-next {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .carrusel-nutricion {
        margin: var(--spacing-xs) 0 var(--spacing-lg) 0;
    }
    
    .carrusel-item {
        flex: 0 0 240px;
        border-radius: 16px !important;
    }
    
    .carrusel-item img,
    .sin-imagen-carrusel {
        height: 180px;
        border-radius: 16px;
    }
    
    .carrusel-prev,
    .carrusel-next {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}