/* MEGA MENU START */
/* Visual Builder override: keep mega sections visible while editing */
body.et-fb .mega-menu,
body.et-builder-editing .mega-menu {
  position: static !important;
  top: auto !important;
  left: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
  box-shadow: none !important; /* optional */
}

body.et-fb .mega-menu::before,
body.et-builder-editing .mega-menu::before {
  display: none !important;
}

:root{
  --mega-max-width: 1200px;
  --mega-gap-y: 10px;        /* vertical gap below button */
  --mega-margin-x: 16px;     /* left-right viewport margins */
  --mega-radius: 14px;
  --mega-shadow: 0 18px 48px rgba(0,0,0,.18);
  --mega-bg: #ffffff;
  --mega-z: 9999;
}

/* Floating container for every mega Section */
.mega-menu{
  position: fixed;             /* can live anywhere in DOM, including footer */
  top: -9999px;                /* start off-canvas */
  left: -9999px;
  width: min(var(--mega-max-width), calc(100vw - var(--mega-margin-x) * 2));
  background: var(--mega-bg);
  border-radius: var(--mega-radius);
  box-shadow: var(--mega-shadow);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: var(--mega-z);
  transition: opacity .12s ease, transform .12s ease;
  transform: translateY(-4px);
}

/* Open state */
.mega-menu.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Pointer triangle aligned to the hovered button center */
.mega-menu::before{
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--mega-bg);
  top: -7px;                   /* half of the size to sit on the edge */
  left: var(--arrow-left, 50%);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: -2px -2px 2px rgba(0,0,0,.06);
}

/* Optional: active state hint on the top button */
.mega-trigger.is-active > a,
.mega-trigger.is-active > button{
  color: #c5161d;              /* adjust to your brand if desired */
}

/* Prevent header overflow issues */
.et-l--header { overflow: visible; }

/* MEGA MENU END */
