/* =========================================================
   NAV INFERIOR MOBILE
   Injetada por mobile-nav.js. O rodape usa site-footer.css.
   ========================================================= */

/* Por padrao escondida (desktop). Mostrada apenas no mobile. */
.mnav,
.mnav-sheet-backdrop,
.mnav-sheet {
    display: none;
}

@media (max-width: 740px) {
    /* Espaco no fim da pagina pra conteudo nao ficar atras da barra */
    body.has-mnav {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }

    .mnav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        height: calc(58px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(8, 11, 18, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    }

    .mnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        color: #7a8298;
        text-decoration: none;
        padding: 8px 2px;
        min-height: 44px;
        transition: color 0.18s;
        -webkit-tap-highlight-color: transparent;
    }
    .mnav-item i { font-size: 1.15rem; line-height: 1; }
    .mnav-item span { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.01em; }
    .mnav-item.active { color: #c8a84b; }
    .mnav-item:active { color: #e8c96a; }
    .mnav-item:focus-visible,
    .mnav-sheet-close:focus-visible,
    .mnav-sheet-link:focus-visible {
        outline: 2px solid #e8c96a;
        outline-offset: -3px;
    }

    /* Toasts e botoes flutuantes (FAB) fixos no rodape sobem pra nao ficar
       atras da barra inferior */
    body.has-mnav .toast,
    body.has-mnav .toast-notification,
    body.has-mnav .fab,
    body.has-mnav .pred-fab,
    body.has-mnav .rank-fab,
    body.has-mnav [class$="-fab"] {
        bottom: calc(58px + 16px + env(safe-area-inset-bottom, 0px));
    }

    /* ===== Bottom sheet do "Mais" ===== */
    .mnav-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 950;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.22s;
    }
    .mnav-sheet-backdrop.open { opacity: 1; visibility: visible; }

    .mnav-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 951;
        max-height: 80vh;
        overflow-y: auto;
        background: #11141d;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
        box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.5);
    }
    .mnav-sheet-backdrop.open .mnav-sheet { transform: translateY(0); }

    .mnav-sheet-grip {
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.18);
        margin: 8px auto 14px;
    }

    .mnav-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 2px 6px 8px;
    }
    .mnav-sheet-header h2 {
        margin: 0;
        color: #e8eaf0;
        font-size: 1rem;
        font-weight: 700;
    }
    .mnav-sheet-close {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(255,255,255,.22);
        border-radius: 50%;
        color: #e8eaf0;
        background: transparent;
        cursor: pointer;
    }

    .mnav-sheet-section {
        padding: 12px 6px 6px;
        font-size: 0.68rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: #7a8298;
        font-weight: 700;
    }

    .mnav-sheet-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .mnav-sheet-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 7px;
        padding: 14px 4px;
        border-radius: 14px;
        color: #cdd3e2;
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.15;
        min-width: 0;
        word-break: break-word;
        transition: background 0.15s;
    }
    .mnav-sheet-link i { font-size: 1.25rem; color: #c8a84b; }
    .mnav-sheet-link.active { background: rgba(200,168,75,.14); color: #fff; }
    .mnav-sheet-link:active { background: rgba(255, 255, 255, 0.06); }
}

@media (max-width: 740px) {
    body.light-theme .mnav,
    html.light-theme-early body .mnav {
        background: rgba(255, 255, 255, 0.94);
        border-top-color: rgba(0, 0, 0, 0.08);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    }
    :is(html.light-theme-early, body.light-theme) .mnav-item { color: #526070; }
    :is(html.light-theme-early, body.light-theme) .mnav-item.active { color: #7c5a1e; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet { background: #fff; color: #202636; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-header h2,
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-close { color: #202636; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-close { border-color: rgba(0,0,0,.3); }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-section { color: #536078; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-link { color: #4a5060; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-link.active { color: #202636; background: #efe4c9; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-link i { color: #7c5a1e; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-link:active,
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-close:hover { background: #ece9e2; }
    :is(html.light-theme-early, body.light-theme) .mnav-sheet-grip { background: rgba(0, 0, 0, 0.18); }
}

@media (prefers-reduced-motion: reduce) {
    .mnav-sheet-backdrop,
    .mnav-sheet { transition: none; }
}
