/* ===== Cargoe Dispo: Navbar Refresh for Bootstrap 3 (FIXED) ===== */

.navbar-custom {
  background: #0f172a; /* slate-900 vibe */
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.navbar-custom .navbar-brand,
.navbar-custom .navbar-nav > li > a {
  color: #ffffff; /* EINSTELLUNG 1: Setzt die Standardfarbe auf Reinweiß für beste Lesbarkeit */
}

/* EINSTELLUNG 2: Hover-Effekt (Hintergrund) entfernt und Textfarbe fixiert (HAUPT-LINKS) */
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-nav > li > a:hover,
.navbar-custom .navbar-nav > .open > a,
.navbar-custom .navbar-nav > .open > a:hover,
.navbar-custom .navbar-nav > .open > a:focus {
  color: #ffffff; /* Text bleibt Weiß */
  background: skyblue; /* Optional: Setzt einen dezenten Hintergrund für Hover */
}

/* smaller, tighter spacing */
.navbar-condensed .navbar-brand {
  padding: 10px 14px;
  font-weight: 600;
}
.navbar-condensed .navbar-nav > li > a {
  padding: 10px 12px; /* default is 15/15 -> make tighter */
  line-height: 20px;
}

/* caret + badge aesthetics */
.navbar-custom .caret {
  border-top-color: #9ca3af;
  border-bottom-color: #9ca3af;
}

/* EINSTELLUNG 3: Verhindert, dass der Dropdown-Pfeil (Caret) seine Farbe ändert */
.navbar-custom .navbar-nav > li > a:hover .caret {
  border-top-color: #9ca3af; /* Fixiert auf die Originalfarbe */
  border-bottom-color: #9ca3af; /* Fixiert auf die Originalfarbe */
}

.navbar-custom .badge {
  background: #22c55e; /* green-500 */
  font-size: 10px;
  vertical-align: 2px;
}

/* dropdown menu styling */
.navbar-custom .dropdown-menu {
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 220px;
}
.navbar-custom .dropdown-menu > li > a {
  color: #e5e7eb;
  padding: 8px 12px;
}

/* FIX FÜR DROPDOWN-LINKS: Entfernt den Hover-Hintergrund und fixiert die Farbe */
.navbar-custom .dropdown-menu > li > a:hover {
  color: #e5e7eb; /* NEU: Fixiert die Textfarbe auf die Standard-Dropdown-Farbe */
}

.navbar-custom .dropdown-menu .dropdown-divider {
  height: 1px;
  margin: 6px 0;
}

/* Make the inside of the expanded navbar a flex row */
@media (min-width: 768px) {
  .navbar-custom .navbar-collapse {
    display: flex !important;
    align-items: center;
  }

  /* primary (left) nav: one line, no wrap, horizontal scroll if overflow */
  .navbar-custom .nav-primary {
    display: flex;
    flex-wrap: nowrap; /* keep in one line */
    overflow-x: auto; /* scroll if too long */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap; /* prevent line breaks inside */
    gap: 0; /* Bootstrap li anchors already space */
    margin-right: 12px; /* breathing room before right side */
  }

  /* keep the right menu at the far end */
  .navbar-custom .navbar-right {
    margin-left: auto !important;
  }

  /* compact the tracking form so it doesn't push to next line */
  .navbar-custom .form-inline .form-control {
    height: 30px;
    padding: 4px 8px;
  }
  .navbar-custom .btn.btn-success {
    height: 30px;
    line-height: 18px;
    padding: 4px 10px;
    border-radius: 4px;
  }

  /* tighter dropdown open state (keeps height small) */
  .navbar-custom .open .dropdown-menu {
    margin-top: 0;
  }

  /* keep brand from exploding width; ellipsis if too long */
  .navbar-custom .navbar-brand {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Make the toggle (hamburger) easier to see */
.navbar-custom .navbar-toggle {
  border-color: rgba(255, 255, 255, 0.25);
}
.navbar-custom .navbar-toggle .icon-bar {
  background: #fff;
}

/* Ensure long anchor labels don’t wrap within the item */
.navbar-custom .navbar-nav > li > a {
  white-space: nowrap;
}

/* Optional: prettier scroll bar for overflow nav (WebKit) */
@media (min-width: 768px) {
  .navbar-custom .nav-primary::-webkit-scrollbar {
    height: 8px;
  }
  .navbar-custom .nav-primary::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
  }
  .navbar-custom .nav-primary:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* Small fix for forms nested in <ul> */
.navbar-custom .nav > li#tracking_button_1,
.navbar-custom .nav > li#tracking_button_2 {
  display: flex;
  align-items: center;
}
.navbar-custom #tracking {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.navbar-custom #tracking input[type="text"] {
  width: 160px; /* don’t let it balloon */
}

/* --- Fix für Bootstrap-3 Dropdowns --- */
@media (min-width: 768px) {
  /* 1) KEIN flex auf .navbar-collapse */
  .navbar-custom .navbar-collapse {
    display: block !important; /* zurück auf block */
    overflow: visible !important; /* Dropdowns dürfen rausfallen */
  }

  /* 2) Flex nur auf die ULs anwenden */
  .navbar-custom .nav-primary {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    /* WICHTIG: Dropdowns müssen sichtbar sein */
    overflow: visible; /* statt overflow-x:auto */
  }

  /* wenn du weiterhin horizontales Scrollen brauchst,
      nimm es lieber auf die Links – NICHT auf die UL */
  .navbar-custom .nav-primary > li > a {
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 420px; /* optionaler Schutz gegen Ausufern */
  }

  /* Rechte Seite als Flex, damit sie rechts “klebt” */
  .navbar-custom .navbar-right {
    margin-left: auto !important;
    display: flex;
    align-items: center;
  }
}

/* Sicherheitsnetz: Dropdowns immer oben sichtbar */
.navbar-custom .dropdown-menu {
  z-index: 2000;
}

/* --- Tracking komplett ausblenden --- */
.navbar-custom #tracking,
.navbar-custom li#tracking_button_1,
.navbar-custom li#tracking_button_2 {
  display: none !important;
}

.navbar-custom .navbar-brand,
.navbar-custom .navbar-nav > li > a {
  border-radius: 6px; /* kleine Grundrundung */
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    border-radius 0.15s ease;
}

/* Hover/Focus/Active/Open: wird zum "Pill" + skyblue bleibt */
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-nav > li > a:hover,
.navbar-custom .navbar-nav > li > a:focus,
.navbar-custom .navbar-nav > li > a:active,
.navbar-custom .navbar-nav > .open > a,
.navbar-custom .navbar-nav > .open > a:hover,
.navbar-custom .navbar-nav > .open > a:focus,
.navbar-custom .navbar-nav > .active > a,
.navbar-custom .navbar-nav > .active > a:hover,
.navbar-custom .navbar-nav > .active > a:focus {
  border-radius: 999px !important; /* oval/pill */
  background: skyblue !important; /* deine Wunschfarbe bleibt */
  color: #fff !important; /* gute Lesbarkeit */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  text-decoration: none !important;
}

/* Caret (Pfeil) bleibt sichtbar */
.navbar-custom .navbar-nav > li > a:hover .caret,
.navbar-custom .navbar-nav > .open > a .caret,
.navbar-custom .navbar-nav > .active > a .caret {
  border-top-color: #fff !important;
  border-bottom-color: #fff !important;
}

/* === Dropdown: Pill/Oval-Hover mit skyblue === */
.navbar-custom .dropdown-menu > li > a {
  border-radius: 6px; /* kleine Grundrundung */
  margin: 4px 8px; /* seitlicher Abstand, damit die Rundung sichtbar wird */
  transition: background 0.15s ease, color 0.15s ease, border-radius 0.15s ease,
    box-shadow 0.15s ease;
}

.navbar-custom .dropdown-menu > li > a:hover,
.navbar-custom .dropdown-menu > li > a:focus,
.navbar-custom .dropdown-menu > .active > a,
.navbar-custom .dropdown-menu > .active > a:hover,
.navbar-custom .dropdown-menu > .active > a:focus {
  background: skyblue !important; /* deine Wunschfarbe */
  color: #fff !important; /* gut lesbar */
  border-radius: 999px !important; /* oval/pill */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); /* dezenter Lift */
  text-decoration: none !important;
}

.dropdown-menu {
  max-height: 500px;
  overflow-y: auto;
}
