/* CANVAS DROPDOWN - SOLUCIÓN DEFINITIVA */

/* 1. OCULTAR TODAS LAS FLECHAS ORIGINALES DEL TEMA */
.site-drawer .menu-item-has-children > a::after,
.site-drawer .klb-menu .menu-item-has-children > a::after,
.site-drawer .drawer-menu .klb-menu li.menu-item-has-children > a::after,
.site-drawer .menu-item-has-children > a .dropdown-indicator {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
}

/* 2. ASEGURAR QUE LOS MENU ITEMS TENGAN POSICIÓN RELATIVA */
.site-drawer .menu-item-has-children {
    position: relative !important;
}

/* 3. DAR ESPACIO PARA NUESTRO BOTÓN */
.site-drawer .menu-item-has-children > a {
    padding-right: 50px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    min-height: 48px !important;
}

/* 4. ESTILOS PARA NUESTRO BOTÓN DROPDOWN */
.site-drawer .menu-dropdown {
    display: flex !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 38, 116, 0.1) !important;
    border: 1px solid rgba(0, 38, 116, 0.2) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    color: var(--theme-primary-color, #002674) !important;
    z-index: 999 !important;
    width: 28px !important;
    height: 28px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}

/* 5. TRANSICIÓN SUAVE PARA EL SVG */
.site-drawer .menu-dropdown svg {
    transition: transform 0.3s ease !important;
    color: inherit !important;
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2.5 !important;
}

/* 6. HOVER EFFECT */
.site-drawer .menu-dropdown:hover {
    background: rgba(0, 38, 116, 0.15) !important;
    border-color: rgba(0, 38, 116, 0.3) !important;
    transform: translateY(-50%) !important;
}

/* 7. ESTADO ACTIVO */
.site-drawer .menu-item-has-children.active .menu-dropdown,
.site-drawer .menu-item-has-children.dropdown-open .menu-dropdown {
    background: var(--theme-primary-color, #002674) !important;
    border-color: var(--theme-primary-color, #002674) !important;
    color: white !important;
}

.site-drawer .menu-item-has-children.active .menu-dropdown svg,
.site-drawer .menu-item-has-children.dropdown-open .menu-dropdown svg {
    color: white !important;
    transform: rotate(180deg) !important;
}

/* 7. ESTILOS PARA SUBMENÚS */
.site-drawer .sub-menu {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    padding-left: 1.5rem !important;
    margin-top: 0.5rem !important;
}

/* 8. SUBMENÚS ACTIVOS */
.site-drawer .menu-item-has-children.active .sub-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
}

/* 9. ELEMENTOS DEL SUBMENÚ */
.site-drawer .menu-item-has-children.active .sub-menu li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    margin: 0.25rem 0 !important;
}

.site-drawer .menu-item-has-children.active .sub-menu li a {
    display: block !important;
    visibility: visible !important;
    opacity: 0.8 !important;
    font-size: 0.875rem !important;
    padding: 0.4rem 0 !important;
    color: currentColor !important;
    text-transform: uppercase !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
}

.site-drawer .menu-item-has-children.active .sub-menu li a:hover {
    opacity: 1 !important;
    color: var(--theme-primary-color, #002674) !important;
    padding-left: 0.5rem !important;
    transition: all 0.3s ease !important;
}

/* 10. FORZAR VISIBILIDAD COMPLETA */
.site-drawer .menu-item-has-children.dropdown-open .sub-menu,
.site-drawer .menu-item-has-children.active .sub-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    background: rgba(0, 255, 0, 0.05) !important; /* Debug verde muy sutil */
    border-left: 2px solid rgba(0, 38, 116, 0.2) !important;
    min-height: 2rem !important;
}

/* 11. SOBRESCRIBIR CUALQUIER ESTILO CONFLICTIVO DEL TEMA */
.site-drawer .drawer-menu .klb-menu .sub-menu,
.site-drawer .klb-menu .sub-menu {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: auto !important;
}

/* 12. RESPONSIVE */
@media (max-width: 768px) {
    .site-drawer .menu-dropdown {
        right: 10px !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    .site-drawer .menu-dropdown svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .site-drawer .menu-item-has-children > a {
        padding-right: 40px !important;
    }
}
