/* MAXPDV V9.51 · Recuperação de rolagem mobile
   Evita que locks antigos de menu/modal congelem páginas normais no celular.
   O PDV imersivo fica fora deste arquivo porque possui rolagem própria. */
@media (max-width:1024px){
  html.mobile-scroll-root{
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body.mobile-scroll-unlocked:not(.immersive-pdv){
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-x:none!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y pinch-zoom!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body.mobile-scroll-unlocked:not(.immersive-pdv) :is(.app-shell,.commercial-app-shell,.main-wrap,.commercial-main-wrap){
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
  }

  body.mobile-scroll-unlocked:not(.immersive-pdv) :is(.main-wrap,.commercial-main-wrap,.content,.commercial-content){
    overflow-y:visible!important;
    touch-action:pan-y!important;
  }

  body.mobile-scroll-unlocked:not(.immersive-pdv) .commercial-content,
  body.mobile-scroll-unlocked:not(.immersive-pdv) .content{
    height:auto!important;
    max-height:none!important;
  }

  /* Login, cadastro e páginas públicas também devem crescer naturalmente. */
  body.mobile-scroll-unlocked.sales-site,
  body.mobile-scroll-unlocked.auth-page,
  body.mobile-scroll-unlocked.store-page,
  body.mobile-scroll-unlocked.renewal-page{
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow-y:auto!important;
    touch-action:pan-y pinch-zoom!important;
  }
  body.mobile-scroll-unlocked .max-auth-login-page{
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow:visible!important;
    touch-action:pan-y!important;
  }

  /* Mantém regiões horizontais roláveis sem capturar o gesto vertical da página. */
  body.mobile-scroll-unlocked :is(.table-wrap,.table-responsive,.quick-filters,.filter-chips,.plan-page-tabs,.cash-pro-nav){
    touch-action:pan-x pan-y!important;
  }

  /* Dialogs ativos rolam por dentro, sem estourar a viewport. */
  body:not(.immersive-pdv) dialog[open]{
    max-height:calc(100dvh - 16px)!important;
    overscroll-behavior:contain!important;
  }
  body:not(.immersive-pdv) dialog[open] :is(.dialog-card,.quick-dialog-card,.commercial-help-card,.admin-tech-shell-v79,.admin-danger-form-v75){
    max-height:calc(100dvh - 24px)!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
}
