/* ============================= */
/* MOBILE NAV – BASE STRUCTURE   */
/* ============================= */

.mobile-nav {
  position: relative;
  z-index: var(--z-index-header);
  font-family: var(--font-family-base);
}

.mobile-only {
  display: block;
}

/* ============================= */
/* MOBILE HEADER / TOPBAR        */
/* ============================= */

.mobile-header {
  position: relative;
  background: var(--color-black);
  color: var(--color-text-inverse);
}

.mobile-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: var(--size-md);
  padding: 0 var(--space-md);
}

/* Burger */
.mobile-burger {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.mobile-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  transition: transform var(--transition-medium), opacity var(--transition-fast);
}

/* Burger Morph */
.mobile-nav.is-open .mobile-burger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-nav.is-open .mobile-burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-nav.is-open .mobile-burger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Logo */
.mobile-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 9999;
}

.mobile-logo img {
  height: 52px;
  width: auto;
  display: block;
}

/* ============================= */
/* OVERLAY PANEL                 */
/* ============================= */

.mobile-nav-panel {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-main);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-medium), transform var(--transition-medium);
  z-index: calc(var(--z-index-header) + 10);
}

.mobile-nav-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* Container – FULL WIDTH (wichtig für Submenu Layout) */
.mobile-nav-container {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  overflow: hidden;
}

/* ============================= */
/* QUICK ICON BAR                */
/* ============================= */

.mobile-iconbar {
  background: var(--color-white);
  border-bottom: var(--border-width-thin) solid var(--color-border-subtle);
  padding: var(--space-sm) var(--space-md);
}

.mobile-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--color-black);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

/* ============================= */
/* DRILLBAR + SUBTITLE           */
/* ============================= */

.mobile-drillbar {
  background: var(--color-black);
  padding: var(--space-sm) var(--space-md);
  min-height: 48px;
  align-items: center;
}

.mobile-subtitle {
  background: var(--color-accent);
  color: var(--color-black);
  font-size: var(--font-size-xl);
  padding: var(--space-sm) var(--space-md);
}

/* Standard: NUR im Submenu sichtbar */
.mobile-drillbar,
.mobile-subtitle {
  display: none;
  font-size: var(--font-size-3xl);
  font-weight: 700;
}

.mobile-nav-panel.has-submenu .mobile-drillbar,
.mobile-nav-panel.has-submenu .mobile-subtitle {
  display: block;
}

.mobile-back {
  background: transparent;
  border: none;
  color: var(--color-text-inverse);
  font-size: var(--font-size-md);
  cursor: pointer;
  font-family: var(--font-family-heading);
  font-weight: 600;
}

/* ============================= */
/* NAV LEVELS (SLIDE SYSTEM)     */
/* ============================= */

.mobile-nav-levels {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--color-black);
}

/* Root + Submenus (Slide Container) */
.mobile-root,
.mobile-nav .submenu,
.mobile-nav-level {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--color-black);
  list-style: none;
  margin: 0;
  transition: transform var(--transition-medium);
}

/* Root sichtbar */
.mobile-root {
  transform: translateX(0);
  z-index: 2;
}

/* Submenus starten rechts */
.mobile-nav .submenu,
.mobile-nav-level:not(.mobile-root) {
  transform: translateX(100%);
  z-index: 3;
}

/* Aktives Level */
.mobile-root.is-active,
.mobile-nav .submenu.is-active,
.mobile-nav-level.is-active {
  transform: translateX(0);
}

/* Hintergrund-Level */
.mobile-root.is-behind,
.mobile-nav .submenu.is-behind {
  transform: translateX(-30%);
  opacity: 0.4;
  pointer-events: none;
}

/* ============================= */
/* MENU ITEMS                    */
/* ============================= */

.mobile-nav-level li {
  border-bottom: 1px solid var(--color-overlay-12);
}

.mobile-nav-level a,
.mobile-nav-level button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--color-text-inverse);
  font-size: var(--font-size-lg);
  font-family: var(--font-family-heading);
  text-decoration: none;
  cursor: pointer;
}

.mobile-nav .nav-trigger {
  font-weight: 600;
}

.mobile-nav .nav-trigger::after {
  content: "›";
  color: var(--color-accent);
  font-size: var(--font-size-xl);
}

/* Active Submenu Item */
.mobile-nav .submenu a.is-active,
.mobile-nav .submenu a[aria-current="page"] {
  background: var(--color-accent);
  color: var(--color-black);
  border-radius: var(--radius-sm);
  padding-left: var(--space-sm);
}

/* ============================= */
/* BODY SCROLL LOCK              */
/* ============================= */

body.mobile-nav-open {
  overflow: hidden;
  touch-action: none;
}

/* ============================= */
/* RESPONSIVE                    */
/* ============================= */

@media (max-width: 899px) {
  .topmenu,
  .mainnav,
  .header-logo {
    display: none;
  }
}

@media (min-width: 900px) {
  .mobile-only {
    display: none;
  }
}
