/* ========================================= */
/* --- GŁÓWNY NAGŁÓWEK (DESKTOP) --- */
/* ========================================= */
header {
  background: var(--white);
  height: 90px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 8%;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  height: 75px;
}

.header-logo {
  position: absolute;
  top: 0;
  left: 8%;
  z-index: 2100;
}

.header-logo a {
  display: block;
  padding: 10px 15px 40px 15px;
  text-decoration: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 70%,
    rgba(255, 255, 255, 0) 30%
  );
  border-radius: 0 0 20px 230px;
  transition: var(--transition);
}

.header-logo img {
  height: 120px !important;
  width: auto !important;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
}

header.scrolled .header-logo a {
  padding: 10px 15px 30px 15px;
}
header.scrolled .header-logo img {
  height: 90px !important;
}

/* --- GŁÓWNY KONTENER MENU (DESKTOP) --- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 40px; /* Odstęp między listą linków a przyciskiem "Angebot" */
}

/* --- TYPOGRAFIA I UKŁAD MENU (DESKTOP) --- */
.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 40px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--primary-navy);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
  position: relative;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-action);
  transition: var(--transition);
}

.nav-menu a:hover::after {
  width: 100%;
}
.nav-menu a:hover {
  color: var(--accent-blue);
}

/* ========================================= */
/* --- DROPDOWN 3.0 (ULTRA PREMIUM LOOK) --- */
/* ========================================= */
.dropdown {
  position: relative;
}

.drop-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Sprężysta animacja obrotu strzałki */
.drop-btn span {
  font-size: 0.7rem !important;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

.dropdown:hover .drop-btn span {
  transform: rotate(180deg);
}

/* --- GŁÓWNA CHMURKA MENU --- */
.dropdown-content {
  /* Zamiast display:none, używamy visibility do bezbłędnych animacji */
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 15px); /* Odsunięte lekko od przycisku */
  left: 50%;

  /* Animacja 3D: menu wyjeżdża z dołu i rośnie (scale) */
  transform: translateX(-50%) translateY(15px) scale(0.95);

  /* GLASSMORPHISM - Efekt matowego szkła */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  min-width: 290px;
  padding: 16px;
  border-radius: 20px; /* Mocne, nowoczesne zaokrąglenie */

  /* Wielowarstwowy cień + wewnętrzny błysk (Apple style) */
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 25px 50px -12px rgba(0, 78, 146, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);

  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 3000;

  /* Płynne wejście */
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Niewidzialny most - zapobiega znikaniu menu, gdy zjeżdżasz na nie myszką */
.dropdown-content::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 20px;
}

/* Aktywacja menu po najechaniu */
.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown-content li {
  width: 100%;
  margin: 0;
  list-style: none;
}

/* --- NAGŁÓWKI KATEGORII --- */
.dropdown-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-blue);
  font-weight: 800;
  padding: 16px 16px 8px 16px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Nowoczesny detal: gradientowa linia zanikająca obok nagłówka */
.dropdown-category::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 78, 146, 0.1) 0%,
    transparent 100%
  );
}

.dropdown-category.mt-2 {
  margin-top: 8px;
}

/* --- LINKI (HOVER EFFECTS 3.0) --- */
.dropdown-content a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 2px;
  text-transform: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-navy);
  border-radius: 12px; /* Kapsułkowy kształt podświetlenia */
  position: relative;
  transition: all 0.3s ease;
  z-index: 1;
}

.dropdown-content a::after {
  display: none !important;
}

/* Dynamiczny hover myszką */
.dropdown-content a:hover {
  color: var(--accent-blue);
  transform: translateX(5px); /* Lekkie "pchnięcie" */
  background: rgba(0, 180, 219, 0.05); /* Subtelne tło */
}

/* Mikro-interakcja: Boczny marker wyrastający po najechaniu */
.dropdown-content a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 50%;
  background: var(--light-blue);
  border-radius: 0 4px 4px 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dropdown-content a:hover::before {
  transform: translateY(-50%) scaleY(1);
}

/* --- WYMUSZENIE PIONOWEGO UKŁADU W CHMURCE --- */
.nav-menu ul.dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 0; /* Kasuje gigantyczne 40px odstępu z głównego menu */
  align-items: stretch; /* Zmusza linki do wypełnienia całej szerokości ramki */
}

/* Poprawka na mobile (żeby napisy były jasne na ciemnym tle) */
@media (max-width: 992px) {
  .dropdown-category {
    color: var(--light-blue) !important;
    padding: 15px 10px 5px 15px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
}

/* --- PRZYCISK W NAGŁÓWKU (DESKTOP) --- */
.header-btn {
  background: var(--grad-action);
  color: white !important;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  white-space: nowrap; /* Blokuje załamanie tekstu, trzyma w jednej linii */
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 78, 146, 0.2);
}

.header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 78, 146, 0.3);
  color: white !important;
}

.header-btn::after {
  display: none !important; /* Zapobiega pojawianiu się kreski pod spodem jak przy zwykłych linkach */
}

/* --- PRZEŁĄCZNIK JĘZYKA (DESKTOP) --- */
.lang-switch a {
  padding: 8px 16px;
  border: 1.5px solid var(--medium-gray);
  border-radius: 50px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lang-switch a:hover {
  border-color: var(--accent-blue);
  background: var(--light-gray);
}
.lang-switch a::after {
  display: none;
}

@media (max-width: 992px) {
  /* --- PASEK NAGŁÓWKA --- */
  header {
    padding: 10px 6% !important;
    height: 75px !important;
    justify-content: space-between !important;
    background: var(--primary-navy) !important;
  }

  .header-logo {
    position: relative !important;
    left: 0 !important;
  }
  .header-logo a {
    background: white !important; /* Dodajemy białą ramkę, żeby logo nie zniknęło na granacie */
    padding: 5px 15px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
  }
  .header-logo img {
    height: 35px !important;
  }

  /* --- HAMBURGER --- */
  .menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    z-index: 100000 !important;
    cursor: pointer !important;
  }
  .menu-toggle .bar {
    width: 30px !important;
    height: 3px !important;
    background: white !important;
    border-radius: 3px !important;
    transition: 0.4s !important;
  }

  .menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg) !important;
  }
  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0 !important;
  }
  .menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg) !important;
  }

  /* --- GŁÓWNY KONTENER MENU (Czarne tło zjeżdżające z boku) --- */
  .nav-menu {
    position: fixed !important;
    top: 75px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100dvh - 75px) !important;
    background: var(--primary-navy) !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Trzyma wszystko na górze! */
    padding: 20px 8% 40px !important;
    z-index: 99998 !important;
    overflow-y: auto !important;
    display: flex !important;
    transform: translateX(100%) !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .nav-menu.active {
    transform: translateX(0) !important;
  }
  /* Ukrywamy ten brzydki, biały scrollbar w menu mobilnym */
  .nav-menu::-webkit-scrollbar {
    width: 5px;
  }
  .nav-menu::-webkit-scrollbar-track {
    background: transparent;
  }
  .nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
  }

  .nav-menu ul {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    flex: none !important; /* Zabrania rozciągania listy na siłę */
    margin-bottom: 20px !important;
  }

  .nav-menu ul li > a {
    color: white !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 100% !important;
    padding: 15px 0 !important;
    display: flex !important;
    justify-content: space-between !important; /* Dopycha strzałkę ▼ do prawej */
    align-items: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
  }
  .nav-menu ul li {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important; /* Zabrania elementom rozciągania się */
  }

  /* --- CAŁKOWITA IZOLACJA I WYŚRODKOWANIE JĘZYKA --- */
  .nav-menu ul li.lang-switch {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 30px 0 10px 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  .nav-menu ul li.lang-switch a {
    /* Nadpisujemy "space-between" i inne style zwykłych linków */
    display: inline-flex !important;
    justify-content: center !important; /* Trzyma flagę i tekst blisko siebie */
    align-items: center !important;
    gap: 12px !important;

    /* Wygląd pigułki */
    width: auto !important;
    min-width: 110px !important;
    padding: 10px 25px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50px !important;

    /* Resetujemy style odziedziczone po "Kontakt/Home" */
    border-bottom: none !important;
    text-transform: uppercase !important;
    color: white !important;
  }

  /* Blokujemy rozpychanie się elementów wewnątrz pigułki */
  .nav-menu ul li.lang-switch a img,
  .nav-menu ul li.lang-switch a span {
    flex: none !important;
    margin: 0 !important;
  }

  /* Ukrywamy podmenu tak mocno, że znika z fizyki strony */
  .dropdown-content {
    display: none !important; /* To usuwa fizyczne miejsce! */
    height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.15) !important;
    margin: 0 !important;
    padding: 0 !important; /* Zerujemy padding, żeby nie robił dziury */
    border: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* AKORDEON: Pokazuje się i odzyskuje wymiary TYLKO gdy JS doda klasę .open */
  .dropdown.open .dropdown-content {
    display: block !important;
    height: auto !important;
    padding: 10px 0 10px 15px !important;
    margin: 10px 0 !important;
    border-radius: 0 0 10px 10px !important;
    border-left: 2px solid var(--accent-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Obrót strzałki */
  .dropdown.open .drop-btn span {
    transform: rotate(180deg) !important;
  }

  .dropdown-content li {
    border: none !important;
  }

  .dropdown-content a {
    font-size: 1.1rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 12px 10px !important;
    border: none !important;
    font-weight: 400 !important;
  }

  /* --- NAPRAWA JĘZYKA I PRZYCISKU (Zabija nakładanie) --- */
  .lang-switch {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important; /* Środkuje przycisk względem menu */
    align-items: center !important;
    margin: 30px 0 10px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
  }

  .lang-switch a {
    /* Nadpisujemy space-between z linii 218 */
    display: inline-flex !important;
    justify-content: center !important; /* Trzyma flagę i tekst razem w środku */
    align-items: center !important;
    gap: 12px !important; /* Stały odstęp między flagą a napisem */

    /* Pigułka */
    width: auto !important; /* Blokuje rozciąganie na całą szerokość */
    min-width: 110px !important;
    padding: 10px 25px !important;

    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50px !important;
    color: white !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: var(--transition) !important;
  }

  /* Resetujemy zachowanie obrazka i tekstu wewnątrz pigułki */
  .lang-switch a img,
  .lang-switch a span {
    margin: 0 !important;
    flex: none !important;
    display: inline-block !important;
  }

  .nav-menu .header-btn {
    margin-top: 25px !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    padding: 16px !important;
    font-size: 1.1rem !important;
    background: var(--light-blue) !important; /* Wyraźny, jasny niebieski */
    border-radius: 10px !important;
    color: var(--primary-navy) !important; /* Ciemny tekst dla kontrastu */
    font-weight: 800 !important;
    text-transform: uppercase !important;
    box-shadow: 0 10px 20px rgba(0, 180, 219, 0.3) !important;
  }
}
