/* ==========================================================================
   Header Basis (Desktop)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-header);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition:
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease;
  overflow: visible;
}

.site-header.scrolled {
  height: var(--header-height-scrolled);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.header-container {
  max-width: var(--container-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 20;
}

/* ==========================================================================
   Logo
   ========================================================================== */
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 30;
}

.logo-img {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  transition: height 0.3s ease;
}

.site-header.scrolled .logo-img {
  height: 38px;
}

/* ==========================================================================
   Desktop Navigation (Keine Pfeile)
   ========================================================================== */
.main-nav {
  display: flex;
  align-items: center;
  /* Platz für das Eckmuster rechts – wächst/schrumpft mit dem Header */
  margin-right: clamp(40px, 5vw, 70px);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.2rem);
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1.5rem 0.5rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
  border: none;
}

.nav-link:hover {
  color: var(--primary-hover);
}

.mobile-arrow {
  display: none; /* Auf Desktop ausgeblendet */
}

/* ==========================================================================
   Desktop Dropdowns (Dezente gelbe Linie oben)
   ========================================================================== */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-dropdown);
  min-width: 220px;
  list-style: none;
  box-shadow: var(--shadow-dropdown);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 3px solid var(--primary-color);
  z-index: 10000;
}

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

.dropdown-menu li a {
  display: block;
  padding: 0.65rem 1.25rem;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    padding-left 0.15s ease;
}

.dropdown-menu li a:hover {
  background-color: var(--bg-hover);
  color: var(--text-color);
  padding-left: 1.5rem;
}

/* ==========================================================================
   Muster Desktop (Schrumpft beim Scrollen synchron mit)
   ========================================================================== */
.header-pattern-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  /* Höhe und Breite dynamisch an die Header-Höhe gekoppelt (Ratio 207.84 / 80 = 2.598) */
  height: var(--header-height);
  width: calc(var(--header-height) * 2.598);
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  transition:
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Beim Scrollen wird auch das Muster proportional kleiner */
.site-header.scrolled .header-pattern-wrapper {
  height: var(--header-height-scrolled);
  width: calc(var(--header-height-scrolled) * 2.598);
}

.pattern-header {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Burger Toggle Button
   ========================================================================== */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1100;
  padding: 0;
}

.burger-btn span {
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

.burger-btn.active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-btn.active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Ansicht & Drawer
   ========================================================================== */
.mobile-social-icons {
  display: none;
}

.mobile-pattern-corner {
  display: none;
}

@media (max-width: 960px) {
  .header-pattern-wrapper {
    display: none !important;
  }

  .burger-btn {
    display: flex;
  }

  /* Mobile Drawer Menü */
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-header);
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.16);
    margin-right: 0;
    padding: 5.5rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    transform: translateX(100%);
    visibility: hidden;
    transition:
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0s linear 0.35s;
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .main-nav.active {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0s linear 0s;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
  }

  .nav-item {
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    background: transparent;
  }

  .nav-link:hover,
  .nav-item.mobile-open .nav-link {
    color: var(--primary-hover);
  }

  .mobile-arrow {
    display: block;
    width: 16px;
    height: 16px;
    fill: var(--text-light);
    transition:
      transform 0.25s ease,
      fill 0.25s ease;
  }

  .nav-item.mobile-open .mobile-arrow {
    transform: rotate(180deg);
    fill: var(--primary-hover);
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0.2rem 0 0.6rem 1.25rem;
    margin-top: 0;
    max-height: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }

  .nav-item.mobile-open .dropdown-menu {
    max-height: 320px;
  }

  .dropdown-menu li a {
    padding: 0.45rem 0;
    font-size: 0.95rem;
    color: var(--text-light);
    background: transparent;
  }

  .dropdown-menu li a:hover {
    color: var(--text-color);
    padding-left: 0.4rem;
    background: transparent;
  }

  .mobile-social-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    position: relative;
    z-index: 10;
  }

  .mobile-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition:
      color 0.2s ease,
      transform 0.2s ease;
  }

  .mobile-social-icons a:hover {
    color: var(--primary-hover);
    transform: scale(1.15);
  }

  .mobile-social-icons svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
  }

  .mobile-pattern-corner {
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 190px;
    height: 220px;
    pointer-events: none;
    z-index: 1;
  }
}

/* Sehr schmale Handys */
@media (max-width: 380px) {
  .logo-img {
    height: 40px;
    max-width: 170px;
  }
}
