/* ==========================================================
   SOFTAFRIK LOT 03B-R6 MENU GROUPE
   Navigation groupée ordinateur et mobile
   ========================================================== */

.topbar,
.topbar-inner,
.topbar-nav-grouped {
    overflow: visible;
}

.topbar-nav-grouped {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.topbar-nav-grouped > .nav-direct-link,
.topbar-nav-grouped .nav-group-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.6rem 0.72rem;
    border: 0;
    border-radius: 0.65rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.topbar-nav-grouped > .nav-direct-link:hover,
.topbar-nav-grouped > .nav-direct-link:focus-visible,
.topbar-nav-grouped .nav-group-trigger:hover,
.topbar-nav-grouped .nav-group-trigger:focus-visible,
.topbar-nav-grouped > .nav-direct-link[aria-current="page"],
.topbar-nav-grouped .nav-group.is-current > .nav-group-trigger,
.topbar-nav-grouped .nav-group.is-open > .nav-group-trigger {
    background: var(--gray-100);
    color: var(--color-primary);
}

.topbar-nav-grouped .nav-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.topbar-nav-grouped .nav-group-trigger {
    gap: 0.35rem;
}

.topbar-nav-grouped .nav-group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 160ms ease;
}

.topbar-nav-grouped .nav-group.is-open .nav-group-chevron {
    transform: rotate(180deg);
}

.topbar-nav-grouped .nav-group-menu {
    top: calc(100% + 0.55rem);
    right: auto;
    left: 50%;
    width: max-content;
    min-width: 220px;
    max-width: min(300px, calc(100vw - 2rem));
    padding: 0.45rem;
    border-radius: 0.85rem;
    transform: translate(-50%, 0.4rem);
}

.topbar-nav-grouped .nav-group.is-open .nav-group-menu {
    transform: translate(-50%, 0);
}

.topbar-nav-grouped .nav-group-menu a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0.7rem 0.8rem;
    border-radius: 0.6rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: normal;
}

.topbar-nav-grouped .nav-group-menu a:hover,
.topbar-nav-grouped .nav-group-menu a:focus-visible,
.topbar-nav-grouped .nav-group-menu a.is-current,
.topbar-nav-grouped .nav-group-menu a[aria-current="page"] {
    background: var(--gray-100);
    color: var(--color-primary);
}

.mobile-drawer-grouped .drawer-direct-link {
    display: flex;
    align-items: center;
    min-height: 48px;
}

.mobile-drawer-grouped .drawer-group {
    margin: 0;
    border: 0;
}

.mobile-drawer-grouped .drawer-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0.75rem 0;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.mobile-drawer-grouped .drawer-group-summary::-webkit-details-marker {
    display: none;
}

.mobile-drawer-grouped .drawer-group-summary::marker {
    content: "";
}

.mobile-drawer-grouped .drawer-group-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--gray-100);
    font-size: 1.1rem;
    line-height: 1;
    transition:
        transform 160ms ease,
        background-color 160ms ease;
}

.mobile-drawer-grouped .drawer-group[open] .drawer-group-symbol {
    background: var(--gray-200);
    transform: rotate(45deg);
}

.mobile-drawer-grouped .drawer-group-links {
    display: grid;
    gap: 0.15rem;
    padding: 0 0 0.7rem 0.75rem;
}

.mobile-drawer-grouped .drawer-group-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.62rem 0.75rem;
    border-left: 2px solid var(--gray-200);
    border-radius: 0 0.55rem 0.55rem 0;
    color: inherit;
    font-size: 0.94rem;
    text-decoration: none;
}

.mobile-drawer-grouped .drawer-group-links a:hover,
.mobile-drawer-grouped .drawer-group-links a:focus-visible,
.mobile-drawer-grouped .drawer-group-links a[aria-current="page"] {
    border-left-color: var(--color-primary);
    background: var(--gray-100);
    color: var(--color-primary);
}

@media (max-width: 1200px) and (min-width: 1025px) {
    .topbar-nav-grouped {
        gap: 0;
    }

    .topbar-nav-grouped > .nav-direct-link,
    .topbar-nav-grouped .nav-group-trigger {
        padding-inline: 0.5rem;
        font-size: 0.86rem;
    }
}

@media (max-width: 1024px) {
    .topbar-nav-grouped {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topbar-nav-grouped .nav-group-chevron,
    .mobile-drawer-grouped .drawer-group-symbol {
        transition: none;
    }
}

/* FIN SOFTAFRIK LOT 03B-R6 MENU GROUPE */

/* ==========================================================================
   SOFTAFRIK-03C-B2-R1-CTA-MOBILE-MENU-STICKY
   Menu conservé en haut au défilement et correction des CTA sur mobile.
   ========================================================================== */

/*
 * Le menu reste dans le flux normal de la page, puis se fixe en haut
 * lorsqu'il atteint la limite supérieure de la fenêtre.
 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1200;
    isolation: isolate;
}

/*
 * Une légère séparation devient visible lorsque le contenu passe
 * sous le menu pendant le défilement.
 */
.topbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: rgba(15, 59, 58, 0.08);
    content: "";
    pointer-events: none;
}

/*
 * Les ancres internes conservent une marge suffisante pour ne pas
 * être masquées derrière le menu sticky.
 */
html {
    scroll-padding-top: 96px;
}

@media (max-width: 767.98px) {
    /*
     * Empêche les textes longs du CTA de forcer une largeur supérieure
     * à celle de l'écran.
     */
    .cta-banner {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .cta-banner > div {
        min-width: 0;
        max-width: 100%;
    }

    .cta-banner h2,
    .cta-banner p {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /*
     * Les deux boutons deviennent verticaux sur tablette étroite
     * et mobile.
     */
    .cta-banner > .flex {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cta-banner > .flex .btn {
        display: inline-flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 52px;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding-right: 1rem;
        padding-left: 1rem;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 479.98px) {
    html {
        scroll-padding-top: 82px;
    }

    .cta-banner {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .cta-banner h2 {
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.15;
    }

    .cta-banner p {
        line-height: 1.55;
    }
}

/* FIN SOFTAFRIK-03C-B2-R1-CTA-MOBILE-MENU-STICKY */

/* ==========================================================================
   SOFTAFRIK-03C-B2-R3-FIXED-HEADER-CSS
   Menu réellement fixe avec espaceur mesuré dynamiquement.
   ========================================================================== */

:root {
    --softafrik-fixed-header-height: 76px;
}

/*
 * Cette classe n'est ajoutée qu'après création de l'espaceur.
 * Le contenu ne remonte donc pas sous le menu.
 */
html.softafrik-fixed-header-ready header.topbar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 10000 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
    overflow: visible !important;
    box-sizing: border-box;
}

/*
 * Espace réservé à l'emplacement initial du menu fixe.
 */
.softafrik-fixed-header-spacer {
    display: block;
    width: 100%;
    height: var(--softafrik-fixed-header-height);
    min-height: var(--softafrik-fixed-header-height);
    flex: 0 0 var(--softafrik-fixed-header-height);
    pointer-events: none;
}

/*
 * Les ancres ne sont pas cachées derrière le menu.
 */
html.softafrik-fixed-header-ready {
    scroll-padding-top:
        calc(var(--softafrik-fixed-header-height) + 16px);
}

/*
 * Les menus déroulants et le tiroir mobile restent visibles
 * au-dessus du contenu.
 */
html.softafrik-fixed-header-ready header.topbar .dropdown-menu,
html.softafrik-fixed-header-ready header.topbar .mobile-drawer,
html.softafrik-fixed-header-ready header.topbar .mobile-overlay {
    z-index: 10020;
}

/* FIN SOFTAFRIK-03C-B2-R3-FIXED-HEADER-CSS */
