/* --- BARRA INFERIOR TIPO APP (compartida por todas las paginas) ---
   Se carga DESPUES del CSS de cada pagina: define los tokens y las reglas
   de la barra, asi el mapa (/mapa) tambien la tiene sin duplicar CSS. */
:root {
    --mbn-h: 0px;
    --mbn-overflow: 0px;
    --mbn-clear: calc(var(--mbn-h) + env(safe-area-inset-bottom));
    --banner-h: 56px;
}

body {
    /* Espacio reservado para la barra inferior (0 en desktop) */
    padding-bottom: var(--mbn-clear, 0px);
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --mbn-h: 64px;
        --mbn-overflow: 26px;
        --banner-h: 96px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        gap: 0.1rem;
        height: calc(var(--mbn-h) + env(safe-area-inset-bottom));
        padding: 0 0.3rem env(safe-area-inset-bottom);
        /* Sin backdrop-filter: en movil el blur se recompone en cada frame
           de scroll. Fondo solido + hairline = superficie de app. */
        background: rgba(2, 2, 2, 0.94);
        border-top: 1px solid rgba(255, 255, 255, 0.09);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
    }

    .mobile-bottom-nav a {
        flex: 1 1 0;
        min-width: 44px;
        min-height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.4rem 0.15rem;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.6875rem;
        font-weight: 700;
        line-height: 1.1;
        letter-spacing: 0.02em;
        text-align: center;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav a svg {
        width: 21px;
        height: 21px;
        stroke-width: 1.8;
    }

    .mobile-bottom-nav a.is-active {
        color: #fff;
    }

    .mobile-bottom-nav a.is-active svg {
        color: var(--primary);
    }

    /* Item central elevado (FAB) */
    .mobile-bottom-nav a.is-center {
        flex: 0 0 72px;
        position: relative;
        height: 100%;
        color: #fff;
    }

    .mobile-bottom-nav a.is-center .mbn-icon {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--primary);
        border: 4px solid var(--bg-dark);
        box-shadow: 0 8px 24px var(--primary-glow);
    }

    .mobile-bottom-nav a.is-center .mbn-icon svg {
        width: 24px;
        height: 24px;
        color: #fff;
        stroke-width: 2;
    }

    .mobile-bottom-nav a.is-center > span:last-child {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 5px;
        font-size: 0.6875rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .mobile-bottom-nav a:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 3px;
        border-radius: 6px;
    }
}
