/**
 * Site-wide mobile chrome: logo header, FAB buttons, bottom nav.
 * Loaded on all public pages (max-width: 1023px).
 */
@media (min-width: 1024px) {
    .mob-only {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    /* ── Mobile site header (logo bar) ── */
    .mob-site-header {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        padding: calc(env(safe-area-inset-top, 0px) + 0.55rem) 1rem 0.75rem;
        background: linear-gradient(180deg, #163d85 0%, #1e56b8 40%, #2563eb 100%);
        flex-shrink: 0;
    }

    .mob-site-back,
    .mob-site-bell {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        text-decoration: none;
        border-radius: 50%;
        background: transparent;
        border: none;
        padding: 0;
    }

    .mob-site-back .ico,
    .mob-site-bell .ico {
        width: 1.15rem;
        height: 1.15rem;
    }

    .mob-site-header-side {
        width: 40px;
        height: 36px;
    }

    .mob-site-logo {
        justify-self: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.1rem;
        text-decoration: none;
    }

    .mob-site-logo-name {
        font-size: 0.9rem;
        font-weight: 700;
        color: #fff;
        line-height: 1.2;
        letter-spacing: -0.01em;
    }

    .mob-site-logo-sub {
        font-size: 0.52rem;
        letter-spacing: 0.14em;
        color: rgba(255, 255, 255, 0.75);
        text-transform: uppercase;
    }

    .mob-site-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        justify-self: end;
        background: transparent;
        border: none;
        padding: 0;
        width: 40px;
        height: 40px;
        cursor: pointer;
    }

    .mob-site-menu span {
        display: block;
        background: #fff;
        height: 2px;
        width: 22px;
        border-radius: 1px;
    }

    /* ── FAB buttons (right side) ── */
    .site-mob-fab {
        position: fixed;
        width: 50px;
        height: 50px;
        right: 1rem;
        left: auto;
        z-index: 9995;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
        text-decoration: none;
        color: #fff;
    }

    .site-mob-fab .ico {
        width: 1.4rem;
        height: 1.4rem;
        color: #fff;
        fill: currentColor;
    }

    .site-mob-fab.wa-float {
        background: #25d366;
        bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    .site-mob-fab.ph-float {
        background: #1d4ed8;
        bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    body.has-mob-bottom-nav .site-mob-fab.wa-float {
        bottom: calc(9.2rem + env(safe-area-inset-bottom, 0px));
    }

    body.has-mob-bottom-nav .site-mob-fab.ph-float {
        bottom: calc(5.65rem + env(safe-area-inset-bottom, 0px));
    }

    .site-mob-fab .wa-float-badge {
        position: absolute;
        top: -10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 0.65rem;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
        border: 2px solid #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        pointer-events: none;
    }

    /* ── Bottom navigation (homepage style — all mobile pages) ── */
    body.has-mob-bottom-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    .mob-bottom-nav,
    .mob-site-bottom-nav {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9990;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: #fff;
        border-top: 1px solid #e8ecf2;
        padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        gap: 0.25rem;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        touch-action: manipulation;
    }

    .mob-bottom-nav .mob-nav-item,
    .mob-site-bottom-nav .mob-nav-item {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.4rem 0.35rem;
        color: #1e3a6b;
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 600;
        min-height: 40px;
        border-radius: 8px;
        max-width: none;
        background: transparent;
    }

    .mob-bottom-nav .mob-nav-item .ico,
    .mob-site-bottom-nav .mob-nav-item .ico {
        width: 1.05rem;
        height: 1.05rem;
        flex-shrink: 0;
        color: currentColor;
    }

    .mob-bottom-nav .mob-nav-item span,
    .mob-site-bottom-nav .mob-nav-item span {
        line-height: 1;
        white-space: nowrap;
    }

    .mob-bottom-nav .mob-nav-item.active,
    .mob-site-bottom-nav .mob-nav-item.active {
        color: #2563eb;
        background: transparent;
        font-weight: 700;
    }

    .mob-bottom-nav .mob-nav-item.active .ico,
    .mob-site-bottom-nav .mob-nav-item.active .ico {
        color: #2563eb;
    }

    /* Hide legacy footer FABs on mobile — use site-mob-fab instead */
    .fab-float {
        display: none !important;
    }
}
