/**
 * nav-mobile.css
 * Menu mobile plein écran + fondations mobile-first, partagés par les pages
 * publiques "Tailwind" qui n'incluent pas includes/header.php (prestataires.php,
 * B&F-eco/index.php, villes.php, aide.php, confidentialite.php, cgv.php).
 * Le même résultat visuel que index.php, sans dupliquer le CSS dans chaque page.
 */

html, body { max-width: 100%; overflow-x: hidden; }
body.menu-mobile-ouvert { overflow: hidden; }

/* Formulaires : 16px minimum pour éviter le zoom automatique d'iOS Safari */
@media (max-width: 639px) {
    input, select, textarea { font-size: 16px !important; }
}

/* Tableaux larges éventuels : défilement horizontal interne */
@media (max-width: 700px) {
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    th, td { white-space: nowrap; }
}

#bouton-menu-mobile {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; padding: 0;
    color: #1E1B4B; flex-shrink: 0;
}
#bouton-menu-mobile svg { width: 26px; height: 26px; }

.fermer-menu-mobile {
    display: none;
    position: absolute; top: 14px; right: 18px;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: #F1F5F9; border: none; border-radius: 9999px; cursor: pointer;
    font-size: 1.6rem; line-height: 1; color: #334155;
}

@media (max-width: 767px) {
    #bouton-menu-mobile { display: inline-flex; }
    #nav-principale {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: #fff;
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        padding: 24px;
        padding-top: calc(76px + env(safe-area-inset-top));
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        overflow-y: auto;
    }
    #nav-principale.ouvert { display: flex; }
    #nav-principale .fermer-menu-mobile { display: flex; }
    #nav-principale > a,
    #nav-principale > * > a {
        font-size: 1.05rem !important;
        padding: 13px 4px !important;
        border-bottom: 1px solid #E2E8F0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
