/*
==============================================================================
MYNIAGA APP NAVIGATION A2
Role-based mobile navigation:
Customer / Seller / Admin
==============================================================================
*/

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

.app-brand-suffix{
    white-space:nowrap;
}

/*
------------------------------------------------------------------------------
Mobile app shell
------------------------------------------------------------------------------
*/
@media(max-width:850px){

    body.app-has-mobile-nav{
        padding-bottom:calc(76px + var(--app-safe-bottom)) !important;
    }

    .app-mobile-nav{
        --app-nav-cols:4;

        position:fixed;
        z-index:150;
        left:0;
        right:0;
        bottom:0;

        display:grid;
        grid-template-columns:repeat(var(--app-nav-cols), minmax(0,1fr));

        padding:
            7px
            max(8px, var(--app-safe-right))
            max(7px, var(--app-safe-bottom))
            max(8px, var(--app-safe-left));

        border-top:1px solid #dedbd5;
        background:rgba(255,255,255,.97);
        box-shadow:0 -10px 30px rgba(20,35,30,.09);

        backdrop-filter:blur(14px);
        -webkit-backdrop-filter:blur(14px);
    }

    .app-mobile-nav > a{
        position:relative;

        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:2px;

        min-width:0;
        min-height:55px;

        padding:4px 3px;

        border-radius:12px;

        color:#667069;
        text-decoration:none;

        font-size:10px;
        line-height:1.1;
        font-weight:750;

        touch-action:manipulation;
    }

    .app-mobile-nav > a.is-active{
        color:#0b6d5b;
        background:#edf7f2;
    }

    .app-nav-icon{
        position:relative;

        display:grid;
        place-items:center;

        width:26px;
        min-width:26px;
        height:26px;

        color:inherit;

        font-size:21px;
        line-height:1;
        font-weight:800;
    }

    .app-nav-cart-icon b{
        position:absolute;
        top:-5px;
        right:-8px;

        display:grid;
        place-items:center;

        min-width:17px;
        height:17px;
        padding:0 4px;

        border:2px solid #fff;
        border-radius:999px;

        background:#0b6d5b;
        color:#fff;

        font-size:9px;
        line-height:1;
    }

    .app-mobile-nav .app-nav-primary .app-nav-icon{
        border-radius:999px;
        background:#111713;
        color:#fff;
    }

    .app-mobile-nav-supplier .app-nav-primary.is-active .app-nav-icon{
        background:#0b6d5b;
    }

    /*
    --------------------------------------------------------------------------
    Separate mobile shell identity.
    Customer retains storefront search/cart in the header.
    Seller/Admin keep only workspace identity + language + menu.
    --------------------------------------------------------------------------
    */

    body.app-surface-supplier .global-search,
    body.app-surface-admin .global-search,
    body.app-surface-supplier .retail-cart,
    body.app-surface-admin .retail-cart{
        display:none !important;
    }

    body.app-surface-supplier .retail-header .nav,
    body.app-surface-admin .retail-header .nav{
        flex-wrap:nowrap !important;
        min-height:68px;
        padding-bottom:10px;
    }

    body.app-surface-supplier .mobile-menu,
    body.app-surface-admin .mobile-menu{
        order:4;
        margin-left:0;
    }

    body.app-surface-supplier .locale-picker,
    body.app-surface-admin .locale-picker{
        margin-left:auto !important;
    }

    body.app-surface-supplier .app-brand-suffix,
    body.app-surface-admin .app-brand-suffix{
        display:inline-flex;
        align-items:center;

        margin-left:5px;
        padding:3px 6px;

        border-radius:999px;

        background:#edf7f2;
        color:#0b6d5b;

        font-size:9px !important;
        letter-spacing:.08em;
    }

    /*
    --------------------------------------------------------------------------
    Supplier: bottom navigation replaces the duplicate horizontal workspace
    tab strip on phone. Desktop keeps the existing workspace tabs.
    --------------------------------------------------------------------------
    */

    body.app-surface-supplier #supplier-workspace-nav{
        display:none !important;
    }

    /*
    --------------------------------------------------------------------------
    Existing Product mobile cart bar must sit ABOVE customer bottom nav.
    --------------------------------------------------------------------------
    */

    body.app-has-mobile-nav.app-surface-customer.app-page-product
    .pcart-summary.has-items{
        bottom:calc(76px + var(--app-safe-bottom) + 10px) !important;
    }

    body.app-has-mobile-nav.app-surface-customer.app-page-product{
        padding-bottom:calc(158px + var(--app-safe-bottom)) !important;
    }

    /*
    --------------------------------------------------------------------------
    Fixed/sticky page controls should not disappear behind app nav.
    --------------------------------------------------------------------------
    */

    body.app-has-mobile-nav [id]{
        scroll-margin-bottom:90px;
    }
}

@media(max-width:390px){
    .app-mobile-nav{
        padding-left:max(4px, var(--app-safe-left));
        padding-right:max(4px, var(--app-safe-right));
    }

    .app-mobile-nav > a{
        min-height:53px;
        padding-inline:1px;
        font-size:9px;
    }

    .app-nav-icon{
        width:24px;
        min-width:24px;
        height:24px;
        font-size:19px;
    }

    body.app-surface-supplier .retail-brand,
    body.app-surface-admin .retail-brand{
        font-size:15px !important;
    }

    body.app-surface-supplier .app-brand-suffix,
    body.app-surface-admin .app-brand-suffix{
        font-size:8px !important;
        margin-left:3px;
        padding-inline:5px;
    }
}

@media(hover:hover){
    .app-mobile-nav > a:hover{
        color:#0b6d5b;
        background:#f3f8f5;
    }
}

/*
==============================================================================
APP A2.1 — ROLE SHELL POLISH
Visible issues found during real 390px / phone verification.
==============================================================================
*/
@media(max-width:850px){

    /*
    Customer already has Bag in the bottom app navigation.
    Remove the duplicate top Bag on phones so the first row becomes:
    MyPileh | Language | Menu.
    */
    body.app-surface-customer .retail-cart{
        display:none !important;
    }

    /*
    Supplier/Admin are operational app surfaces.
    The public marketplace Shop/Help footer is not useful inside these
    phone workspaces and makes the app feel like a website.
    Desktop footer remains unchanged.
    */
    body.app-surface-supplier .site-footer,
    body.app-surface-admin .site-footer{
        display:none !important;
    }

    /*
    Without the public footer, keep a clean breathing area above
    the fixed role navigation.
    */
    body.app-surface-supplier main,
    body.app-surface-admin main{
        padding-bottom:18px;
    }

    /*
    Make the phone header hierarchy cleaner.
    Search stays customer-only and occupies its own second row.
    */
    body.app-surface-customer .retail-header .nav{
        column-gap:10px;
        row-gap:10px;
    }

    body.app-surface-customer .global-search{
        margin-bottom:10px;
    }
}

@media(max-width:390px){
    body.app-surface-customer .retail-header .nav{
        column-gap:7px;
    }
}

