/**
 * EventButler Custom Mobile Menu
 * Ultra-light off-canvas menu with multi-level support
 * Size: ~3KB (minified)
 */

/* ==========================================================================
   Menu Container & Overlay
   ========================================================================== */

#menu {
  box-shadow: none !important;
  border: none !important;
  border-right: none !important;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: #355c7d;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
  box-shadow: none !important;
  border: none !important;
}

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

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-active {
  overflow: hidden;
}

/* ==========================================================================
   Close Button
   ========================================================================== */

.mobile-menu-close,
.mobile-menu .close-icon {
  position: fixed !important;
  top: 8px !important;
  right: 16px !important;
  width: 60px !important;
  height: 60px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  z-index: 10001 !important;
  display: none !important; /* Hidden by default */
  align-items: center;
  justify-content: center;
  color: #fff !important;
  font-size: 26px;
  padding: 0;
  text-decoration: none;
}

/* Show close button only when menu is open */
.mobile-menu.open .close-icon,
.mobile-menu.open .mobile-menu-close {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.mobile-menu-close i,
.mobile-menu .close-icon i {
  color: #fff !important;
  font-size: 26px !important;
  font-weight: 300 !important;
}

.mobile-menu-close:hover,
.mobile-menu .close-icon:hover {
  opacity: 0.7 !important;
}

/* ==========================================================================
   Menu Panels (Multi-level)
   ========================================================================== */

.mobile-menu-panels {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  background: #355c7d;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 80px 0 20px;
  box-shadow: none !important;
  border: none !important;
}

/* Level 0: Main panel */
.mobile-menu-panel[data-level="0"] {
  transform: translateX(0);
  position: relative;
}

/* Hide deeper levels by default */
.mobile-menu-panel[data-level="1"],
.mobile-menu-panel[data-level="2"],
.mobile-menu-panel[data-level="3"],
.mobile-menu-panel[data-level="4"] {
  transform: translateX(100%);
  position: absolute;
}

/* Active panel */
.mobile-menu-panel.active {
  transform: translateX(0);
}

/* Previous panel (slide out to left) */
.mobile-menu-panel.prev {
  transform: translateX(-30%);
  opacity: 0.5;
}

/* ==========================================================================
   Menu Lists
   ========================================================================== */

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

.mobile-menu li {
  border-bottom: none;
}

.mobile-menu a,
.mobile-menu span {
  display: block;
  padding: 18px 32px;
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  position: relative;
  transition: background-color 0.2s ease;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.mobile-menu a:hover,
.mobile-menu span:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu a.active {
  color: #fff;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Links in nested lists */
.mobile-menu ul ul a,
.mobile-menu ul ul span {
  padding-left: 56px;
  font-size: 22px;
  font-weight: 700;
}

/* ==========================================================================
   Back Button
   ========================================================================== */

.mobile-menu-back {
  display: flex;
  align-items: center;
  padding: 22px 32px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  font-weight: 700;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 24px;
}

.mobile-menu-back::before {
  content: "←";
  margin-right: 16px;
  font-size: 24px;
}

.mobile-menu-back:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Items with Submenus
   ========================================================================== */

.mobile-menu-has-sub > span {
  padding-right: 50px;
}

.mobile-menu-has-sub > span::after {
  content: "›";
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

/* ==========================================================================
   Icons
   ========================================================================== */

.mobile-menu i {
  margin-right: 20px;
  width: 28px;
  display: inline-block;
  text-align: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300 !important;
}

/* Icons dürfen nicht die fette Schrift vom Text erben */
.mobile-menu a i,
.mobile-menu span i {
  font-weight: 300 !important;
}

/* ==========================================================================
   Dividers
   ========================================================================== */

.mobile-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 28px 0;
  border: none;
  padding: 0;
  list-style: none;
}

.mobile-menu-divider:empty {
  display: block;
  height: 1px;
}

/* Nur Divider haben Trennlinien, nicht alle Items */
.mobile-menu li.mobile-menu-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  height: 0;
  margin: 28px 0;
  padding: 0;
}

/* ==========================================================================
   Small Text Items (Login, Language)
   ========================================================================== */

.mobile-menu .fs-sm a,
.mobile-menu .fs-sm span {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/* Full width on all mobile devices */

@media (max-width: 767px) {
  .mobile-menu i {
    font-weight: 300 !important;
  }

  .mobile-menu a,
  .mobile-menu span {
    padding: 18px 32px;
  }

  .mobile-menu-close,
  .mobile-menu .close-icon {
    top: 8px !important;
    right: 16px !important;
  }

  .mobile-menu-close i,
  .mobile-menu .close-icon i {
    font-size: 26px !important;
    font-weight: 300 !important;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.mobile-menu a:focus,
.mobile-menu span:focus,
.mobile-menu-back:focus,
.mobile-menu-close:focus,
.mobile-menu .close-icon:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu-overlay,
  .mobile-menu-panel {
    transition: none;
  }
}
