/* ============================================================
   Wertpilot v2 - Header + Hamburger + Mobile-Nav + Kontakt-Widget
   Aus bestehender index.html extrahiert (Design unveraendert).
   ============================================================ */

/* ═══ HEADER (Bernert-Style, zwei Modi) ═══ */
header.head {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: var(--pageLimit);
  z-index: 99;
  padding: 18px 0 0;
  transition: padding 200ms ease;
}

header.head .inner {
  width: var(--baseWidth);
  max-width: var(--maxWidthBig);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

header.head #logo {
  transition: width .3s ease, height .3s ease, margin .3s ease;
  width: 232px;
  height: 117px;
  margin: 0;
  position: relative;
}
header.head #logo a { display: block; width: 100%; height: 100%; position: relative; }
header.head #logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  transition: opacity .2s ease-in-out;
}
/* Home-Mode (nicht sticky): Logo fuer DUNKLEN Hintergrund ueber dem Hero.
   Achtung: Der Dateiname bezeichnet den Hintergrund, nicht die Logofarbe.
   logo_horizontal_dunkel.svg hat weissen Schriftzug, _hell.svg hat navy Schriftzug. */
header.head #logo .logo-hell   { opacity: 0; }
header.head #logo .logo-dunkel { opacity: 1; }
/* Sticky-Mode: Logo fuer HELLEN Hintergrund auf der weissen Box */
header.head.is-sticky #logo .logo-hell   { opacity: 1; }
header.head.is-sticky #logo .logo-dunkel { opacity: 0; }

/* Nav-Pill weiss auf Home-Mode (nicht sticky) */
#site-navigation { margin-bottom: 30px; }
#primary-menu {
  display: flex;
  align-items: center;
  background-color: var(--contrastColorInverted);
  border-radius: var(--borderRadius);
  list-style: none;
  padding: 0;
}
#primary-menu > li { position: relative; }
#primary-menu > li > a {
  color: var(--secondColor);
  font-size: var(--baseFontSize);
  font-family: var(--headline);
  font-weight: 500;
  padding: 10px 20px;
  display: block;
  text-decoration: none;
  transition: var(--baseTransition);
}
#primary-menu > li:first-of-type > a { border-radius: var(--borderRadius) 0 0 var(--borderRadius); }
#primary-menu > li:last-of-type > a { border-radius: 0 var(--borderRadius) var(--borderRadius) 0; }
#primary-menu > li:hover > a,
#primary-menu > li.current_page_item > a {
  color: var(--contrastColorInverted);
  background: var(--mainColor);
}
#primary-menu > li.has-children > a::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  background: var(--gp-pfeil) no-repeat center / contain;
  width: 10px; height: 10px;
  transform: rotate(90deg);
  filter: invert(1);
}

.button-header-wrapper {
  position: relative;
  margin-bottom: 30px;
}
.text-button-header-wrapper {
  position: absolute;
  top: -67px;
  left: -102px;
  pointer-events: none;
}
.text-button-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--contrastColorInverted);
  transform: rotate(-8deg);
  white-space: nowrap;
  position: absolute;
  left: -75px;
  top: -5px;
}
/* Handschriftliches Label nur auf breiten Desktops — sonst kollidiert es mit der Nav-Pill */
@media (max-width: 1290px) {
  .text-button-header-wrapper { display: none; }
  header.head { padding-top: 30px; }
}

/* Sticky-State */
header.head.is-sticky { padding-top: 30px; }
header.head.is-sticky > .inner {
  box-shadow: 0 0 24px 0 rgba(0,0,0,.25);
  border-radius: var(--borderRadius);
  background: var(--contrastColorInverted);
  padding-right: 20px;
  align-items: center;
}
header.head.is-sticky #logo {
  width: 140px;
  height: 48px;
  margin: 12px 20px;
}
header.head.is-sticky .button-header-wrapper { margin-bottom: 0; }
header.head.is-sticky .text-button-header-wrapper { display: none; }
header.head.is-sticky #site-navigation { margin-bottom: 0; }
header.head.is-sticky #primary-menu {
  background: transparent;
  border-radius: 0;
}
header.head.is-sticky #primary-menu > li > a {
  padding: 27px 20px;
  border-radius: 0;
}

/* Scroll-Progress-Bar (transparenter BG — nur Gold-Indicator sichtbar) */
#page-scroll-position {
  height: 3px;
  width: 100%;
  display: block;
  background: transparent;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;   /* ueber dem Header (z-index 99), klebt am oberen Bildschirmrand */
  pointer-events: none;
}
#indicator-bar {
  height: 100%;
  width: 0;
  display: block;
  background: var(--mainColor);
  transition: width .1s;
}

/* ═══ KONTAKT-WIDGET (Schwebendes Pill rechts, Bernert-Style) ═══ */
.contact-widget {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--baseTransition);
}
.contact-widget:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.contact-widget__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 2px solid #fff;
}
/* Gruener Status-Punkt am Avatar entfernt, auf Wunsch. */
.contact-widget__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mainColor);
  text-decoration: none;
  transition: var(--baseTransition);
  position: relative;
}
.contact-widget__icon:hover {
  background: var(--primaryGradient);
  transform: scale(1.08);
}
.contact-widget__icon:hover svg { fill: #fff; }
.contact-widget__icon svg {
  width: 22px;
  height: 22px;
  fill: var(--mainColor);
  transition: var(--baseTransition);
}

/* Expanded Card bei Hover */
.contact-widget__card {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  padding: 24px 26px;
  width: 300px;
  opacity: 0;
  visibility: hidden;
  /* Ausblenden erst nach 0,3 s, damit man die Karte erreicht. */
  transition: opacity .3s ease .3s, transform .3s ease .3s, visibility 0s linear .6s;
}
/* Unsichtbare Bruecke ueber die 14 px Luecke zum Widget,
   sonst reisst der Hover beim Hinuebergehen ab. */
.contact-widget__card::before {
  content: '';
  position: absolute;
  left: 100%;
  top: -10px;
  width: 26px;
  height: calc(100% + 20px);
}
.contact-widget:hover .contact-widget__card {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition: opacity .22s ease 0s, transform .22s ease 0s, visibility 0s linear 0s;
}
.contact-widget__card::after {
  content: '';
  position: absolute;
  left: 100%; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #fff;
}
.contact-widget__card .greeting {
  font-family: var(--headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondColor);
  margin-bottom: 4px;
}
.contact-widget__card .name {
  font-size: 13px;
  color: var(--mainColor);
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.contact-widget__card p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
}
.contact-widget__card .cw-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-widget__card .cw-links a {
  font-size: 13px;
  color: var(--secondColor);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  transition: var(--baseTransition);
}
.contact-widget__card .cw-links a:last-child { border-bottom: none; }
.contact-widget__card .cw-links a:hover { color: var(--mainColor); padding-left: 4px; }
.contact-widget__card .cw-links a::before {
  content: '→';
  color: var(--mainColor);
  font-weight: 700;
}

/* Mobile: kompaktere Version, bleibt sichtbar */
@media (max-width: 900px) {
  .contact-widget {
    right: 12px;
    padding: 6px 6px 10px;
    gap: 8px;
  }
  .contact-widget__avatar { width: 44px; height: 44px; }
  .contact-widget__icon { width: 34px; height: 34px; }
  .contact-widget__icon svg { width: 17px; height: 17px; }
  .contact-widget__card { display: none; }  /* Hover-Expand nur Desktop */
}

/* ═══ HAMBURGER-BUTTON (Bernert 1:1) ═══ */
#hamburger {
  position: relative;
  display: none;           /* Desktop: hidden */
  height: 33px;
  width: 40px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: var(--baseTransition);
  z-index: 101;            /* über Overlay */
  margin-bottom: 30px;
}
#hamburger .hamburger-line {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  display: block;
  width: 40px;
  height: 3px;
  background: var(--mainColor);
  transition: var(--baseTransition);
  border-radius: 2px;
}
#hamburger .hamburger-line:first-child { transform: translateX(-50%) translateY(-10px); }
#hamburger .hamburger-line:last-child { transform: translateX(-50%) translateY(7px); }
#hamburger.is-active .hamburger-line {
  background: #fff;
}
#hamburger.is-active .hamburger-line:first-child { transform: translateX(-50%) translateY(0) rotate(-45deg); }
#hamburger.is-active .hamburger-line:nth-child(2) { opacity: 0; }
#hamburger.is-active .hamburger-line:last-child { transform: translateX(-50%) translateY(0) rotate(45deg); }

@media (max-width: 1120px) {
  #hamburger { display: block; }
  /* Desktop-Nav + CTA ausblenden */
  #site-navigation { display: none !important; }
  .button-header-wrapper { display: none !important; }
  /* Header-Inner kompakter */
  header.head { padding-top: 20px; }
  header.head .inner { align-items: center; }
  header.head #logo { width: 160px; height: 80px; }
}

/* ═══ MOBILE-NAV-OVERLAY (Fullscreen, Navy-BG) ═══ */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #393B59 0%, #282A3F 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 90px 28px 30px;
  opacity: 0;
  visibility: hidden;            /* geschlossen: nicht per Tab erreichbar, vom Bildschirmleser ausgenommen (13.10.2026) */
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity .35s ease, transform .4s ease, visibility 0s linear .4s;
  overflow-y: auto;
  overscroll-behavior: contain;  /* Wischen am Menüende reicht nicht an die Seite dahinter weiter */
}
.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .35s ease, transform .4s ease, visibility 0s;
}
.mobile-nav__logo {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 140px;
}
.mobile-nav__menu {
  list-style: none;
  padding: 0;
  margin: 30px 0 40px;
  flex: 1;
}
.mobile-nav__menu li {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-nav__menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4px;
  color: #fff;
  text-decoration: none;
  font-family: var(--headline);
  font-size: 1.4rem;
  font-weight: 500;
  transition: var(--baseTransition);
}
.mobile-nav__menu a::after {
  content: '';
  width: 14px;
  height: 14px;
  background-color: var(--mainColor);
  -webkit-mask: var(--gp-pfeil) no-repeat center/contain;
          mask: var(--gp-pfeil) no-repeat center/contain;
  transition: var(--baseTransition);
}
.mobile-nav__menu a:hover,
.mobile-nav__menu a:active {
  color: var(--mainColor);
  padding-left: 10px;
}
.mobile-nav__menu a:hover::after { transform: translateX(6px); }
.mobile-nav__menu li.is-current a { color: var(--mainColor); }

.mobile-nav__cta {
  display: block;
  text-align: center;
  background: var(--primaryGradient);
  color: var(--secondColor);
  padding: 18px 24px;
  border-radius: 50px;
  font-family: var(--headline);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 -4px 14px 0 rgba(0,0,0,.25) inset;
  margin-bottom: 28px;
}

.mobile-nav__contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.mobile-nav__contact a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: var(--baseTransition);
}
.mobile-nav__contact a:hover,
.mobile-nav__contact a:active {
  background: var(--mainColor);
  border-color: var(--mainColor);
  color: var(--secondColor);
}
.mobile-nav__contact a svg {
  width: 26px;
  height: 26px;
  fill: var(--mainColor);
  transition: var(--baseTransition);
}
.mobile-nav__contact a:hover svg { fill: var(--secondColor); }

.mobile-nav__footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
}
.mobile-nav__footer a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  margin: 0 6px;
}

/* Scroll-Lock wenn Overlay offen */
body.mobile-nav-open { overflow: hidden; }
/* Das Dokument scrollt am html-Element (overflow-x: clip), deshalb sperrt erst die Klasse am html die Seite dahinter. */
html.mobile-nav-open { overflow: hidden; }

/* ═══ DESKTOP DROPDOWN-NAV ═══ */
#primary-menu > li.has-dropdown { position: relative; }

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 16px 48px rgba(40,42,63,0.18);
  padding: 8px 0 12px;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
  border-top: 3px solid var(--mainColor);
  margin-top: -1px;
}
.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* Esc schliesst das offene Aufklappmenü (kopf.js setzt die Klasse, solange Maus/Fokus im Menüpunkt bleiben) */
.has-dropdown.esc-zu:hover .nav-dropdown,
.has-dropdown.esc-zu:focus-within .nav-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.nav-dropdown li a {
  display: block;
  padding: 9px 20px;
  color: var(--secondColor);
  font-size: 14px;
  font-family: var(--mainFont);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.15s ease;
}
.nav-dropdown li a:hover {
  background: rgba(201,168,76,0.08);
  color: var(--mainColor);
  padding-left: 28px;
}

.nav-dropdown__group {
  display: block;
  font-size:12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondColor);
  padding: 12px 20px 4px;
  pointer-events: none;
}

.nav-dropdown__divider {
  height: 1px;
  background: rgba(40,42,63,0.08);
  margin: 6px 16px;
}

#primary-menu > li.has-dropdown > a::after {
  content: '';
  display: inline-block;
  margin-left: 5px;
  width: 10px;
  height: 10px;
  background-color: var(--secondColor);
  -webkit-mask: var(--gp-pfeil) no-repeat center/contain;
          mask: var(--gp-pfeil) no-repeat center/contain;
  transform: rotate(90deg);
  transition: transform 0.2s ease, background-color 0.2s ease;
  vertical-align: middle;
}
#primary-menu > li.has-dropdown:hover > a::after {
  background-color: var(--contrastColorInverted);
  transform: rotate(-90deg);
}

/* ═══ MOBILE ACCORDION ═══ */
.mobile-nav__has-sub { border-bottom: 1px solid rgba(255,255,255,.08); }

.mobile-nav__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 4px;
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  font-family: var(--headline);
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-nav__toggle:hover,
.mobile-nav__toggle.is-open { color: var(--mainColor); }

.mobile-nav__toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-color: var(--mainColor);
  -webkit-mask: var(--gp-pfeil) no-repeat center/contain;
          mask: var(--gp-pfeil) no-repeat center/contain;
  transform: rotate(90deg);
  transition: transform 0.25s ease;
}
.mobile-nav__toggle.is-open .mobile-nav__toggle-icon { transform: rotate(-90deg); }

.mobile-nav__sub {
  list-style: none;
  padding: 0 0 12px 12px;
  display: none;
}
.mobile-nav__sub.is-open { display: block; }

.mobile-nav__sub-group {
  display: block;
  font-size:12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mainColor);
  padding: 10px 4px 4px;
}

.mobile-nav__sub li a {
  display: block;
  padding: 11px 4px;
  color: rgba(255,255,255,0.75);
  font-family: var(--mainFont);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: color 0.2s, padding-left 0.15s;
}
.mobile-nav__sub li a:hover { color: var(--mainColor); padding-left: 8px; }
.mobile-nav__sub li a::after { display: none !important; }


/* A11y: Hamburger-Tap-Flaeche auf 44px (Endpruefung 2026-06-19) */
#hamburger { height: 44px; }

/* ---- Logo und rechte Kopfelemente auf eine Mittellinie ----
   Gemessen am 23.09.2026: Logo-Mitte lag bei 77 px, Navigation bei 82 px.
   Ursache: .inner richtet unten aus (align-items: flex-end), Navigation und
   Knopf werden davon durch margin-bottom 30px abgehoben. Bei 117 px Logohoehe
   und 47 px Navigationshoehe ergibt 35px eine gemeinsame Mitte.
   Gilt nur im Home-Modus; im Sticky-Modus setzt align-items: center das ohnehin. */
header.head:not(.is-sticky) #site-navigation,
header.head:not(.is-sticky) .button-header-wrapper { margin-bottom: 35px; }

/* Letztes Aufklappmenü („Service“) rechtsbündig zum Menüpunkt: Bei 1181 bis etwa 1400 px Breite ragte es 19 bis 42 px über den rechten Bildrand
   (gefunden bei der Prüfung aller Links und Knöpfe, 07.10.2026). Gilt nur für das letzte Menü mit Aufklappliste; die anderen bleiben linksbündig. */
#primary-menu > li.has-dropdown:not(:has(~ li.has-dropdown)) > .nav-dropdown { left: auto; right: 0; }