/* ==========================================================================
   HOJA DE ESTILOS: HOME PRODUCCIÓN
   Descripción: Estilos para el Home, carruseles, tarjetas y accesibilidad.
   ========================================================================== */

.fw-black,
.titulo-seccion {
    font-weight: 900 !important;
}

/* 🔥 CSS Carrusel Horizontal */
.scroll-horizontal {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 15px;
    padding-top: 5px;
    scroll-behavior: smooth;
}

.scroll-horizontal::-webkit-scrollbar {
    display: none;
}

.scroll-horizontal>.col {
    flex: 0 0 auto;
    width: 65vw;
    max-width: 220px;
}

@media (min-width: 576px) { .scroll-horizontal>.col { width: 40vw; } }
@media (min-width: 768px) { .scroll-horizontal>.col { width: 30vw; } }
@media (min-width: 992px) { .scroll-horizontal>.col { width: 220px; } }

/* 🔥 Estilo de Tarjeta Seleccionada */
.tarjeta-seleccionada {
    background-color: rgba(133, 194, 38, 0.12) !important;
    border: 2px solid #85C226 !important;
    transition: all 0.3s ease;
}

/* 🔥 CSS Flechas de los Carruseles Horizontales */
.wrapper-scroll { position: relative; }

.btn-scroll-arrow {
    position: absolute;
    top: calc(50% - 15px);
    transform: translateY(-50%);
    z-index: 10;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
    color: #2A1B5E;
    background-color: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

.btn-scroll-arrow.left { left: 0px; }
.btn-scroll-arrow.right { right: 0px; }

@media (max-width: 768px) {
    .btn-scroll-arrow { display: none !important; }
}

/* ==========================================
   🔥 FIX DEFINITIVO: TARJETAS DE PRODUCTOS
   ========================================== */
.card-title, 
.card-body h6, 
.card-body h5 {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    overflow: hidden !important;
    height: 3.6em !important;
    line-height: 1.2em !important;
    margin-bottom: 10px !important;
}

.card-body {
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 15px !important; 
}

/* 🔥 NUEVO: CONTROLES DE CARRITO TIPO SUPERMERCADO */
.bottom-card-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto !important;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.cart-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cart-action {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-cart-plus {
    background-color: #85C226 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
}
.btn-cart-plus:hover { background-color: #72a720 !important; }

.btn-cart-minus {
    background-color: transparent !important;
    color: #E63946 !important;
    border: 1px solid #E63946 !important;
}
.btn-cart-minus:hover { background-color: #fff0f1 !important; color: #E63946 !important;}

.cart-qty-text {
    font-size: 1.1rem;
    font-weight: 900;
    color: #2A1B5E;
    min-width: 14px;
    text-align: center;
}

.cart-action-group[data-qty="0"] .btn-cart-minus,
.cart-action-group[data-qty="0"] .cart-qty-text {
    display: none !important;
}

.scroll-horizontal .card,
.row-cols-2 .card,
.grilla-dinamica .card,
.card {
    overflow: visible !important;
    border-radius: 12px !important;
    height: 100%;
}

.card img:first-child {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

@media (min-width: 992px) {
    .grilla-categorias-custom > .col {
        flex: 0 0 auto !important;
        width: 12.5% !important;
    }
}

/* ==========================================
   🤖 BOTÓN ACCESIBILIDAD FLOTANTE
   ========================================== */
#btn-accesibilidad-flotante {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}
#btn-accesibilidad-flotante button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid white;
    transition: transform 0.3s ease;
    background-color: var(--cenco-indigo, #2A1B5E);
}
#btn-accesibilidad-flotante i {
    font-size: 2.2rem;
}
#btn-accesibilidad-flotante button:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    #btn-accesibilidad-flotante {
        bottom: 20px;
        left: 20px;
    }
    #btn-accesibilidad-flotante button {
        width: 50px;
        height: 50px;
    }
    #btn-accesibilidad-flotante i {
        font-size: 1.8rem;
    }
}

/* ==========================================
   🤖 ACCESIBILIDAD (MOTOR VISUAL)
   ========================================== */

/* --- 1. TAMAÑOS DE TEXTO (Lectura) --- */
/* Bootstrap base es 16px. Modificamos la raíz para que todo crezca proporcionalmente */
html.access-lvl-1 { font-size: 18px !important; }
html.access-lvl-2 { font-size: 20px !important; }
html.access-lvl-3 { font-size: 22px !important; }

/* --- 2. FUENTE DISLEXIA --- */
body.access-dyslexic,
body.access-dyslexic * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', Arial, sans-serif !important;
    letter-spacing: 0.1em !important;
    line-height: 1.6 !important;
}

/* --- 3. MODO OSCURO --- */
body.access-dark {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}
body.access-dark .bg-white, 
body.access-dark .bg-light,
body.access-dark .card,
body.access-dark .modal-content,
body.access-dark .offcanvas {
    background-color: #1e1e1e !important;
    color: #f1f1f1 !important;
    border-color: #333 !important;
}
body.access-dark .text-dark,
body.access-dark .text-muted {
    color: #b0b0b0 !important;
}

/* --- 4. ALTO CONTRASTE --- */
body.access-high-contrast {
    background-color: #000000 !important;
    color: #ffff00 !important;
}
body.access-high-contrast * {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
}
body.access-high-contrast img {
    border: 2px solid #ffff00 !important;
}

/* --- 5. INVERTIR COLORES --- */
body.access-invert {
    filter: invert(100%) hue-rotate(180deg);
    background-color: #000;
}
/* Protegemos las imágenes para que no se vean como "rayos X" */
body.access-invert img,
body.access-invert video {
    filter: invert(100%) hue-rotate(180deg); 
}

/* --- 6. FILTROS DE DALTONISMO --- */
body.filter-grayscale { filter: grayscale(100%) !important; }
body.filter-protanopia { filter: sepia(0.4) hue-rotate(-15deg) !important; }
body.filter-deuteranopia { filter: sepia(0.5) hue-rotate(-30deg) !important; }
body.filter-tritanopia { filter: sepia(0.5) hue-rotate(135deg) !important; }

/* --- 7. SIN ANIMACIONES --- */
body.access-no-anim, 
body.access-no-anim * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
}