/* Loaded after the presentation styles: overlays share one stationary page. */
body[data-overlay-scroll-locked] .site-header {
  position: fixed !important;
  top: var(--overlay-viewport-top, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
}

[data-overlay-header-spacer] {
  display: block;
  flex: none;
  pointer-events: none;
}

/* These are separate catalogue scroll containers, independent of body. Hidden
   retains their scroll position and permits explicit route-driven resets. */
body[data-overlay-scroll-locked] :is(.catalog-main, .category-sidebar) {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body[data-overlay-scroll-locked] :is(.modal-panel, .quote-step, .machine-help-body, .quote-submission-overlay, .mobile-mode-dialog) {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body[data-overlay-scroll-locked] .mobile-mode-dialog {
  max-height: calc(var(--overlay-viewport-height, 100dvh) - 36px);
  overflow-y: auto;
}

@media (max-width: 880px) {
  body[data-overlay-scroll-locked].nav-menu-open .site-header .nav-links {
    max-height: max(0px, calc(var(--overlay-viewport-height, 100dvh) - var(--overlay-header-height, 76px) - 24px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nav-menu-open :is(.nav-links.open, .site-nav-backdrop) {
    animation: none !important;
    transition: none !important;
  }
}
