/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  min-height: 50px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.menu,
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu {
  display: flex;
}

.menu > li {
  position: relative;
}

.menu > li > a {
  display: block;
  padding: 10px 15px;
  font-size: 13px;
  color: #333;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.menu > li > a:hover {
  background: #f8f9fa;
  color: var(--red);
  font-weight: bold;
}

.brand img {
  height: 32px;
  display: inline-block;
}

/* Untermenüs */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  min-width: 220px;
  padding: 0;
  background: white;
  border: 1px solid #ddd;
  z-index: 1000;
}

.submenu li {
  position: relative;
}

.submenu a {
  display: block;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
}

.submenu a:hover {
  background: #f5f5f5;
}

/* Ebene 2 anzeigen */
.menu li:hover > .submenu,
.submenu li:hover > .submenu {
  display: block;
}

/* Ebene 3 rechts daneben */
.submenu .submenu {
  top: 0;
  left: 100%;
  right: auto;
}

/* Suche Styling */
.menu-search {
  display: flex;
  align-items: center;
  padding-left: 15px;
}

.search-btn {
  background: none;
  border: none;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

.search-btn:hover {
  color: var(--red);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: none; /* Versteckt per Default */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.search-overlay.is-open {
  display: flex;
}

.search-container {
  background: white;
  width: 90%;
  max-width: 800px;
  padding: 40px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.search-container h3 {
  margin-bottom: 20px;
  color: #18212a;
  font-family: Arial, sans-serif;
}

.search-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 35px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
}

.search-close:hover {
  color: var(--red);
}

/* Override Google CSE Styles slightly */
.gsc-control-cse {
  padding: 0 !important;
  border: none !important;
}

/* Hamburger & Mobile Logic */
.menu-checkbox {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: #333;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    z-index: 1000;
    border-top: 1px solid #eee;
    max-height: calc(100vh - 50px); /* Damit das Menü nicht über den Screen ragt */
    overflow-y: auto; /* Ermöglicht das Scrollen im Menü */
    -webkit-overflow-scrolling: touch;
  }

  .menu {
    flex-direction: column;
  }

  .menu-search {
    padding: 15px 25px;
    border-top: 1px solid #eee;
  }

  .menu-search input {
    width: 100%;
  }

  #menu-toggle:checked ~ .top-nav {
    display: flex;
  }

  .submenu, .submenu .submenu {
    display: block; /* Auf Mobilgeräten immer anzeigen, wenn Nav offen */
    position: static;
    width: 100%;
    border: none;
    background: #f9f9f9;
    padding-left: 15px; /* Dezent eingerückt für bessere Übersicht auf Mobile */
  }

  #menu-toggle:checked ~ .hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  #menu-toggle:checked ~ .hamburger span:nth-child(2) {
    opacity: 0;
  }

  #menu-toggle:checked ~ .hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}