/* Mobile Menu Styles */
.mobile-menu-container {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100%;

  color:white;
  overflow: hidden;
  transition: right 0.3s ease;
  z-index: 9999;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.mobile-menu-container.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
}

.mobile-menu-overlay.active {
  display: block;
}

/* CRITICAL: Header should always be visible and positioned */
.mobile-menu-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
color:white;
background-color: var(--wp--preset--color--blue-darker);
  z-index: 10001; /* Higher than menu content */
  min-height: 60px;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.mobile-menu-back {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
}

.mobile-menu-back svg {
  margin-right: 5px;
  width: 16px;
  height: 16px;
  fill: #fff;
  color: #fff;
}

.mobile-menu-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
}

.mobile-menu-close svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  color: #fff;
}

/* Menu content area */
.mobile-menu-content-area {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.mobile-menu,
.mobile-submenu {
  position: absolute;
  top: 65px;
  left: 0;
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-top: 0; /* Remove any top padding that might push content down */
  overflow-y: auto;
  transition: transform 0.3s ease;
  background-color: var(--wp--preset--color--blue-dark) ;
  transform: translateX(0);
  padding-inline-start: 0px;
}

.mobile-submenu {
  transform: translateX(100%);
}

.mobile-submenu.active {
  transform: translateX(0);
}

.mobile-menu.has-submenu-active {
  transform: translateX(-100%);
}

/* CRITICAL: When submenu has children active, it should slide left but remain accessible */
.mobile-submenu.has-submenu-active {
  transform: translateX(-100%);
}

.mobile-menu li,
.mobile-submenu li {
  border-bottom: 1px solid #eee;
  list-style: none;
  position: relative;
}

.mobile-menu ::marker,
.mobile-submenu ::marker {
  display: none;
}

.mobile-menu a,
.mobile-submenu a {
  display: block;
  padding: 15px;
  text-decoration: none;
  color: #fff;
  font-size: 16px;
}

.mobile-menu a:hover,
.mobile-menu a:focus,
.mobile-submenu a:hover,
.mobile-submenu a:focus {
 /*ackground-color: #f5f5f5;*/
}

.mobile-menu .menu-item-has-children,
.mobile-submenu .menu-item-has-children {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submenu-toggle {
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.submenu-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
  fill: #eee;
  color: #eee;
}

.hamburger-icon {
  display: block;
  width: 30px;
  height: 20px;
  position: relative;
}

/* All lines */
.hamburger-icon span,
.hamburger-icon::before,
.hamburger-icon::after {
  background-color: #fff;
  content: '';
  display: block;
  height: 3px;
  border-radius: 3px;
  position: absolute;
  width: 100%;
  transition: all 0.2s ease-in-out;
}

/* Top line */
.hamburger-icon::before {
  top: 0;
}

/* Middle line */
.hamburger-icon span {
  top: 50%;
  transform: translateY(-50%);
}

/* Bottom line */
.hamburger-icon::after {
  bottom: 0;
}

.mobile-menu-toggle {
  background-color: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon:before {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon:after {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon span {
  opacity: 0;
}

.button {
  padding: 10px;
}

.button a {
  background-color: var(--wp--preset--color--pms-872);
  border: 2px solid var(--wp--preset--color--pms-872);
  color: var(--wp--preset--color--white);
  display: block;
  border-radius: 6px;
}

/* For screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 992px) {
  .mobile-menu-container,
  .mobile-menu-overlay,
  .mobile-menu-toggle {
      display: none;
  }
}