/* Barre de navigation mobile : cachee par defaut, affichee uniquement sur petit ecran. */
:root {
    --bottom-nav-h: 64px;
}

.bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, .94);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 -1px 0 #e1e7eb, 0 -6px 18px rgba(20, 42, 53, .08);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        height: var(--bottom-nav-h);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0 2px;
        background: none;
        border: 0;
        color: #6b7780;
        font-size: .68rem;
        font-weight: 500;
        letter-spacing: .1px;
        text-decoration: none;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
        transition: color .15s;
    }

    .bottom-nav-item:active {
        color: #2a5f75;
    }

    /* Pastille derriere l'icone */
    .bottom-nav-item i {
        font-size: 1.3rem;
        line-height: 1;
        width: 3.4rem;
        height: 1.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        transition: background-color .2s, color .2s;
    }

    .bottom-nav-item.active {
        color: #1f6f78;
        font-weight: 700;
    }

    .bottom-nav-item.active i {
        background: rgba(95, 158, 160, .24);
        color: #1a5d66;
    }

    .bottom-nav-item:active i {
        background: rgba(95, 158, 160, .14);
    }

    /* Masquee quand un modal / dialogue est ouvert, pour ne pas cacher ses boutons */
    body:has(.modal[style*="block"], .modal.display-block, .rz-dialog-wrapper, .rz-dialog-mask, .alert-modal-overlay, .modern-modal-overlay, .chat-pdf-overlay) .bottom-nav {
        display: none;
    }
}
