/* ===== Tokens (paleta Derivate) ===== */
:root {
    --news-bg-1: #07285F;
    /* navy */
    --news-bg-2: #081B49;
    /* navy más oscuro */
    --text: #EAF0FF;
    --muted: #C7D4FF;
    --accent: #F4B400;
    /* amarillo */
    --accent-2: #4163C3;
    /* azul subrayado */
    --panel: rgba(255, 255, 255, .06);
    --panel-border: rgba(255, 255, 255, .16);
    --radius: 18px;
    --maxw: 1200px;
}

/* ===== Section ===== */
.news {
    color: var(--text);
    background: linear-gradient(180deg, var(--news-bg-1) 0%, var(--news-bg-2) 100%);
    padding: 44px 16px 60px;
}

.news__wrap {
    width: min(100%, var(--maxw));
    margin-inline: auto;
    position: relative;
}

.news__title {
    font-size: 28px !important;
    margin: 0 0 18px;
    text-align: center;
    font-size: clamp(1.8rem, 1rem + 2.4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: .3px;
}

.news__title::after {
    content: "";
    display: block;
    height: 6px;
    width: 140px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

/* ===== List (mobile: carrusel; desktop: grid) ===== */
.news__list {
    list-style: none;
    margin: 18px 0 0;
    padding: 6px 2px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    /* cuántas tarjetas se ven en móvil */
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.news__item {
    scroll-snap-align: start;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.news__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(12, 25, 70, .35);
    border-color: rgba(255, 255, 255, .25);
}

.news__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Desktop / tablet: cambia a grid */
@media (min-width: 640px) {
    .news__list {
        grid-auto-flow: initial;
        grid-auto-columns: initial;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        gap: 16px;
        padding: 0;
    }
}

@media (min-width: 960px) {
    .news__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px
    }
}

/* Indicadores de scroll sutiles (solo en mobile) */
@media (max-width: 639px) {

    .news__wrap::before,
    .news__wrap::after {
        content: "";
        position: absolute;
        top: 92px;
        bottom: 0;
        width: 32px;
        pointer-events: none;
        background: linear-gradient(to right, rgba(7, 40, 95, 1), rgba(7, 40, 95, 0));
    }

    .news__wrap::before {
        left: -16px
    }

    .news__wrap::after {
        right: -16px;
        transform: scaleX(-1);
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .news__item {
        transition: none
    }
}


/* para el carrusel */

/* Oculta las partes del carrusel que no se ven */
#Novedades .carousel {
  position: relative;
  overflow: hidden; 
}

/* Este es el "riel" que se moverá con JS */
#Novedades .carousel__viewport {
    display: flex;
    transform: translateX(0); 
    transition: transform 0.3s ease-in-out;
}

/* ★ ESTO ARREGLA LA IMAGEN GIGANTE ★ */
#Novedades .slide {
    flex-basis: 100%;  /* Cada slide ocupa el 100% del contenedor */
    flex-shrink: 0;   /* Evita que se encojan */
    padding: 0 10px;    /* Espacio entre slides */
    box-sizing: border-box; 
}

#Novedades .slide img {
    width: 100%; 
    height: 400px; /* altura fija  */
    object-fit: contain; /* Rellena sin deformar */
    border-radius: var(--radius); /* Reutiliza tu variable de borde */
}

/* ★ ESTO ARREGLA LAS FLECHAS OSCURAS ★ */
#Novedades .carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10; 
    
    /* Fondo blanco semitransparente para que se vea */
    background: rgba(255, 255, 255, 0.2); 
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex; 
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#Novedades .carousel__btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Color blanco para el SVG de la flecha */
#Novedades .carousel__btn svg {
    color: white; 
    width: 24px;
    height: 24px;
}

#Novedades .carousel__btn.prev {
  left: 20px;
}

#Novedades .carousel__btn.next {
  right: 20px;
}

/* (Arreglo para Desktop y Tablet) */


/* En pantallas de TABLET (640px de ancho o más) */
@media (min-width: 640px) {
    #Novedades .slide {
        /* Muestra 2 slides a la vez */
        flex-basis: calc(100% / 2); 
    }
}

/* En pantallas de DESKTOP (960px de ancho o más) */
@media (min-width: 960px) {
    #Novedades .slide {
        /* Muestra 4 slides a la vez */
        flex-basis: calc(100% / 4); 
    }

    /* Opcional: ajusta la altura de la imagen en desktop 
       para que no sean tan altas */
    #Novedades .slide img {
        height: 300px; 
    }
}
