/* ==========================================================================
   CWMEGAMENU - OFFCANVAS UNIVERSAL (Móvil, Tablet y Escritorio)
   ========================================================================== */

/* ── 1. BOTÓN DE APERTURA ── */
.cwmegamenu-mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #dcdcdc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.cwmegamenu-mobile-btn:hover {
    color: #ff6000; /* Naranja corporativo */
}

/* ── 2. OVERLAY OSCURO ── */
.cwmegamenu-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.6) !important; 
    z-index: 9998 !important; /* Subimos por encima del sticky-header */
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease;
}

.cwmegamenu-overlay.is-active { 
    opacity: 1; 
    visibility: visible; 
}

/* ── 3. CANVAS PRINCIPAL (PANEL LATERAL) ── */
.cwmegamenu {
    position: fixed; 
    top: 0; 
    left: 0;
    transform: translateX(-100%);
    width: 85%; 
    max-width: 400px;
    height: 100vh;
    background-color: #ffffff !important; /* FORZAMOS fondo blanco sólido */
    z-index: 9999 !important; /* Nivel máximo, por encima del overlay */
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; 
    overflow-x: hidden; 
    color: #333333;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1); /* Sombra para darle profundidad */
}

.cwmegamenu.is-open { 
    transform: translateX(0); 
}

/* Cabecera Principal */
.cwmegamenu-mobile-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 1rem 1.5rem; 
    background-color: #f5f5f5 !important; /* Gris muy claro sólido */
    border-bottom: 1px solid #ebebeb; 
    font-weight: 700; 
    font-size: 1.1rem;
    text-transform: uppercase;
}

.cwmegamenu-close-btn { 
    background: none; 
    border: none; 
    color: #333333; 
    font-size: 1.5rem; 
    cursor: pointer; 
    padding: 0; 
    transition: color 0.2s;
}

.cwmegamenu-close-btn:hover {
    color: #bf0019; /* Rojo hover */
}

/* ── 4. NAVEGACIÓN DE PRIMER NIVEL (Bloqueamos el hover nativo) ── */
.cwmegamenu ul.navbar-nav { 
    display: block !important; 
    width: 100% !important;
    margin: 0; 
    padding: 0; 
    list-style: none;
}

.cwmegamenu ul.navbar-nav > li { 
    display: block !important;
    width: 100% !important;
    position: static !important; /* Vital para que el submenú cubra todo el alto */
    border-bottom: 1px solid #ebebeb; 
    padding: 0; 
}

.cwmegamenu ul.navbar-nav > li > a.section-link {
    display: flex !important; 
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    padding: 0.8rem 1rem; 
    font-weight: 600; 
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.cwmegamenu ul.navbar-nav > li > a.section-link:hover {
    background-color: #f5f5f5;
    color: #ff6000; /* Naranja corporativo */
}

.cwmegamenu-arrow { 
    font-size: 1.5rem; 
    color: #dcdcdc; 
}

/* ── 5. CANVAS SECUNDARIO (SUBMENÚS ANIMADOS) ── */
.cwmegamenu .megamenu-content {
    display: block !important; /* Sobrescribe Bootstrap */
    position: absolute !important;
    top: 0; 
    left: 0; 
    transform: translateX(100%); /* Oculto a la derecha */
    width: 100%; 
    min-height: 100%; 
    background-color: #ffffff !important; /* FORZAMOS fondo blanco sólido */
    padding: 0; 
    margin: 0;
    transition: transform 0.3s ease-in-out, visibility 0.3s; 
    z-index: 10000 !important; /* Un punto más que el canvas principal */
    visibility: hidden; /* Evita clics invisibles */
    box-shadow: none !important;
}

/* Activación por JS */
.cwmegamenu .megamenu-content.is-active {
    transform: translateX(0) !important;
    visibility: visible !important;
}

/* Neutralizamos cualquier efecto hover de Bootstrap en escritorio */
.cwmegamenu ul.navbar-nav > li:hover .megamenu-content:not(.is-active) {
    transform: translateX(100%) !important;
    visibility: hidden !important;
}

/* Cabecera del Submenú */
.cwmegamenu-submenu-header {
    display: flex; 
    flex-direction: column; 
    align-items: flex-start;
    padding: 1rem 1.5rem; 
    background-color: #ffffff; 
    border-bottom: 1px solid #ebebeb;
}

.cwmegamenu-back-btn {
    background: none; 
    border: none; 
    color: #dcdcdc;
    font-size: 0.875rem; 
    cursor: pointer; 
    padding: 0 0 1rem 0;
    display: flex; 
    align-items: center; 
    gap: 0.25rem; 
    font-weight: 600; 
    text-transform: uppercase;
    transition: color 0.2s;
}

.cwmegamenu-back-btn:hover {
    color: #ff6000;
}

.cwmegamenu-submenu-title { 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: #333333; 
    margin: 0; 
    text-transform: uppercase; 
}

/* ── 6. LISTADO DE SUBCATEGORÍAS ── */
.cwmegamenu .megamenu-items-list { 
    padding: 0; 
    margin: 0; 
    list-style: none; 
    width: 100%;
}

.cwmegamenu .megamenu-items-list li { 
    border-bottom: 1px solid #ebebeb; 
}

.cwmegamenu .megamenu-items-list a {
    display: block; 
    padding: 0.8rem 1rem; 
    color: #828282; 
    text-decoration: none; 
    font-size: 1.0625rem; 
    font-weight: 100;
    transition: background-color 0.2s, color 0.2s;
}

.cwmegamenu .megamenu-items-list a:hover { 
    background-color: #f5f5f5; 
    color: #ff6000;
}

/* Tercer Nivel */
.cwmegamenu .megamenu-subcategories { 
    padding: 0; 
    margin: 0; 
    list-style: none; 
}

.cwmegamenu .megamenu-subcategories li { 
    border: none; 
}

.cwmegamenu .megamenu-subcategories a { 
    padding-left: 2.5rem; 
    font-weight: 400; 
    color: #888888; 
}

.cwmegamenu .megamenu-subcategories a:hover { 
    color: #ff6000; 
}

#checkout #_mobile_cwmenu.d-flex{
    display: none !important;
}