/**
 * Globale Top-Leiste über dem fixierten Nav – nur sichtbar, wenn fast oben im Viewport.
 * Steuerung: assets/top-bar.js + body.has-top-bar / .top-bar-open
 */
:root {
  --top-bar-height: 36px;
  /* Bis top-bar.js läuft: Leiste gilt als sichtbar (oben). */
  --top-bar-extra: 36px;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 102;
  min-height: var(--top-bar-height);
  background: var(--black, #0d0d0d);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  transition:
    transform 0.28s cubic-bezier(0.2, 0, 0, 1),
    opacity 0.22s cubic-bezier(0.2, 0, 0, 1),
    visibility 0.22s;
}

.top-bar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.top-bar-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  flex: 1 1 auto;
  min-width: 0;
}

.top-bar-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.top-bar-meta a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.15s, color 0.15s;
}

.top-bar-meta a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.top-bar-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

@media (max-width: 640px) {
  .top-bar-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

body.has-top-bar {
  --nav-top-offset: 0px;
}

body.has-top-bar.top-bar-open {
  --nav-top-offset: var(--top-bar-height);
}

body.has-top-bar nav {
  top: var(--nav-top-offset);
  transition: top 0.28s cubic-bezier(0.2, 0, 0, 1);
}

body.page-home.has-top-bar .hero,
body.page-produkt.has-top-bar .hero {
  margin-top: calc(-108px - var(--nav-top-offset));
  padding-top: calc(108px + var(--nav-top-offset));
  transition:
    margin-top 0.28s cubic-bezier(0.2, 0, 0, 1),
    padding-top 0.28s cubic-bezier(0.2, 0, 0, 1);
}

/* Smartphone: Top-Leiste (E-Mail, DE) ausblenden – mehr Platz, weniger Lärm */
@media (max-width: 700px) {
  .top-bar {
    display: none !important;
  }
  html {
    --top-bar-extra: 0px !important;
  }
  body.has-top-bar.top-bar-open {
    --nav-top-offset: 0px;
  }
  body.has-top-bar nav {
    top: 0;
  }
}
