* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Jost;
}
nav {
  background-color: #003366;
  padding: 0;
}
.menu-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 10px;
}
.menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1.2rem;
}
.menu > li {
  position: relative;
}
.menu > li > a {
  display: flex;
  align-items: center;
  height: 100px;
  padding: 0 20px;
  color: white;
  text-decoration: none;
  margin: 5px 0;
}
.menu > li:hover {
  background-color: #0055aa;
}

/* Hover am Desktop: Mega-Menu anzeigen */
@media (min-width: 992px) {
  .menu > li:hover .mega-menu {
    display: flex;
  }
}

.mega-menu {
  position: absolute;
  left: 0;
  top: 100%;
  width: 800px;
  display: none;
  background-color: #e6f0ff;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 0 0 10px 10px;
  z-index: 1000;
  flex-wrap: nowrap;
}
.menu li.show-mega .mega-menu {
  display: flex;
}
.mega-menu .column {
  flex: 1;
  min-width: 200px;
  padding: 10px;
}
.mega-menu h3 {
  margin-top: 0;
  color: #003366;
}
.mega-menu a {
  display: block;
  color: #003366;
  text-decoration: none;
  padding: 5px 0;
}
.mega-menu a:hover {
  text-decoration: underline;
}
.mega-menu img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 10px 10px 0;
}
.home-button a {
  background-color: #0055aa;
  color: white;
  border-radius: 30px;
  padding: 10px 20px;
  margin: 10px;
  display: inline-block;
  text-decoration: none;
  transition: background-color 0.3s ease;
  font-size: 1.2rem;
}
.home-button a:hover {
  background-color: #0077cc;
}
.menu-toggle {
  display: none;
  background-color: #003366;
  color: white;
  padding: 15px 20px;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 20px;
}
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* Zwischenbreite korrigieren */
@media (min-width: 992px) and (max-width: 1200px) {
  .mega-menu {
    left: 50%;
    transform: translateX(-40%);
  }
}

/* Mobile: Klicksteuerung + Scroll + Show-Klasse */
@media (max-width: 991px) {
  .menu-container {
    flex-direction: column;
    align-items: flex-start;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: #e43f3f transparent;
  }
  .menu-container::-webkit-scrollbar {
    width: 8px;
  }
  .menu-container::-webkit-scrollbar-thumb {
    background-color: #e43f3f;
    border-radius: 4px;
  }
  .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-bottom: 50px;
  }
  .menu.show {
    display: flex;
  }
  .menu li.show-mega .mega-menu {
    position: static;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
  }
  .mega-menu {
    width: 100%;
    flex-direction: column;
    border-radius: 0;
  }
  .menu-toggle {
    display: block;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: list-item;
    margin-bottom: 0;
    padding: 0;
  }
  .mobile-only a {
    display: inline-block;
    margin: 15px 15px 10px 15px;
    background-color: #0055aa;
    color: white;
    border-radius: 30px;
    padding: 10px 20px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    width: 200px;
    text-align: center;
  }
  .mobile-only a:hover {
    background-color: #0077cc;
  }
  .menu > li > a {
    height: 50px;
  }
}
