/*
 * GAINVO Storefront v0.10.51 — Scrolling Phase 1 hardening
 * One authoritative vertical scroll owner for normal Storefront pages.
 *
 * Contract:
 * - html/document owns ordinary top <-> bottom scrolling.
 * - body, .app-shell, .main and normal .screen surfaces never become
 *   competing vertical scroll containers.
 * - the root clips accidental horizontal page drift.
 * - deliberate overlay sheets and horizontal rails keep their own scroll rules.
 */

/* Root/document is the only ordinary page scroller. Keep this rule last in the
   cascade so older desktop/mobile layers cannot accidentally recreate nested
   vertical scrolling. */
html{
  width:100%!important;
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow-x:clip!important;
  overflow-y:auto!important;
  scroll-behavior:auto!important;
  overscroll-behavior-x:none!important;
  overscroll-behavior-y:auto!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}
html::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

/* body contributes document height but is not an independent scrollport. */
body{
  position:static!important;
  width:100%!important;
  height:auto!important;
  min-height:100vh!important;
  min-height:100svh!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior-y:auto!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}
body::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

/* Normal application wrappers must never become nested vertical scrollers.
   Do not use overflow-x:hidden here: when paired with overflow-y:visible some
   engines compute the other axis as auto, recreating a vertical scrollport.
   Horizontal clipping belongs to the root instead. */
.app-shell,
.main,
.screen,
.screen.active{
  height:auto!important;
  max-height:none!important;
  min-width:0!important;
  overflow:visible!important;
  overscroll-behavior-y:auto!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}

/* Keep app/page widths contained without introducing overflow scrollports. */
.app-shell,
.main,
.screen{
  max-width:100%!important;
}

/* Preserve intentional screen visibility semantics. */
.screen:not(.active){display:none}
.screen.active{display:block}

/* Long media/content may shrink to the viewport rather than forcing sideways
   page movement. Horizontal rails override this locally in v0.10.49. */
:where(img,video,canvas,svg,iframe){max-width:100%}
:where(.app-shell,.main,.screen) :where(p,h1,h2,h3,h4,h5,h6,small,strong,span,a,button){min-width:0}

/* Intentional document locks remain authoritative while true overlay surfaces
   are open. These exceptions prevent Phase 1 from breaking checkout, launch or
   sponsored-details modal behaviour. */
html.gainvo-checkout-open,
html.gainvo-checkout-open body,
html.gainvo-commerce-sheet-open,
html.gainvo-commerce-sheet-open body,
html.launch-active,
html.launch-active body,
html.gainvo-launching,
html.gainvo-launching body,
body.ad-details-open{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}

/* On browsers that do not support overflow:clip, clip only at the root. The
   root is already the intended vertical scroll owner, so hidden-x cannot create
   a competing nested page scroller. */
@supports not (overflow:clip){
  html{overflow-x:hidden!important}
}

/* PC/tablet should use the same native document scroll model as mobile. */
@media (min-width:760px){
  html{scroll-behavior:auto!important}
  body,.app-shell,.main,.screen,.screen.active{overflow-y:visible!important}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
}
