/*
 * MyBase - cadre de l'application, version téléphone
 * Version : 1.0 - 06/10/2026
 *
 * Chargé par commun/head.php sous le seuil mobile de commun/config_affichage.php
 * (même condition que les présentations mobiles). Complète css/layout.css.
 *
 * Bandeau :  [☰] [logo] .................. [accès rapides]
 *            [ recherche ............ ][🔍][Filtres]
 * Menu    :  tiroir à gauche, ouvert par ☰ ou « Menu » (barre basse)
 * Bas     :  Accueil · Recherche · CRIT · Diag · Menu
 */

:root {
    --mb-topbar-h: 108px;
}

.mb-topbar-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 10px 10px;
}

.mb-burger {
    order: 1;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: var(--mb-radius);
    background: var(--mb-side-bg);
    cursor: pointer;
}

.mb-burger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: #fff;
}

.mb-brand {
    order: 2;
    width: auto;
}

.mb-brand img {
    width: 60px;
}

.mb-tools {
    order: 3;
    margin-left: auto;
    gap: 2px;
}

.mb-tool {
    width: 38px;
    padding: 2px 0;
}

.mb-tool img {
    width: 32px;
    height: 32px;
}

.mb-tool span {
    display: none;
}

.mb-search {
    order: 4;
    flex: 1 1 100%;
    gap: 0;
}

.mb-search-field input[type="search"] {
    height: 42px;
    font-size: 16px; /* évite le zoom automatique sur iPhone */
}

.mb-filters-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cfd6dc;
    border-radius: var(--mb-radius);
    background: #fff;
    color: var(--mb-text);
    font-size: 14px;
    cursor: pointer;
}

.mb-filters-toggle[aria-expanded="true"] {
    border-color: var(--mb-accent);
    color: var(--mb-accent);
}

.mb-filters {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--mb-line);
    border-radius: var(--mb-radius);
    background: #f8fafb;
}

.mb-filters.is-open {
    display: flex;
}

.mb-filters label {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
}

.mb-filters select {
    width: 100%;
    max-width: none;
    height: 40px;
    font-size: 15px;
}

.mb-filters-apply {
    display: block;
    height: 42px;
    border: 0;
    border-radius: var(--mb-radius);
    background: var(--mb-accent);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

/* Contenu pleine largeur, menu en tiroir */
.mb-shell,
.mb-shell--sans-menu {
    display: block;
    min-height: 0;
}

.mb-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1400;
    width: min(86vw, 320px);
    height: 100dvh;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 6px 0 24px rgba(0, 0, 0, .28);
}

.mb-sidebar.is-open {
    transform: translateX(0);
}

.mb-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.mb-sidebar-link {
    padding: 11px 12px;
    font-size: 15px;
}

.mb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: block;
    background: rgba(0, 0, 0, .42);
}

.mb-backdrop[hidden] {
    display: none;
}

body.mb-drawer-open {
    overflow: hidden;
}

.mb-main {
    padding: 12px 10px calc(20px + env(safe-area-inset-bottom));
}


@media (max-width: 480px) {
    .action-moment-content {
        gap: 85px;
        padding: 0 18px;
    }

    .action-moment-overlay.action-moment-show img {
        transform: scale(3.6) rotate(0deg);
        animation-name: actionMomentPulseMobile;
    }

    .action-moment-message {
        font-size: 18px;
    }

    @keyframes actionMomentPulseMobile {
        0% { transform: scale(3.6); }
        50% { transform: scale(3.95); }
        100% { transform: scale(3.6); }
    }
}
