/* ==========================================================================
   KOMPONENTE — HEADER / TOPBAR
   components/header.css
   Schmale Info-Leiste + Sticky-Header mit Verdichtung beim Scrollen.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Topbar — schmale Servicezeile (Hotline, E-Mail, Sprache)
   -------------------------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  background: var(--c-topbar-bg);
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-topbar-border);
  transition: transform var(--dur) var(--ease-out);
}
.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.topbar__left,
.topbar__right { display: flex; align-items: center; gap: 1.25rem; }
.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.01em;
  color: var(--c-gray-600);
  white-space: nowrap;
}
.topbar__item svg { width: 14px; height: 14px; color: var(--c-accent-700); flex: none; }
.topbar__item a { color: var(--c-ink); }
.topbar__item a:hover { color: var(--c-accent-700); }
.topbar__hotline strong { color: var(--c-ink); font-weight: 700; letter-spacing: 0.01em; }

/* 24/7-Hotline als kräftiger Blau-Chip — sofort sichtbar, hochwertig */
.topbar__hotline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: calc(var(--topbar-h) - 12px);
  padding: 0 0.9rem 0 0.7rem;
  background: var(--c-accent);
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.topbar__hotline svg { color: #fff; width: 15px; height: 15px; }
.topbar__hotline a { color: #fff; }
.topbar__hotline a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.topbar__hotline strong { color: #fff; }
.topbar__hotline .dot {
  width: 8px; height: 8px; flex: none;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.6);
  animation: pulse-dot-white 2.4s infinite;
}
@keyframes pulse-dot-white {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.topbar__badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--c-ink);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-size: 0.68rem;
}
.topbar__badge .dot {
  width: 8px; height: 8px; background: var(--c-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(14,147,210,0.55);
  animation: pulse-dot 2.4s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(14,147,210,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(14,147,210,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,147,210,0); }
}

/* --------------------------------------------------------------------------
   Header-Leiste
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: var(--topbar-h); left: 0; right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--c-border);
  transition: height var(--dur) var(--ease-out),
              background var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              top var(--dur) var(--ease-out);
  backdrop-filter: saturate(180%) blur(8px);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Scroll-Zustand: Topbar ausblenden, Header verdichten */
body.is-scrolled .topbar { transform: translateY(-100%); }
body.is-scrolled .site-header {
  top: 0;
  height: var(--header-h-scroll);
  box-shadow: var(--shadow-sm);
}

/* Marke / Logo */
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img {
  height: 46px;
  width: auto;
  transition: height var(--dur) var(--ease-out);
}
body.is-scrolled .brand img { height: 38px; }
.brand__fallback {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}
.brand__fallback .amp { color: var(--c-accent); }

/* --------------------------------------------------------------------------
   Header-Aktionen (Sprache, Suche, Kontakt-CTA, Burger)
   -------------------------------------------------------------------------- */
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.header-actions__divider { width: 1px; height: 26px; background: var(--c-border); margin-inline: 0.35rem; }

/* Telefon-Icon-Button: nur in der mobilen Kopfzeile sichtbar (siehe responsive.css) */
.header-cta--phone { display: none; }

/* Sprachumschalter */
.lang-switch { position: relative; }
.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--c-text-strong);
  border: 1px solid transparent;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-switch__toggle:hover { background: var(--c-gray-100); color: var(--c-accent-700); }
.lang-switch__toggle svg.chev { width: 14px; height: 14px; transition: transform var(--dur-fast); }
.lang-switch__toggle[aria-expanded="true"] svg.chev { transform: rotate(180deg); }
.lang-switch__current { text-transform: uppercase; }
.lang-switch__flag { width: 18px; height: 13px; flex: none; border: 1px solid var(--c-border); }

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
  z-index: var(--z-mega);
}
.lang-switch.is-open .lang-switch__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 0.9rem;
  color: var(--c-text);
  text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-switch__option:hover { background: var(--c-gray-100); color: var(--c-accent-700); }
.lang-switch__option[aria-current="true"] { color: var(--c-accent-700); font-weight: 600; }
.lang-switch__option[aria-current="true"]::after {
  content: "";
  margin-left: auto;
  width: 14px; height: 8px;
  border-left: 2px solid var(--c-accent);
  border-bottom: 2px solid var(--c-accent);
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Burger / Nav-Toggle
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  position: relative;
  align-items: center;
  justify-content: center;
}
.nav-toggle__box { position: relative; width: 24px; height: 16px; }
.nav-toggle__line {
  position: absolute; left: 0;
  width: 100%; height: 2px;
  background: var(--c-ink);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast);
}
.nav-toggle__line:nth-child(1) { top: 0; }
.nav-toggle__line:nth-child(2) { top: 7px; }
.nav-toggle__line:nth-child(3) { top: 14px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Overlay (für Mega-Menü & Mobile-Drawer)
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(15,20,25,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
  backdrop-filter: blur(2px);
}
.overlay.is-active { opacity: 1; visibility: visible; }

/* Spacer, damit Inhalt nicht unter dem Fixed-Header liegt (nur wo kein Hero) */
.header-spacer { height: calc(var(--header-h) + var(--topbar-h)); }

/* --------------------------------------------------------------------------
   24/7-Hotline-Button im Header (nur mobil sichtbar, klar beschriftet)
   -------------------------------------------------------------------------- */
.header-hotline {
  display: none;                 /* Sichtbarkeit steuert responsive.css */
  align-items: center;
  gap: 0.45rem;
  height: 42px;
  padding: 0 0.8rem;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: background var(--dur-fast);
}
.header-hotline svg { width: 17px; height: 17px; flex: none; }
.header-hotline:hover { background: var(--c-accent-600); color: #fff; }

/* Prominente 24/7-Hotline-Karte im Mobile-Drawer */
.drawer-hotline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.05rem;
  background: linear-gradient(135deg, var(--c-brand-blue), var(--c-brand-blue-800));
  color: #fff;
  margin: 0.85rem 0 1.35rem;
}
.drawer-hotline__icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
}
.drawer-hotline__icon svg { width: 20px; height: 20px; }
.drawer-hotline small {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.15rem;
}
.drawer-hotline strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.12rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.drawer-hotline:hover { color: #fff; }
