/* ══════════════════════════════════════════════════════
   MFB - Sidebar Formateurs Hierarchique
   Fichier : /wp-content/themes/hello-elementor-child/css/formateurs-sidebar.css
   Version : 1.1.0
   ══════════════════════════════════════════════════════ */

/* ── SIDEBAR CARD ── */
.mfb-tax-sidebar {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #f0f0f5;
    overflow: hidden;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.mfb-tax-sidebar::-webkit-scrollbar { width: 4px; }
.mfb-tax-sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* ── TITRE ── */
.mfb-tax-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #0a1f6e;
    border-bottom: 1px solid #f0f0f5;
    background: #fafafe;
    position: sticky;
    top: 0;
    z-index: 2;
}
.mfb-tax-title svg { color: #7c3aed; }

/* ── LIEN "TOUS" ── */
.mfb-tax-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    border-bottom: 1px solid #f0f0f5;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}
.mfb-tax-all:hover {
    background: #faf8ff;
    color: #7c3aed;
    border-left-color: rgba(124, 58, 237, 0.3);
}
.mfb-tax-all.active {
    background: linear-gradient(90deg, #faf5ff, #fff);
    color: #7c3aed;
    font-weight: 700;
    border-left-color: #7c3aed;
}

/* ── BADGE COUNT ── */
.mfb-tax-count {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 7px;
    border-radius: 50px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   ACCORDEON DETAILS/SUMMARY (SEO-friendly)
   ══════════════════════════════════════════════════════ */
.mfb-tax-group {
    border-bottom: 1px solid #f5f5fa;
}
.mfb-tax-group:last-child { border-bottom: none; }

.mfb-tax-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    list-style: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    user-select: none;
}
.mfb-tax-group summary::-webkit-details-marker { display: none; }
.mfb-tax-group summary::marker { display: none; content: ''; }

.mfb-tax-group summary:hover {
    background: #faf8ff;
    color: #7c3aed;
    border-left-color: rgba(124, 58, 237, 0.3);
}
.mfb-tax-group[open] > summary {
    color: #7c3aed;
    font-weight: 700;
    background: #faf8ff;
    border-left-color: #7c3aed;
}

/* Parent info (nom + count) */
.mfb-tax-parent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.mfb-tax-parent-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: #1a1a2e;
}
.mfb-tax-parent-name:hover { color: #7c3aed; text-decoration: underline; }

/* Count badge quand ouvert/hover */
.mfb-tax-group[open] .mfb-tax-count,
.mfb-tax-group summary:hover .mfb-tax-count {
    background: linear-gradient(135deg, #7c3aed, #063cff);
    color: #fff;
}

/* Chevron */
.mfb-tax-chevron {
    flex-shrink: 0;
    color: #c4c4c4;
    transition: transform 0.2s;
    margin-left: 4px;
}
.mfb-tax-group[open] .mfb-tax-chevron {
    transform: rotate(90deg);
    color: #7c3aed;
}

/* ══════════════════════════════════════════════════════
   SOUS-CATEGORIES (enfants)
   ══════════════════════════════════════════════════════ */
.mfb-tax-children {
    padding: 2px 0 8px;
    background: #fcfbff;
}
.mfb-tax-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 20px 7px 36px;
    font-size: 13px;
    color: #1a1a2e;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.mfb-tax-child:hover {
    color: #7c3aed;
    background: #f5f0ff;
    border-left-color: rgba(124, 58, 237, 0.2);
}
.mfb-tax-child.active {
    color: #7c3aed;
    font-weight: 700;
    background: #f5f0ff;
    border-left-color: #7c3aed;
}
.mfb-tax-child-count {
    font-size: 10px;
    color: #b0b0b0;
    font-weight: 600;
}
.mfb-tax-child:hover .mfb-tax-child-count { color: #7c3aed; }

/* Items a 0 formateurs */
.mfb-tax-child--zero { opacity: 0.5; }
.mfb-tax-child--zero:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════
   CTA SIDEBAR
   ══════════════════════════════════════════════════════ */
.mfb-tax-cta {
    margin-top: 16px;
    background: linear-gradient(160deg, #0a1f6e, #7c3aed);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    color: #fff;
}
.mfb-tax-cta-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.mfb-tax-cta-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    line-height: 1.5;
}
.mfb-tax-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: #f5a623;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}
.mfb-tax-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
}

/* ══════════════════════════════════════════════════════
   MOBILE : BOUTON TOGGLE + PANEL
   Masqué en desktop, visible uniquement en mobile
   ══════════════════════════════════════════════════════ */
.mfb-tax-mobile-toggle {
    display: none !important;
    margin-bottom: 20px;
}
.mfb-tax-mobile-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 14px 20px !important;
    background: #fff !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0a1f6e !important;
    cursor: pointer;
    font-family: inherit;
}
.mfb-tax-mobile-btn:hover,
.mfb-tax-mobile-btn:focus {
    background: #faf5ff !important;
    border-color: #7c3aed !important;
    color: #7c3aed !important;
    outline: none;
}
.mfb-tax-mobile-btn.open {
    background: #faf5ff !important;
    border-color: #7c3aed !important;
    color: #7c3aed !important;
}
.mfb-tax-mobile-btn svg {
    color: #7c3aed !important;
    transition: transform 0.2s;
}
.mfb-tax-mobile-btn.open svg { transform: rotate(180deg); }

.mfb-tax-mobile-panel {
    display: none;
    background: #fff;
    border: 1px solid #f0f0f5;
    border-radius: 16px;
    margin-top: 8px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px 0;
}
.mfb-tax-mobile-panel.open { display: block; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mfb-tax-sidebar,
    .mfb-tax-cta {
        display: none;
    }
    .mfb-tax-mobile-toggle {
        display: block !important;
    }
}
