/**
 * CORE FUNCTIONALITY CSS
 * These styles are technically required for proper functionality.
 * Without these, the mega menu toggle and scroll behavior will not work correctly.
 */

/* Prevent browser scroll anchoring warnings during header animations */
body {
  overflow-anchor: none;
}

/* Lock body scroll when mega menu is open (prevents background scrolling) */
body:has(.wp-block-ollie-mega-menu__toggle[aria-expanded="true"]) {
  overflow: hidden;
}

/* Ensure toggle button is always clickable above mega menu dropdown */
.wp-block-ollie-mega-menu__toggle {
  position: relative !important;
  z-index: 10000 !important;
  pointer-events: auto !important;
}

/* Ensure mega menu dropdown sits below toggle button */
.wp-block-ollie-mega-menu__toggle + .wp-block-ollie-mega-menu__menu-container {
  z-index: 9999 !important;
}

/* Make child elements inside toggle transparent to clicks (desktop fix) */
.wp-block-ollie-mega-menu__toggle * {
  pointer-events: none !important;
}

/* Prevent mega menu from creating isolated stacking context */
.wp-block-ollie-mega-menu__menu-container {
  isolation: auto;
}

/* Force transparent background override when in transparent mode */
.has-transparent-header .is-transparent:has([aria-expanded="false"]) {
  background-color: transparent !important;
  box-shadow: none !important;
}