/* IT310RESPONSIVE_DEVICE_PASS2I
   Correção global de estabilidade dos backgrounds no mobile.
   Escopo: mobile backgrounds only. Preserva menu Ferramentas PASS2H, FixtureBridge, desktop, backend, motores, rotas, QR/donate e identidade. */

@media (max-width:960px){
  html.it-device-runtime-ready,
  html.it-dr-ready,
  html.it-dr-phone,
  html.it-dr-phone-small,
  html.it-dr-tablet{
    --it-mobile-bg-stable-w:var(--it-mobile-bg-lock-w,100vw);
    --it-mobile-bg-stable-h:var(--it-mobile-bg-lock-h,100lvh);
    overscroll-behavior-x:none!important;
  }

  body{
    overflow-x:hidden!important;
    background-color:#02040a!important;
    background-attachment:scroll!important;
  }

  /* Trava global: em mobile, nenhum background INFOTECH deve acompanhar o scroll,
     recalcular por dvh/svh durante gestos ou animar discretamente por trás da página. */
  body > .bg,
  body .bg,
  body > .space-bg,
  body .space-bg,
  body > .stars,
  body .stars,
  body > .home-lab-bg,
  body .home-lab-bg,
  body > .software-lab-bg,
  body .software-lab-bg,
  body > .ixdesk-bg-layer,
  body .ixdesk-bg-layer,
  body > .ixdesk-mountains,
  body .ixdesk-mountains,
  body > .infotech-particles,
  body .infotech-particles,
  body.it-tools-bg > .bg,
  body.it-tools-bg .bg,
  body.it-tools-bg > .space-bg,
  body.it-tools-bg .space-bg,
  body.infotech-public-page > .bg,
  body.infotech-public-page .bg,
  body.infotech-public-page > .stars,
  body.infotech-public-page .stars,
  body.infotech-public-page.home-lab-reference4 > .home-lab-bg,
  body.infotech-public-page.home-lab-reference4 .home-lab-bg,
  body.infotech-public-page.sistemas-home-standard1 > .home-lab-bg,
  body.infotech-public-page.sistemas-home-standard1 .home-lab-bg,
  body.ixdesk-software-page > .ixdesk-bg-layer,
  body.ixdesk-software-page .ixdesk-bg-layer,
  body.ixdesk-software-page > .ixdesk-mountains,
  body.ixdesk-software-page .ixdesk-mountains{
    position:fixed!important;
    left:0!important;
    top:0!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--it-mobile-bg-stable-w)!important;
    min-width:100vw!important;
    max-width:none!important;
    height:var(--it-mobile-bg-stable-h)!important;
    min-height:var(--it-mobile-bg-stable-h)!important;
    max-height:var(--it-mobile-bg-stable-h)!important;
    pointer-events:none!important;
    background-attachment:scroll!important;
    background-repeat:no-repeat!important;
    background-size:cover!important;
    background-position:center top!important;
    transform:none!important;
    translate:none!important;
    scale:1!important;
    rotate:0deg!important;
    will-change:auto!important;
    animation:none!important;
    transition:none!important;
    contain:paint!important;
    -webkit-backface-visibility:hidden!important;
    backface-visibility:hidden!important;
  }

  body.infotech-public-page.home-lab-reference4 .home-lab-bg,
  body.infotech-public-page.sistemas-home-standard1 .home-lab-bg{
    display:block!important;
    opacity:1!important;
    z-index:0!important;
    background-position:60% top!important;
  }

  body.infotech-public-page .bg,
  body.it-tools-bg .bg,
  body .space-bg{
    z-index:-3!important;
  }

  body.infotech-public-page .stars,
  body .stars,
  body .infotech-particles{
    z-index:-2!important;
    opacity:.42!important;
    background-attachment:scroll!important;
  }

  body .infotech-particles span,
  body .stars::before,
  body .stars::after,
  body .bg::before,
  body .bg::after,
  body .space-bg::before,
  body .space-bg::after,
  body .home-lab-bg::before,
  body .home-lab-bg::after,
  body .software-lab-bg::before,
  body .software-lab-bg::after,
  body .ixdesk-bg-layer::before,
  body .ixdesk-bg-layer::after,
  body .ixdesk-mountains::before,
  body .ixdesk-mountains::after{
    animation:none!important;
    transition:none!important;
    transform:none!important;
    will-change:auto!important;
    background-attachment:scroll!important;
  }

  /* Se alguma camada antiga usa imagem fixa diretamente no body/html, neutraliza o fixed no mobile. */
  html,
  body,
  body.infotech-public-page,
  body.it-tools-bg,
  body.ixdesk-software-page{
    background-attachment:scroll!important;
    background-position:center top!important;
    overscroll-behavior-x:none!important;
  }

  body.infotech-public-page header.it-top,
  body.infotech-public-page main,
  body.infotech-public-page footer,
  body.it-tools-bg main,
  body.it-tools-bg footer,
  body.ixdesk-software-page main,
  body.ixdesk-software-page footer{
    position:relative!important;
  }

  /* Mantém o estado do menu PASS2H: fundo visível e estável, sem reativar barra inferior. */
  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,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open main,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open footer{
    visibility:visible!important;
    opacity:1!important;
  }

  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;
  }
}

@media (max-width:960px) and (prefers-reduced-motion:reduce){
  body > .bg,
  body .bg,
  body > .space-bg,
  body .space-bg,
  body > .stars,
  body .stars,
  body > .home-lab-bg,
  body .home-lab-bg,
  body > .software-lab-bg,
  body .software-lab-bg,
  body > .ixdesk-bg-layer,
  body .ixdesk-bg-layer,
  body > .ixdesk-mountains,
  body .ixdesk-mountains,
  body > .infotech-particles,
  body .infotech-particles{
    animation:none!important;
    transition:none!important;
  }
}
