html.cms-menu-open,
body.cms-menu-open {
  overflow: hidden;
  height: 100%;
}

/* Safety: re-enable on desktop just in case */
@media (min-width: 981px) {
  html.cms-menu-open,
  body.cms-menu-open {
    overflow: auto;
    height: auto;
  }
}

.cms-main-menu .et_mobile_menu {
  display: none !important;
}

/* Base overlay container */
.cms-mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: #fabdbd; /* Replace with brand pink if needed */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s ease, opacity 0.35s ease;
  z-index: 99999;
}

/* Slide-in active */
.cms-mobile-menu-overlay.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Close button */
.cms-mobile-menu-close {
  position: absolute;
  top: 22px;
  right: 26px;
  font-size: 36px;
  color: #1b3b5b;
  cursor: pointer;
}

body.admin-bar .cms-mobile-menu-close {
  margin-top: 32px;
}

/* Menu list */
#cmsMobileMenuList {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  line-height: 55px;
}

#cmsMobileMenuList li {
  margin: 14px 0;
}

#cmsMobileMenuList a {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  color: #1b3b5b;
  text-decoration: none;
}

/* Fade links in after panel slides in */
.cms-mobile-menu-overlay.is-open #cmsMobileMenuList li {
  animation: cmsMenuFadeUp 0.5s ease forwards;
}

@keyframes cmsMenuFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Base menu item link – padding + setup for underline */
.cms-main-menu .et-menu > li > a {
  position: relative; /* needed for the ::after underline */
  display: inline-block; /* keeps underline tied to the text width */
  padding: 0 22px; /* LEFT/RIGHT PADDING FOR MENU ITEMS */
}

/* Remove any extra padding Divi puts on the <li> itself */
.cms-main-menu .et-menu > li {
  padding-left: 0;
  padding-right: 0;
}

/* Underline (hidden by default) */
.cms-main-menu .et-menu > li > a::after {
  content: '';
  position: absolute;
  left: 22px; /* matches link padding – keeps underline inset */
  right: 22px;
  height: 2px;
  background-color: #b7abf5; /* lavender blue – brand accent */
  bottom: -6px; /* CONTROLS THE GAP BETWEEN TEXT & UNDERLINE */
  opacity: 0;
  transform: scaleX(0.3);
  transform-origin: center;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Hover + active state – show underline */
.cms-main-menu .et-menu > li > a:hover::after,
.cms-main-menu .et-menu > li.current-menu-item > a::after,
.cms-main-menu .et-menu > li.current_page_item > a::after {
  opacity: 1;
  transform: scaleX(1);
}

.et-l--header {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* Desktop only – sticky header */
@media (min-width: 981px) {
  .et-l--header {
    position: sticky;
    top: 0;
    z-index: 9999;
  }

  /* If logged into WP admin, offset below admin bar */
  body.admin-bar .et-l--header {
    top: 32px;
  }
}

/* Mobile / tablet – normal scrolling header */
@media (max-width: 980px) {
  .et-l--header {
    position: static;
  }
}
