/* ============================================================
   PRÓXIMAINVEST v1.0 — Correção de rolagem da página
   Corrige: página só rolava pela barra lateral; roda do mouse
   e gesto touch não moviam o conteúdo.
   Causa típica: overflow-x:hidden no html/body + height:100%
   ============================================================ */

/* Base: permitir scroll vertical com roda do mouse e touch */
html {
  overflow-x: clip !important;
  overflow-y: scroll !important;
  height: auto !important;
  min-height: 100% !important;
  overscroll-behavior-y: auto !important;
}

body {
  overflow-x: clip !important;
  overflow-y: visible !important;
  height: auto !important;
  min-height: 100% !important;
  max-width: 100% !important;
  position: static !important;
  touch-action: pan-y pinch-zoom !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: auto !important;
}

/* Estado normal (sem modal): forçar página rolável */
html:not(.cal-modal-open):not(.modal-open),
body:not(.cal-modal-open):not(.modal-open):not(.plano-open):not(.mais-open) {
  overflow-y: scroll !important;
  overflow-x: clip !important;
  height: auto !important;
  max-height: none !important;
  position: static !important;
  touch-action: manipulation !important;
  overscroll-behavior-y: auto !important;
}

/* Garantir que o conteúdo principal recebe a roda do mouse */
body:not(.cal-modal-open):not(.modal-open) main,
body:not(.cal-modal-open):not(.modal-open) #app,
body:not(.cal-modal-open):not(.modal-open) .page,
body:not(.cal-modal-open):not(.modal-open) {
  touch-action: pan-y pinch-zoom !important;
  pointer-events: auto !important;
}

/* Imagens não estouram layout */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Mobile / tablet */
@media screen and (max-width: 1024px) {
  html:not(.cal-modal-open):not(.modal-open),
  body:not(.cal-modal-open):not(.modal-open):not(.plano-open):not(.mais-open) {
    overflow-y: scroll !important;
    overflow-x: clip !important;
    height: auto !important;
    position: static !important;
    touch-action: manipulation !important;
  }

  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
}

/* Quando um overlay está aberto: trava só o fundo (esperado) */
html.cal-modal-open,
body.cal-modal-open,
html.modal-open,
body.modal-open,
body.plano-open,
body.mais-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
