/* =================================================================
   CORRECCIÓN GLOBAL DEL FONDO NEGRO Y SECCIÓN DE MARCAS
   ================================================================= */
html, body {
    background-color: #ffffff !important; /* Fuerza fondo blanco global en móviles */
    color: #333333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

.vale-productos-marcas-seccion {
    width: 100%;
    background-color: #ffffff;
    padding: 30px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

/* Difuminados laterales limpios usando blanco puro (evitan pantallas negras en móviles) */
.vale-productos-marcas-seccion::before,
.vale-productos-marcas-seccion::after {
    content: "";
    height: 100%;
    width: 150px;
    position: absolute;
    top: 0;
    z-index: 2;
    pointer-events: none;
}

.vale-productos-marcas-seccion::before { 
    left: 0; 
    background: linear-gradient(to right, #ffffff 0%, rgba(255, 255, 255, 0) 100%); 
}
.vale-productos-marcas-seccion::after { 
    right: 0; 
    background: linear-gradient(to left, #ffffff 0%, rgba(255, 255, 255, 0) 100%); 
}

.vale-marcas-slider-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: visible;
}

.vale-marcas-slider-track {
    display: flex;
    align-items: center;
    gap: 40px;
    transition: transform 0.6s ease-in-out;
    position: relative;
    left: 0; 
}

.vale-prod-marca-card {
    flex-shrink: 0;
    background-color: #ffffff;
    width: 140px;
    height: 65px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vale-prod-marca-card:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(243, 112, 33, 0.25);
}

/* Asegura que el enlace llene la tarjeta */
.vale-prod-marca-card a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* Restringe el tamaño de la imagen dentro de la tarjeta */
.vale-prod-marca-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.vale-prod-marca-card:hover img {
    transform: scale(1.05);
}
/* =================================================================
   ANIMACIÓN MATEMÁTICA DEL MOVIMIENTO CONTINUO
   ================================================================= */
@keyframes valeTrencitoDesplazar {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* =================================================================
   ESTILOS DE LA TIENDA PRINCIPAL (BREADCRUMBS, FILTROS Y TARJETAS)
   ================================================================= */

/* --- LAYOUT Y CONTENEDORES --- */
.vale-tienda-seccion { 
    width: 100%; 
    background-color: #f7f5f0; 
    padding: 40px 0; 
}
.vale-tienda-contenedor { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* --- 1. MIGAS DE PAN (BREADCRUMBS) --- */
.vale-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 14px;
}

.vale-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.vale-breadcrumbs a:hover {
    color: #f37021;
}

.vale-bc-separador {
    color: #cbd5e1;
    font-size: 11px;
}

.vale-bc-actual {
    color: #001e3d;
    font-weight: 600;
}

/* --- LAYOUT DE LA TIENDA --- */
.vale-tienda-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* ================================================================
   SIDEBAR DE FILTROS — VALE SAFETY
   ================================================================ */
.vale-tienda-sidebar {
    background: #ffffff;
    border: 1px solid #E4E9F2;
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0, 30, 61, 0.06);
    position: sticky;
    top: 20px;
}

.vale-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E4E9F2;
}

.vale-sidebar-titulo {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #001e3d;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.vale-sidebar-titulo i {
    color: #f37021;
    font-size: 15px;
}

.vale-btn-limpiar {
    background: none;
    border: 1px solid #E4E9F2;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}
.vale-btn-limpiar:hover {
    background: #f37021;
    border-color: #f37021;
    color: #fff;
}
.vale-btn-limpiar.hidden { display: none; }

.vale-filtro-grupo {
    margin-bottom: 20px;
}

.vale-filtro-titulo {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vale-filtro-titulo i {
    font-size: 12px;
    color: #f37021;
}

.vale-filtro-divider {
    height: 1px;
    background: #E4E9F2;
    margin: 0 0 20px;
}

.vale-filtro-opciones {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vale-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.vale-checkbox-label:hover {
    background: #F8FAFC;
    border-color: #E4E9F2;
}

.vale-checkbox-label:has(input:checked) {
    background: #FFF4EC;
    border-color: #f37021;
}

.vale-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

.vale-check-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #CBD5E1;
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.vale-check-box::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.vale-checkbox-label:has(input:checked) .vale-check-box {
    background: #f37021;
    border-color: #f37021;
}
.vale-checkbox-label:has(input:checked) .vale-check-box::after {
    opacity: 1;
}

.vale-check-texto {
    flex: 1;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    transition: color 0.18s ease;
}
.vale-checkbox-label:has(input:checked) .vale-check-texto {
    color: #001e3d;
    font-weight: 600;
}

.vale-check-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: #F1F5F9;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
}
.vale-checkbox-label:has(input:checked) .vale-check-count {
    background: #f37021;
    color: #fff;
}

/* --- 3. BARRA DE CONTROL SUPERIOR --- */
.vale-tienda-barra-control {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 30, 61, 0.02);
}

.vale-ordenar-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #475569;
}

.vale-select-wrapper select {
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #001e3d;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
}

.vale-paginacion-top { display: flex; gap: 8px; }
.vale-paginacion-top span {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.vale-paginacion-top span.active,
.vale-paginacion-top span:hover {
    background-color: #001e3d;
    color: #ffffff;
    font-weight: 600;
}

.vale-pag-num { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 14px; }
.vale-pag-num.active { background: #001e3d; color: #fff; border-radius: 6px; }

/* =================================================================
   GRID DE PRODUCTOS Y TARJETAS
   ================================================================= */
#tiendaGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    grid-auto-rows: min-content; 
}

.vale-producto-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eaecf0;
    border-bottom: 3px solid transparent;
    padding: 20px 20px 5px 20px;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0;
    transition: all 0.25s ease;
}

.vale-producto-card:hover {
    box-shadow: 0 12px 28px rgba(0,26,51,0.09);
    transform: translateY(-3px);
    border-bottom-color: #f37021;
}

.vale-prod-img-container {
    position: relative;
    width: 100%;
    height: 180px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vale-prod-img-container img:not(.vale-prod-marca-tag) {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.vale-prod-marca-tag {
    position: absolute;
    top: 0;
    right: 0;
    max-width: 60px !important;
    max-height: 40px !important;
    object-fit: contain;
    background: transparent;
    padding: 3px 5px;
    border-radius: 4px;
    border: 1px solid transparent;
    z-index: 2;
}

.vale-prod-info { 
    padding: 10px 0; 
    flex-grow: 1; 
}

.vale-prod-marca-texto {
    font-size: 11px;
    text-transform: uppercase;
    color: #6B7A90;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

.vale-prod-titulo { 
    font-size: 14px; 
    color: #1e293b; 
    margin-bottom: 5px; 
    line-height: 1.3;
    min-height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vale-prod-precios-contenedor {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
    gap: 2px;
}

.vale-prod-fila-superior {
    display: flex;
    align-items: center;
    min-height: 18px;
}

.vale-prod-fila-inferior {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vale-prod-precio-oferta {
    font-size: 18px;
    font-weight: 800;
    color: #001e3d;
    margin: 0;
}

.vale-prod-precio-original {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    margin: 0;
}

.vale-prod-badge-descuento {
    background-color: #f37021;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.vale-prod-footer-card {
    display: grid;
    grid-template-columns: 1fr auto; 
    align-items: center;
    margin-top: 12px;
    min-height: 36px;
    gap: 10px;
}

.vale-prod-colores {
    display: flex;
    gap: 6px;
    align-items: center;
}

.vale-prod-colores:empty {
    display: none;
}

.vale-prod-colores:empty + .vale-btn-carrito {
    grid-column: 1 / span 2;
    justify-self: center;
    width: 100%;
    max-width: 150px;
}

.vale-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #dde3eb;
    transition: transform 0.18s ease;
}

.vale-color-dot.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #f37021;
}

.vale-color-dot-mas {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #e2e8f0;
}

.vale-btn-carrito {
    background: #2d3135;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vale-btn-carrito:hover { background: #f37021; }

@media (max-width: 1024px) { 
    #tiendaGrid { grid-template-columns: repeat(3, 1fr) !important; } 
}

/* =================================================================
   ADAPTACIÓN MÓVIL — TIENDA DE PRODUCTOS (CORREGIDO Y UNIFICADO)
   ================================================================= */
@media (max-width: 768px) {
    body, html {
        background-color: #ffffff !important;
        overflow-x: hidden !important; /* Evita que cualquier elemento desborde la pantalla horizontalmente */
    }

    .vale-tienda-seccion { 
        padding: 10px 0; 
        background-color: #ffffff !important; 
    }
    
    .vale-tienda-contenedor { 
        padding: 0 4px !important; 
        max-width: 100% !important;
    }

    /* --- BREADCRUMBS --- */
    .vale-breadcrumbs { 
        font-size: 11px; 
        gap: 5px; 
        margin-bottom: 14px; 
        margin-left: 24px; 
    }
    .vale-bc-separador { font-size: 9px; }

    .vale-tienda-sidebar { display: none; }
    .vale-tienda-layout { grid-template-columns: 1fr; gap: 0; background-color: #ffffff; }

    .vale-tienda-barra-control {
        padding: 6px 8px;
        margin-bottom: 10px;
        gap: 4px;
        flex-wrap: wrap;
        border-radius: 8px;
        background-color: #ffffff;
    }
    .vale-ordenar-box { font-size: 10.5px; gap: 4px; }
    .vale-ordenar-box label { white-space: nowrap; }
    .vale-select-wrapper select { padding: 3px 14px 3px 4px; font-size: 10.5px; }
    .vale-paginacion-top { gap: 3px; }
    .vale-paginacion-top span,
    .vale-pag-num { width: 20px; height: 20px; font-size: 10.5px; }

    /* --- GRILLA DE 3 COLUMNAS EN MÓVIL (Sin desbordes) --- */
    #tiendaGrid { 
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 6px !important; 
        background-color: #ffffff !important; 
        width: 100% !important;
        box-sizing: border-box;
    }

    .vale-producto-card { 
        padding: 8px 6px 6px 6px !important; 
        border-radius: 8px; 
        background-color: #ffffff !important; 
        width: 100% !important;
        box-sizing: border-box;
    }
    .vale-producto-card:hover { transform: none; }

    .vale-prod-img-container { 
        height: 85px !important; 
        border-radius: 5px; 
        background-color: #ffffff !important; 
    }
    .vale-prod-img-container img:not(.vale-prod-marca-tag) {
        max-width: 90%;
        max-height: 90%;
    }

    /* --- LOGO DE LA MARCA EN LA TARJETA --- */
    .vale-prod-marca-tag { 
        max-width: 30px !important; 
        max-height: 20px !important; 
        padding: 1px; 
    }

    .vale-prod-info { padding: 4px 0 0; background-color: #ffffff !important; }
    .vale-prod-marca-texto { font-size: 7px; margin-bottom: 1px; letter-spacing: 0.1px; }
    .vale-prod-titulo { font-size: 9px; min-height: 22px; margin-bottom: 2px; line-height: 1.15; }

    .vale-prod-precios-contenedor { margin: 2px 0; gap: 0; }
    .vale-prod-fila-superior { min-height: 9px; }
    .vale-prod-fila-inferior { gap: 2px; flex-wrap: wrap; }
    .vale-prod-precio-oferta { font-size: 10.5px; }
    .vale-prod-precio-original { font-size: 7.5px; }
    .vale-prod-badge-descuento { font-size: 7px; padding: 1px 2px; }

    .vale-prod-footer-card { margin-top: 4px; min-height: 24px; gap: 2px; }
    .vale-color-dot,
    .vale-color-dot-mas { width: 9px; height: 9px; }
    .vale-color-dot-mas { font-size: 6.5px; }

    /* --- BOTÓN DEL CARRITO EN MÓVIL --- */
    .vale-btn-carrito { 
        width: 28px !important; 
        height: 28px !important; 
        min-width: 28px !important; 
        min-height: 28px !important; 
        border-radius: 4px; 
    }
    
    .vale-btn-carrito i, 
    .vale-btn-carrito svg { 
        font-size: 25px !important; 
    }

    .vale-prod-colores:empty + .vale-btn-carrito { max-width: 100%; }

    /* --- CARRUSEL DE MARCAS EN MÓVIL (AJUSTADO CON NAVEGACIÓN ENLACE) --- */
    .vale-productos-marcas-seccion {
        padding: 20px 0;
    }

    .vale-marcas-slider-track {
        gap: 10px !important; /* Espacio limpio entre marcas */
    }

    .vale-prod-marca-card {
        width: calc((100vw - 32px - 20px) / 3) !important; 
        max-width: 110px;
        height: 55px !important;
        padding: 6px 8px !important;
    }

    /* Enlace contenedor en móvil */
    .vale-prod-marca-card a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        text-decoration: none;
    }

    /* Imagen de la marca restringida a la tarjeta en móvil */
    .vale-prod-marca-card img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* Difuminados laterales adaptados */
    .vale-productos-marcas-seccion::before,
    .vale-productos-marcas-seccion::after {
        width: 50px !important;
    }
}