.menu-toggle {
  background: #7D8CF0;
  border-radius: 30px;
  width: 75px;
  height: 47px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

.menu-toggle .line {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 2px 0;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* X animation when menu is open */
.menu-toggle.active .line-1 {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle.active .line-2 {
  transform: translateY(-3px) rotate(-45deg);
}

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: white;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  font-family: "Britti Sans";
}

.mobile-menu.open {
  transform: translateX(0);
}

.menu-header {
  margin-bottom: 1rem;
}

.mobile-menu .custom-logo-link img {
  height: 100px;
  width: fit-content;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu ul li {
  margin: 0;
  padding: 0;
}

/* Top level menu items */
.mobile-menu > ul > li > a {
  display: block;
  padding: 10px 40px 10px 0;
  line-height: 2rem;
  color: #000;
  text-decoration: none;
  font-size: 30px;
  position: relative;
  -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

/* Generic link styles - lower specificity */
.mobile-menu ul li a {
  display: block;
  color: #000;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

.menu-item-has-children > a.active {
  border-bottom: 1px solid #9a9a9a;
}

.sub-menu .menu-item-has-children > a.active {
  border-bottom: none;
}

/* For top‑level menu items with children */
.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 40%;
  right: 20px;
  width: 12px;
  height: 12px;
  background-image: url('/wp-content/uploads/downarrow.svg');
  background-size: contain;
  background-repeat: no-repeat;
  transform-origin: center top;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.menu-item-has-children > a.active::after {
  transform: rotateX(180deg);
}

/* Submenu - using opacity/visibility with height animation */
.sub-menu {
  height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  padding-left: 20px;
  transition: height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
}

.sub-menu.active {
  opacity: 1;
  visibility: visible;
  height: auto; /* This will be set dynamically in JS */
  transition: height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0s;
}

.sub-menu.active li {
  margin-left: 6px;
}

/* Higher specificity for submenu links */
.mobile-menu ul li.menu-item-has-children ul.sub-menu li a {
  padding: 8px 0;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu ul li.menu-item-has-children ul.sub-menu.active li a {
  opacity: 1;
  transition-delay: 0.1s;
}

/* Appointment button and footer */
.baa {
  margin: 20px 0;
  display: flex;
  font-size: 20px;
  align-items: center;
  justify-content: space-between;
}

.baa a {
  min-width: 240px;
  color: #000!important;
  -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

.baa li > a > span {
  font-size: 1.5rem;
  color: black;
  display: inline-block;
  word-break: break-all;
  height: 1em;
  width: 3ch;
  overflow: hidden;
  text-transform: uppercase;
}

.appointment-button {
  background: #DFD3F1;
  border-radius: 30px;
  padding: 15px 20px;
  text-align: center;
}

.menu-footer {
  margin-top: auto;
}

.footer-links a {
  display: block;
  padding: 10px 0;
  color: #000!important;
  text-decoration: none;
  font-size: 20px;
  -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}
