/* ============================================
   Nexxo Store — Mobile App Layout
   ============================================
   - Navegador mobile: tudo normal (só header)
   - App instalado (PWA standalone): bottom nav + sem header
   ============================================ */


/* =========================
   BOTTOM NAV — escondida por padrão
   Só aparece no modo standalone (app instalado)
========================= */

.app-bottom-nav{
    display: none !important;
}

/* Barra de busca flutuante (standalone) */
.app-search-overlay{
    display: none;
}


/* =========================
   MELHORIAS GERAIS MOBILE (browser + standalone)
========================= */

@media(max-width: 900px){

    a, button{
        -webkit-tap-highlight-color: transparent;
    }

    html{
        overscroll-behavior-y: contain;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .site-footer .footer-newsletter{
        padding: 24px 0;
    }

    .site-footer .footer-grid{
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .site-footer .footer-about{
        text-align: center;
    }

    .site-footer .footer-social{
        justify-content: center;
    }

    .site-footer .footer-seals-inner{
        gap: 12px;
    }

    .seal-item{
        font-size: 10px;
    }

    .seal-item svg{
        width: 18px;
        height: 18px;
    }
}


/* =========================================================
   STANDALONE MODE — APP INSTALADO
   Só ativa quando o usuário adicionou à tela inicial
========================================================= */

@media(display-mode: standalone) and (max-width: 900px){

    /* ── ESCONDER O HEADER ────────── */
    .header{
        display: none !important;
    }

    /* ── Sem padding-top do header ── */
    body{
        padding-top: env(safe-area-inset-top, 0px) !important;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ── MOSTRAR A BOTTOM NAV ────────── */
    .app-bottom-nav{
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9997;

        height: 64px;

        background: rgba(8, 12, 28, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);

        border-top: 1px solid rgba(0, 217, 255, 0.08);

        box-shadow:
            0 -4px 24px rgba(0, 0, 0, 0.4),
            0 -1px 0 rgba(0, 217, 255, 0.06);

        align-items: center;
        justify-content: space-around;

        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0px);

        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .app-bottom-nav.bnav-hidden{
        transform: translateY(100%);
    }


    /* ── Itens da bottom nav ────────── */

    .bnav-item{
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;

        flex: 1;
        height: 100%;

        color: rgba(255, 255, 255, 0.4);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        letter-spacing: 0.01em;

        border: none;
        background: none;
        cursor: pointer;

        position: relative;

        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .bnav-item svg{
        width: 22px;
        height: 22px;
        transition: transform 0.2s;
    }

    .bnav-item:active svg{
        transform: scale(0.88);
    }

    /* Ativo */
    .bnav-active{
        color: #00d9ff;
    }

    .bnav-active::before{
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 2px;
        background: #00d9ff;
        border-radius: 0 0 4px 4px;
        box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
    }

    /* Botão central (Buscar) */
    .bnav-center{
        color: rgba(255, 255, 255, 0.5);
    }

    .bnav-center-icon{
        width: 44px;
        height: 44px;
        border-radius: 50%;

        background: linear-gradient(135deg, #00d9ff 0%, #0090b8 100%);
        box-shadow:
            0 4px 16px rgba(0, 217, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);

        display: flex;
        align-items: center;
        justify-content: center;

        margin-top: -18px;

        transition: transform 0.2s, box-shadow 0.2s;
    }

    .bnav-center-icon svg{
        color: #000;
        width: 20px;
        height: 20px;
    }

    .bnav-center:active .bnav-center-icon{
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(0, 217, 255, 0.2);
    }

    .bnav-center span{
        margin-top: -2px;
        color: rgba(255, 255, 255, 0.4);
    }

    /* Badge do carrinho */
    .bnav-cart-wrap{
        position: relative;
        display: inline-flex;
    }

    .bnav-badge{
        position: absolute;
        top: -5px;
        right: -10px;
        background: #00d9ff;
        color: #000;
        font-size: 9px;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        font-family: 'Inter', sans-serif;
        pointer-events: none;
    }


    /* ── BARRA DE BUSCA FLUTUANTE ── */
    /* Substitui o header search no modo app */

    .app-search-overlay{
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        background: rgba(5, 8, 22, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: env(safe-area-inset-top, 12px) 16px 20px;
        animation: searchFadeIn 0.2s ease;
    }

    .app-search-overlay.active{
        display: block;
    }

    @keyframes searchFadeIn{
        from{ opacity: 0; }
        to{ opacity: 1; }
    }

    .app-search-top{
        display: flex;
        align-items: center;
        gap: 12px;
        padding-top: 12px;
    }

    .app-search-top form{
        flex: 1;
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(0, 217, 255, 0.15);
        border-radius: 14px;
        overflow: hidden;
        height: 46px;
    }

    .app-search-top form input{
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        padding: 0 16px;
        color: white;
        font-size: 15px;
        font-family: 'Inter', sans-serif;
        height: 100%;
    }

    .app-search-top form input::placeholder{
        color: rgba(255, 255, 255, 0.3);
    }

    .app-search-top form button[type="submit"]{
        width: 50px;
        height: 100%;
        border: none;
        background: #00d9ff;
        color: black;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-search-close{
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.5);
        font-size: 16px;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        cursor: pointer;
        padding: 8px;
        white-space: nowrap;
    }


    /* ── NAVBAR — esconder no standalone ── */
    .navbar{
        display: none !important;
    }

    /* ── FOOTER — enxuto no app ── */
    .footer-newsletter{
        display: none;
    }

    .site-footer .footer-col:not(.footer-about){
        display: none;
    }

    .site-footer .footer-main{
        padding: 20px 0;
    }

    .footer-bottom-inner{
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .footer-legal-links,
    .footer-cnpj{
        font-size: 10px;
    }

    /* ── COOKIE BANNER — acima da bottom nav ── */
    #cookieBanner{
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }
}


/* Standalone no desktop (raro mas possível) */
@media(display-mode: standalone) and (min-width: 901px){
    .app-bottom-nav{
        display: none !important;
    }
}


/* =========================
   INSTALL PROMPT BANNER
   Aparece no browser mobile (convida a instalar)
========================= */

.app-install-banner{
    display: none;
    position: fixed;
    bottom: 16px;
    left: 12px;
    right: 12px;
    z-index: 9996;

    background: linear-gradient(135deg, rgba(0, 217, 255, 0.12) 0%, rgba(120, 0, 255, 0.08) 100%);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 16px;
    padding: 14px 16px;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    animation: slideUpBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpBanner{
    from{ transform: translateY(20px); opacity: 0; }
    to{ transform: translateY(0); opacity: 1; }
}

.app-install-inner{
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-install-icon{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-install-icon img{
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.app-install-text{
    flex: 1;
    min-width: 0;
}

.app-install-text strong{
    display: block;
    font-size: 13px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 2px;
}

.app-install-text small{
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}

.app-install-btn{
    background: #00d9ff;
    color: #000;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: 0.2s;
}

.app-install-btn:active{
    transform: scale(0.95);
}

.app-install-close{
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
