/* =========================================================
   Header + Navigation — Werte 1:1 aus universal.css / 114.css
   ========================================================= */

/* --- Header-Grundgerüst --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  text-align: center;
  transition: var(--global-transition);
  padding-bottom: 10px;
}

.site-header-inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 35px 50px 15px;
}

@media (max-width: 767px) {
  .site-header-inner {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 479px) {
  .site-header {
    text-align: justify;
  }
  .site-header-inner {
    padding-top: 14px;
    padding-bottom: 12px;
  }
}

/* --- Logo --- */
.site-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14.7px;
  min-width: 350px;
  text-align: center;
}

#logo-signet {
  width: 90px;
  height: 93px;
  transition: var(--global-transition);
}

#logo-wording {
  width: 192px;
  height: 57px;
  transition: var(--global-transition);
}

@media (max-width: 1399px) {
  #logo-signet {
    max-width: 66px;
    max-height: 70px;
  }
  #logo-wording {
    max-width: 130px;
  }
}

@media (max-width: 767px) {
  .site-logo {
    min-width: 0;
  }
  #logo-signet {
    max-width: 55px;
  }
  #logo-wording {
    max-width: 130px;
  }
}

@media (max-width: 480px) {
  #logo-signet {
    max-width: 40px;
    max-height: 40px;
    margin-bottom: -5px;
  }
  #logo-wording {
    max-width: 90px;
    max-height: 40px;
    margin-bottom: -5px;
  }
}

@media (max-width: 479px) {
  .site-logo {
    gap: 8px;
  }
}

/* --- Rechter Header-Bereich --- */
.site-header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
}

/* --- Menülisten (Desktop + Offcanvas) --- */
.nav-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 25px;
  border-radius: var(--border-radius-global);
  font-family: "CocogooseProNarrow Semilight", sans-serif;
  font-style: normal;
  font-size: 18px;
  color: var(--light-primary);
  background: transparent;
  transition: background-color var(--global-transition) ease-in-out, color var(--global-transition) ease-in-out;
}

.nav-list a:hover {
  background: var(--primary-1000);
}

/* Letzter Punkt (Karriere) mit dezentem Pill-Hintergrund */
.nav-main .nav-item:last-child a {
  background: rgba(40, 70, 95, 0.3);
}

.nav-main .nav-item:last-child a:hover {
  background: var(--primary-1000);
}

/* Aktuelle Seite = dunkle Pill (Original: .current-menu-item) */
.nav-home .nav-item.is-current a,
.nav-main .nav-item.is-current a {
  background: var(--primary-1000);
}

.nav-home {
  margin-right: 6px;
}

.nav-main {
  margin-right: 40px;
}

@media (max-width: 1399px) {
  .nav-home,
  .nav-main,
  .mega-menu {
    display: none;
  }
}

/* --- Mega-Menü (Leistungen) --- */
.mega-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.mega-item {
  position: relative;
  height: 100%;
  color: #ffffff;
  padding: 5px 15px;
  border-radius: 25px;
}

.mega-toggle {
  display: flex;
  align-items: center;
  color: var(--light-primary);
  padding: 10px 25px;
  border-radius: var(--border-radius-global);
  position: relative;
  outline: none;
  cursor: pointer;
  font-family: "CocogooseProNarrow Semilight", sans-serif;
  font-style: normal;
  font-size: 18px;
  transition: background-color var(--global-transition) ease-in-out, color var(--global-transition) ease-in-out;
}

.mega-toggle-text {
  white-space: nowrap;
}

/* Pill bleibt dunkel, solange Maus über Menüpunkt ODER Panel ist */
.mega-item:hover .mega-toggle {
  background: var(--primary-1000);
}

.mega-panel {
  display: block;
  position: absolute;
  left: 0;
  width: 900px;
  max-width: 900px;
  transform: translateX(-320px);
  padding: 15px 50px 10px;
  visibility: hidden;
  opacity: 0;
  transition: all .5s ease;
  pointer-events: none;
  z-index: 15;
  text-align: left;
}

.mega-panel.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.mega-panel:before {
  content: "";
  background: url("/wp-content/uploads/2024/02/Polygon-1.png");
  background-size: contain;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 25px;
  height: 15px;
}

.mega-box {
  background-color: #fff;
  border-radius: var(--border-radius-global);
  padding: 10px 0; /* Original: .oxy-header-container 10px oben/unten */
}

.mega-columns {
  display: flex;
  flex-direction: row;
  padding: 30px;
}

.mega-col-left {
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 0;
  border-right: 1px solid #ccd9e2;
}

.mega-col-right {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0 0 35px;
}

.mega-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  color: var(--secondary-1000);
  transition: var(--global-transition);
  position: relative;
  cursor: pointer;
  font-size: 18px;
}

.mega-link:after {
  content: "";
  width: 10px;
  height: 3px;
  background: var(--primary-1000);
  right: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: var(--global-transition);
}

.mega-link.active:after,
.mega-link:hover:after {
  opacity: 1;
}

.mega-link.active,
.mega-link:hover {
  color: var(--primary-1000);
}

.mega-arrow {
  width: 20px;
  height: 20px;
  display: block;
}

.mega-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mega-link .st0 {
  fill: #32B4A2;
}

.mega-link:hover .st0 {
  fill: var(--primary-1000);
}

.mega-sub {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 10px;
}

.mega-sub.active {
  display: flex;
}

.mega-sub-overview {
  text-align: left;
  align-items: center;
}

.mega-sub-overview img {
  width: 200px;
  height: auto;
}

.mega-sub-flatrate {
  text-align: center;
  align-items: flex-start;
}

.mega-sub-link {
  color: var(--primary-1000);
  transition: .15s;
  font-size: 18px;
  text-align: left;
}

.mega-sub-link:hover {
  color: var(--secondary-1000);
}

/* --- Burger-Trigger --- */
.header-burger {
  display: none;
  align-items: center;
  justify-content: center;
  color: #fdfeff;
  background: none;
  border: none;
  padding: 0;
  margin-right: 17px;
  border-radius: 50%;
  cursor: pointer;
}

.header-burger svg {
  width: 55px;
  height: 55px;
  fill: currentColor;
  display: block;
}

@media (max-width: 1399px) {
  .header-burger {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .header-burger svg {
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 479px) {
  .header-burger svg {
    width: 40px;
    height: 40px;
  }
}

/* --- Suche --- */
.header-search {
  padding-bottom: 2px;
}

.search-open {
  display: flex;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  padding: 2px 6px;
}

.search-open-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  font-size: 22px;
  color: #fdfeff;
}

.search-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  z-index: 99;
  transition: all .3s ease;
  font-size: 44px;
  background: transparent;
}

.search-form.visible {
  opacity: .98;
  visibility: visible;
  max-width: 100%;
  background: linear-gradient(273deg, #32B4A2 14.05%, #004270 89.79%);
}

.search-form-inner {
  display: flex;
  align-items: center;
  max-width: 768px;
  width: 100%;
  color: white;
  margin: auto;
  padding: 10px 50px;
  background: transparent;
}

.search-label {
  width: 100%;
}

/* Original mobil: Overlay-Inner hat 10px Außenabstand (Feld bei x=60, Breite 205) */
@media (max-width: 479px) {
  .search-form-inner {
    width: calc(100% - 20px);
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  overflow: hidden;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.search-field {
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0);
  font-family: inherit;
  border: none;
  width: 100%;
  color: var(--light-primary);
  line-height: 1.5;
  border-bottom: 1px solid var(--secondary-1000);
  padding-left: 10px;
  font-size: 36px;
}

.search-field:focus {
  outline: none;
}

.search-field::placeholder {
  color: var(--light-primary);
  font-size: 36px;
  font-weight: 400;
  opacity: 1;
}

.search-close {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  font-size: 44px;
}

.search-close-icon {
  width: 1.2em;
  height: 1.2em;
  margin-top: 15px;
  fill: var(--light-primary);
  transition: var(--global-transition);
}

.search-close:hover .search-close-icon {
  fill: var(--semantic-error);
}

.search-submit {
  display: none;
}

/* --- Offcanvas (Mobile-Menü) --- */
.offcanvas {
  visibility: visible;
  pointer-events: none;
}

.offcanvas-backdrop {
  background: rgba(0, 0, 0, .5);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transition: all .5s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: auto;
  z-index: 10;
}

.offcanvas.open .offcanvas-backdrop {
  opacity: 1;
  visibility: visible;
}

.offcanvas-panel {
  background: #2f2f2f;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  max-width: 100%;
  width: 350px;
  overflow-x: hidden;
  top: 0;
  left: 0;
  padding: 30px;
  z-index: 1000;
  transition: transform .5s cubic-bezier(0.77, 0, 0.175, 1), box-shadow .5s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: auto;
  transform: translate(-100%, 0);
  text-align: left;
  align-items: flex-start;
}

.offcanvas.open .offcanvas-panel {
  transform: none;
}

.offcanvas-panel:focus {
  outline: none;
}

.offcanvas-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 30px;
}

.nav-offcanvas {
  margin-top: 14px;
  margin-left: -20px;
  width: calc(100% + 20px);
}

.nav-offcanvas .nav-list {
  flex-direction: column;
  align-items: center;
  gap: 10px; /* Original: #menu-mobile-menu */
}

.nav-offcanvas .nav-item {
  width: 100%;
  white-space: normal;
}

.nav-offcanvas a {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.nav-offcanvas .nav-item.is-current a {
  background: var(--primary-1000);
}

.nav-offcanvas .nav-item:last-child a {
  background: rgba(40, 70, 95, 0.3);
}

.offcanvas-legal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  margin-top: 42px;
  gap: 15px;
  border-top: 1px solid #8a8a8a;
  padding-top: 15px;
}

.offcanvas-legal a {
  font-size: 15px;
  color: #ffffff;
  font-weight: 300;
}

/* --- Fixed-Header (ab 150px Scroll) --- */
.site-header.fixedheader {
  background: var(--dark-primary);
}

.fixedheader .network path {
  fill: var(--secondary-1000);
}

.fixedheader #logo-signet {
  width: 60px;
  height: 65px;
}

.fixedheader #logo-wording {
  width: 150px;
  height: 50px;
}

.fixedheader .site-header-inner {
  padding-top: 10px;
  padding-bottom: 0;
}

.fixedheader .nav-list a:hover,
.fixedheader .nav-main .nav-item:last-child a:hover,
.fixedheader .nav-home .nav-item.is-current a:hover,
.fixedheader .mega-item:hover .mega-toggle {
  background-color: var(--secondary-1000);
}

.fixedheader .search-form:not(.visible) {
  background: var(--dark-primary);
}

/* --- A11y: Skip-Link (unsichtbar bis Tastatur-Fokus, ändert Idle-Optik nicht) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus-visible {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 12px 20px;
  background: var(--dark-primary);
  color: #fdfeff;
  border-radius: var(--border-radius-global);
  outline: 2px solid #fdfeff;
  outline-offset: 2px;
}

/* --- A11y: sichtbarer Fokus nur bei Tastatur-Bedienung --- */
.mega-toggle:focus-visible,
.header-burger:focus-visible,
.search-open:focus-visible,
.search-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
