/* ================================
   MOBILE HEADER (OPTION B)
   ================================ */

.mobile-header {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
  z-index: 9999;
}

/* Top bar */
.mobile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #222;
}

.mobile-logo img {
  height: 28px;
}

/* Hamburger button */
#mobileToggle {
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Mobile nav container */
#mobileNav {
  display: none;
  background: #ffffff;
  border-top: 1px solid #eee;
}

/* Links + accordion buttons */
#mobileNav a,
.m-acc {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: #222;
  border: none;
  background: #ffffff;
  text-align: left;
}

/* Section headers */
.m-acc {
  background: #f5f5f5;
  font-weight: 600;
  cursor: pointer;
}

/* Accordion panels */
.m-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.m-panel.open {
  max-height: 1200px; /* enough for all links */
}

.m-panel a {
  padding-left: 24px;
  border-top: 1px solid #eee;
}

/* ===== Mobile breakpoint ===== */
@media (max-width: 768px) {
  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: block;
  }
}

/* Smooth dropdown animation */
#mobileNav {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  max-height: 0;
  opacity: 0;
}

#mobileNav.open {
  display: block;
  max-height: 1000px;
  opacity: 1;
}

/* Accordion animation */
.m-panel {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* Tap feedback */
#mobileNav a:active,
.m-acc:active {
  background: #f0f0f0;
}

/* Improve tap targets */
#mobileNav a,
.m-acc {
  min-height: 48px;
}

/* ===== Touch-friendly mega menu for mobile ===== */
@media (max-width: 768px) {
  /* Prevent desktop mega menu from interfering */
  .dropdown.mega {
    display: none !important;
  }
  
  /* Ensure mobile accordion works properly */
  .m-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .m-panel.open {
    max-height: 1200px;
  }
}