/* ==========================================================================
   nav-responsive.css — Autoritative, mobile-first Navigation + Responsive-Netz
   --------------------------------------------------------------------------
   Wird ZULETZT geladen. Die Navigation/Drawer-Regeln sind über mehrere Dateien
   (styles.css, viz.css, mobile-premium.css) widersprüchlich verstreut. Statt
   diese zu entwirren, gewinnt diese Datei deterministisch:
     • Drawer über #mobile-menu (ID-Spezifität) + !important → schlägt jede Klasse
     • Burger/Links-Umschaltung via .navbar--enterprise (gleiche Spezifität wie viz.css,
       aber später geladen → gewinnt den Tie)
   Ziel: 100 % nutzbares Menü + kein horizontales Scrollen auf Mobile.
   ========================================================================== */

/* ── 1. Globales Overflow-Sicherheitsnetz (häufigste «nicht responsiv»-Ursache) ── */
html { overflow-x: clip; }
body { overflow-x: clip; max-width: 100%; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
/* Lange Wörter / URLs sprengen das Layout nicht mehr */
h1, h2, h3, h4, p, li, a, dd, dt, blockquote { overflow-wrap: break-word; }

/* ── 2. Navbar: ab ≤1000px Desktop-Links aus, Burger an ── */
@media (max-width: 1000px) {
  .navbar.navbar--enterprise .navbar__links { display: none !important; }
  .navbar.navbar--enterprise .navbar__burger { display: inline-flex !important; }
}
@media (min-width: 1001px) {
  .navbar.navbar--enterprise .navbar__burger { display: none !important; }
  .navbar.navbar--enterprise .navbar__links { display: flex !important; }
}
/* Burger: vollwertiges Touch-Target */
.navbar.navbar--enterprise .navbar__burger {
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}

/* ── 3. Mobile-Drawer — EINE klare Mechanik (ID + !important = unschlagbar) ── */
#mobile-menu {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1200 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100vh !important;     /* Fallback */
  height: 100dvh !important;    /* dynamische Viewport-Höhe (Mobile-Browserleisten) */
  transform: translateX(100%) !important;
  visibility: hidden !important;        /* off-canvas: kein Overflow, nicht fokussierbar */
  opacity: 1 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.34s !important;
  padding:
    max(18px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left)) !important;
}
#mobile-menu.open {
  transform: translateX(0) !important;
  visibility: visible !important;
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s !important;
}

/* Drawer-Innenstruktur sauber stapeln */
#mobile-menu .mobile-menu__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-shrink: 0;
}
#mobile-menu .mobile-menu__nav {
  display: flex; flex-direction: column;
  margin-top: 14px;
}
#mobile-menu .mobile-menu__foot {
  margin-top: auto; padding-top: 20px; flex-shrink: 0;
}

/* Tap-Targets im Drawer */
#mobile-menu a { min-height: 44px; display: flex; align-items: center; }
#mobile-menu .mobile-menu__group-label { min-height: 0; display: block; }
#mobile-menu .mobile-menu__close {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; flex-shrink: 0;
}
#mobile-menu .mobile-menu__cta {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; width: 100%; text-align: center;
}

/* ── 4. Reduced-Motion: sofort statt Slide ── */
@media (prefers-reduced-motion: reduce) {
  #mobile-menu { transition: none !important; }
  #mobile-menu.open { transition: none !important; }
}
