/* ========================================
   Navigation - Modern & Responsive
   ======================================== */

/* Base Navigation Styles */
.main-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;

  background: var(--gi-table-head);
  box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.3);
  max-width: 950px;
  margin: 0 auto;
}

.nav-wrapper {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative; /* Für Mega-Menu Positionierung */
}

.nav-item {
  position: relative;
}

/* Nur Mega-Menu Items statisch machen */
.nav-item.has-mega {
  position: static;
}

.nav-link {
  display: block;
  padding: 15px 12px;
  color: var(--gi-body-font-color);
  text-decoration: none;
  font-size: 13px;
  font-family: "Sinkin Sans 400 Regular", Arial, sans-serif;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #59a4de;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: linear-gradient(to bottom, #2c3138 0%, #2e3136 50%, #33363a 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.2);
  list-style: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 12px 20px;
  color: var(--gi-body-font-color);
  text-decoration: none;
  font-size: 17px;
  border-bottom: var(--gi-shadow-border);
  transition: all 0.3s ease;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.dropdown-menu li a:hover {
  color: #59a4de;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  background: rgba(89, 164, 222, 0.1);
}

.dropdown-menu i {
  margin-right: 8px;
  width: 20px;
  display: inline-block;
}

/* Mega Menu */
.mega-menu {
  position: absolute;
  top: 100%;
  left: -10px; /* 10px nach links erweitert */
  width: 950px; /* 930px + 20px (10px links + 10px rechts) */
  background: linear-gradient(to bottom, #2c3138 0%, #2e3136 50%, #33363a 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

/* Alle Mega-Menus an der gleichen Position ausrichten */
.nav-item.has-mega {
  position: static; /* Damit sich Mega-Menu an nav-links orientiert */
}

.nav-item.has-mega .mega-menu {
  left: -20px; /* Linksbündig mit nav-links */
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-content {
  display: flex;
  gap: 20px;
  padding: 25px 30px; /* 30px statt 20px für mehr Raum */
}

.mega-image {
  flex-shrink: 0;
}

.mega-column {
  flex: 1;
  min-width: 0;
}

.mega-header {
  color: var(--gi-body-font-color);
  font-size: 14px;
  font-weight: bold;
  font-family: "Sinkin Sans 400 Regular", Arial, sans-serif;
  margin: 0 0 10px 0;
  padding-left: 10px;
}

.mega-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-links li a {
  display: block;
  padding: 10px 20px;
  color: var(--gi-body-font-color);
  text-decoration: none;
  font-size: 17px;
  border-bottom: var(--gi-shadow-border);
  transition: all 0.3s ease;
  line-height: 1.4; /* Bessere Zeilenhöhe */
}

.mega-links li:last-child a {
  border-bottom: none;
}

.mega-links li a:hover {
  color: #59a4de;
}

.mega-links i {
  margin-right: 8px;
  width: 20px;
  display: inline-block;
}

/* Mobile Toggle Button */
.mobile-toggle,
.mobile-close {
  display: none;
}


/* ========================================
   Mobile Responsive Styles
   ======================================== */

@media screen and (max-width: 970px) {
  
  /* Show mobile toggle button */
  .mobile-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
  }

  .mobile-toggle svg {
    display: block;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
  }

  /* Mobile Navigation Overlay */
  .nav-links {
    position: fixed;
    top: 65px; /* Unter dem Header */
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 290px;
    background: var(--gi-menu-dropdown, #1a1a1a);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 60px 0 20px; /* Padding für Close-Button */
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;

  }

  .nav-links.active {
    transform: translateX(0);
  }

  /* Custom Scrollbar */
  .nav-links::-webkit-scrollbar {
    width: 8px;
  }

  .nav-links::-webkit-scrollbar-track {
    background: #242526;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: #3A3B3C;
    border-radius: 4px;
  }

  /* Mobile Close Button */
  .mobile-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
  }

  .close-btn svg {
    display: block;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
  }

  /* Mobile Nav Items */
  .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link {
    padding: 15px 20px;
    font-size: 18px;
  }

  .nav-link:hover {
    background: #007AB8;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  /* Mobile Dropdown */
  .dropdown-menu {
    position: static;
    background: none;
    box-shadow: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-item.active .dropdown-menu,
  .nav-item.active .mega-menu {
    max-height: 1000px;
  }

  .dropdown-menu li a {
    padding-left: 40px;
    font-size: 16px;
  }

  /* Mobile Mega Menu */
  .mega-menu {
    position: static;
    width: 100%;
    background: none;
    box-shadow: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .mega-content {
    flex-direction: column;
    padding: 0;
  }

  .mega-image {
    display: none;
  }

  .mega-column {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px 0;
  }

  .mega-column:first-of-type {
    border-top: none;
  }

  .mega-header {
    font-size: 16px;
    padding-left: 20px;
  }

  .mega-links li a {
    padding-left: 40px;
    font-size: 15px;
  }

  /* Hide desktop hover effects on mobile */
  .nav-item:hover .dropdown-menu,
  .nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* Main nav adjustments */
  .main-nav {
    max-width: 100%;
    top: 65px !important; /* 70px vom oberen Rand */

  }

  .nav-wrapper {
    padding: 0 15px;
  }
}

/* Backdrop for mobile menu */
.nav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);

}

.nav-backdrop.active {
  display: block;
}

/* Auf Mobile: Backdrop startet bei 70px */
@media screen and (max-width: 970px) {
  .nav-backdrop {
    top: 70px; /* Unter dem Header */
  }
}

@media screen and (min-width: 971px) {
  .nav-backdrop {
    display: none !important;
  }
}