/* ODS Sidebar V2 — PATCH: support togglers + sous-menus + preserve JS */

/* =========================================================
   1) APPLIQUER LE STYLE CARD AUSSI AUX TOGGLERS Services/Courses
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.005em !important;
    color: #0F172A !important;
    padding: 13px 16px !important;
    border-radius: 10px !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    position: relative !important;
    margin: 0 !important;
    cursor: pointer !important;
}

/* Icône principale du toggler (1ère SVG) */
body aside.ods-sidebar .ods-sb-toggle > svg:first-of-type {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    color: #64748B !important;
    stroke: #64748B !important;
    fill: none !important;
    stroke-width: 2 !important;
    transition: color 0.2s !important;
}

/* =========================================================
   2) CHEVRON NATIF .ods-sb-chev — conserver, le styliser, lui donner auto-push
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle .ods-sb-chev {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    color: #94A3B8 !important;
    stroke: #94A3B8 !important;
    fill: none !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s !important;
}

/* Quand le toggler est ouvert, le chevron pointe vers le bas */
body aside.ods-sidebar .ods-sb-toggle.active .ods-sb-chev,
body aside.ods-sidebar .ods-sb-toggle.open .ods-sb-chev,
body aside.ods-sidebar .ods-sb-toggle[aria-expanded="true"] .ods-sb-chev {
    transform: rotate(90deg) !important;
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}

/* =========================================================
   3) SUPPRIMER LE CHEVRON ::after SUR LES TOGGLERS (il y a déjà le natif)
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle::after {
    content: none !important;
    display: none !important;
}

/* =========================================================
   4) HOVER sur togglers
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle:hover {
    background: #FFFFFF !important;
    border-color: rgba(45, 122, 31, 0.2) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04) !important;
    transform: translateY(-1px) !important;
    color: #2D7A1F !important;
}

body aside.ods-sidebar .ods-sb-toggle:hover > svg:first-of-type {
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}

body aside.ods-sidebar .ods-sb-toggle:hover .ods-sb-chev {
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}

/* =========================================================
   5) ACTIVE STATE sur togglers (sous-menu ouvert)
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle.active,
body aside.ods-sidebar .ods-sb-toggle.open,
body aside.ods-sidebar .ods-sb-toggle[aria-expanded="true"] {
    background: #F0F7ED !important;
    border-color: rgba(45, 122, 31, 0.3) !important;
    color: #2D7A1F !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(45, 122, 31, 0.08) !important;
}

body aside.ods-sidebar .ods-sb-toggle.active > svg:first-of-type,
body aside.ods-sidebar .ods-sb-toggle.open > svg:first-of-type,
body aside.ods-sidebar .ods-sb-toggle[aria-expanded="true"] > svg:first-of-type {
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}

/* =========================================================
   6) SOUS-MENU .ods-sb-sub — Style premium
   ========================================================= */
body aside.ods-sidebar .ods-sb-sub {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 6px 0 6px 36px !important;
    margin: 4px 0 8px 0 !important;
    border-left: 2px solid rgba(226, 232, 240, 0.8) !important;
    margin-left: 24px !important;
}

body aside.ods-sidebar .ods-sb-sub a {
    display: flex !important;
    align-items: center !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #64748B !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    transition: all 0.15s !important;
    line-height: 1.4 !important;
}

body aside.ods-sidebar .ods-sb-sub a:hover {
    background: #F1F5F9 !important;
    color: #2D7A1F !important;
    transform: translateX(2px) !important;
}

body aside.ods-sidebar .ods-sb-sub a[aria-current="page"],
body aside.ods-sidebar .ods-sb-sub a.active,
body aside.ods-sidebar .ods-sb-sub a.current-menu-item {
    background: #F0F7ED !important;
    color: #2D7A1F !important;
    font-weight: 600 !important;
}

/* =========================================================
   7) GARANTIR que .ods-sb-toggle reste cliquable
   (sécurité contre pointer-events accidentel)
   ========================================================= */
body aside.ods-sidebar .ods-sb-toggle,
body aside.ods-sidebar .ods-sb-toggle * {
    pointer-events: auto !important;
}
