/* Navigation sur téléphone (29/10/2026) : barre du bas façon appli et menu latéral aux couleurs du
   site. Rien ici ne s'applique à partir de 992 px (ordinateur), où le menu du haut reste seul. */

:root {
    --nds-purple: #6f42c1;
    --nds-purple-dark: #4b2a8a;
    --nds-gold: #ffc107;
    --nds-tabbar-h: 62px;
}

/* ----- Barre du bas ----- */
.mobile-tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    background: #fff;
    border-top: 1px solid rgba(111, 66, 193, 0.15);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0); /* barre d'accueil de l'iPhone */
}

.mobile-tabbar__item {
    flex: 1 1 0;
    min-width: 0;
    height: var(--nds-tabbar-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #6b6480;
    text-decoration: none;
    font-size: 11px;
    line-height: 1.15;
    -webkit-tap-highlight-color: transparent;
}

.mobile-tabbar__item i {
    font-size: 22px;
    line-height: 1;
}

.mobile-tabbar__item span {
    max-width: 100%;
    padding-inline: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-tabbar__item.is-active {
    color: var(--nds-purple);
    font-weight: 600;
}

.mobile-tabbar__item.is-active i {
    background: rgba(111, 66, 193, 0.12);
    border-radius: 999px;
    padding: 2px 14px;
}

.mobile-tabbar__item:active {
    background: rgba(111, 66, 193, 0.06);
}

@media (max-width: 991.98px) {
    /* Le bas des pages (pied de page, boutons) ne passe pas sous la barre. */
    body {
        padding-bottom: calc(var(--nds-tabbar-h) + env(safe-area-inset-bottom, 0px));
    }

    /* Messages (toastr) au-dessus de la barre plutôt que sous l'en-tête. */
    #toast-container.toast-top-right {
        top: auto !important;
        bottom: calc(var(--nds-tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: 12px;
    }

    #toast-container > div {
        width: auto !important;
    }

    /* Bouton du menu plus facile à toucher (44 px). */
    .site-header .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ----- Menu latéral (bouton ☰) ----- */
#offcanvasExample {
    background: linear-gradient(180deg, var(--nds-purple) 0%, var(--nds-purple-dark) 100%);
    color: #fff;
    max-width: 86vw;
}

#offcanvasExample .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

#offcanvasExample .navbar-nav {
    gap: 0.25rem !important;
}

#offcanvasExample .navbar-nav .nav-link,
#offcanvasExample .logout-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    color: #fff;
    text-transform: none;
    font-size: 1.05rem;
}

#offcanvasExample .navbar-nav .nav-link i,
#offcanvasExample .logout-link i {
    font-size: 1.3rem;
    opacity: 0.9;
}

#offcanvasExample .navbar-nav .nav-link:hover,
#offcanvasExample .logout-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#offcanvasExample .navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--nds-gold);
    font-weight: 600;
}

#offcanvasExample .offcanvas-section {
    margin: 1rem 0.75rem 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

#offcanvasExample .offcanvas-signup {
    margin: 0.75rem 0.75rem 0;
}

/* Langues : petite grille de drapeaux. */
#offcanvasExample .offcanvas-langs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0 0.75rem;
}

#offcanvasExample .offcanvas-langs a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    min-width: 0;
}

#offcanvasExample .offcanvas-langs a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#offcanvasExample .offcanvas-langs a.active {
    background: #fff;
    color: var(--nds-purple);
    font-weight: 600;
}
