/* IT310RESPONSIVE_DEVICE_PASS2E
   Ajuste final da Etapa 2 para mobile das ferramentas.
   Escopo: remover a appbar inferior no celular e transformar o menu lateral em estado modal exclusivo.
   Preserva rotas, textos, motores, backend, QR, identidade, AVADOG e regras desktop aprovadas. */

@media (max-width:960px){
  /* Decisão UX: nas ferramentas, celular usa somente menu lateral. A barra inferior foi removida. */
  body.it-tools-bg.it-sidebar-enabled .it-mobile-appbar,
  body.it-tools-bg .it-mobile-appbar,
  body.it-sidebar-enabled .it-mobile-appbar{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    width:0!important;
    height:0!important;
    min-width:0!important;
    min-height:0!important;
    max-width:0!important;
    max-height:0!important;
    overflow:hidden!important;
    transform:translateY(120vh)!important;
  }

  /* Remove compensação herdada da appbar inferior. */
  body.it-tools-bg.it-sidebar-enabled main,
  body.it-tools-bg.it-sidebar-enabled footer{
    padding-bottom:revert!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open,
  body.it-tools-bg.it-mobile-drawer-active{
    overflow:hidden!important;
    touch-action:none!important;
    overscroll-behavior:none!important;
    background:#020817!important;
  }

  /* Menu aberto = estado modal exclusivo. Nenhuma camada flutuante deve competir. */
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .infotech-support-float,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .fixture-ava,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .fixturebuilder-ava,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .ava-dog,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .avadog,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .it-pwa-toast,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .pwa-install-prompt,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .install-prompt,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .app-install-popup{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  /* Esconde o conteúdo técnico atrás do drawer para impedir o vazamento visual ciano visto no celular. */
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open main,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open footer,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .bg,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .space-bg,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .infotech-particles{
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    user-select:none!important;
    -webkit-user-select:none!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open .it-sidebar-backdrop{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    z-index:10010!important;
    background:#01040d!important;
    opacity:1!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    pointer-events:auto!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded{
    position:fixed!important;
    left:0!important;
    top:0!important;
    right:auto!important;
    bottom:0!important;
    width:min(344px,92vw)!important;
    max-width:calc(100vw - 22px)!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:14px 12px calc(20px + env(safe-area-inset-bottom,0px))!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    border-radius:0 22px 22px 0!important;
    border-left:0!important;
    border-top:0!important;
    border-bottom:0!important;
    border-right:1px solid rgba(0,245,255,.34)!important;
    background:#020817!important;
    background-image:linear-gradient(180deg,#020817 0%,#041022 56%,#020817 100%)!important;
    box-shadow:28px 0 68px rgba(0,0,0,.72),inset -1px 0 0 rgba(255,255,255,.04)!important;
    z-index:10030!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    contain:layout paint style!important;
    box-sizing:border-box!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded *{
    box-sizing:border-box!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-brand,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-side-search,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-lang-toggle,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-search-empty-note{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-brand{
    flex:0 0 auto!important;
    width:calc(100% - 54px)!important;
    max-width:calc(100% - 54px)!important;
    padding:2px 0 10px!important;
    overflow:hidden!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-sidebar-toggle{
    position:absolute!important;
    top:12px!important;
    right:10px!important;
    width:42px!important;
    min-width:42px!important;
    height:40px!important;
    margin:0!important;
    padding:0!important;
    z-index:2!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:7px!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    flex:0 0 auto!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav a{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    flex:0 0 auto!important;
    padding:0 12px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    border-radius:13px!important;
    background:rgba(2,9,23,.82)!important;
    color:#f5fbff!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav a[hidden],
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav a.it-section-hidden:not(.it-search-override),
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-sidebar-label[hidden],
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-sidebar-section-toggle[hidden]{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    width:0!important;
    height:0!important;
    min-height:0!important;
    max-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    pointer-events:none!important;
  }
}

@media (max-width:390px){
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded{
    width:min(328px,92vw)!important;
    max-width:calc(100vw - 18px)!important;
    padding:12px 10px calc(18px + env(safe-area-inset-bottom,0px))!important;
  }

  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > header.it-global-header.it-sidebar-upgraded .it-global-nav a{
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    font-size:12px!important;
  }
}
