/* ===========================
   Bitwolt Header (bereinigt)
   → Nur Header-spezifische Styles, alles gescoped
   =========================== */

/* Header-Variablen (nur für den Header genutzt) */
:root{
  --bw-blue:   #05B9F2;
  --bw-yellow: #B9DB1B;
  --bw-h:      80px;
  --bw-pad-x:  24px;
  --bw-max:    1680px;
  --bw-text:   #F4F7FA;
  --bw-muted:  rgba(255,255,255,.68);
  --bw-line:   rgba(255,255,255,.08);
  --bw-nav-shift: 18px;

  /* Mapping für den restlichen Code */
  --header-height: var(--bw-h);
  --bw-nav-font: clamp(17px, 1.15vw, 20px);
}

/* Spacer komplett aus */
.bw-header-spacer{ height:0 !important; display:none !important; }

/* Header-Wrapper */
.bw-header{
  position: sticky; top: 0; z-index: 1000;
  width: 100% !important; margin: 0 !important; border-radius: 0 !important;
  box-shadow: none !important;
  background: rgba(5,8,12,.92) !important;
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bw-line) !important;
  transition: transform .24s ease, opacity .2s ease;
}
.bw-header--hidden{ transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* Innerer Container */
.bw-header__inner{
  position: relative; max-width: var(--bw-max); height: var(--bw-h);
  margin: 0 auto; padding: 0 var(--bw-pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Logo/Wortmarke */
.bw-header .bw-logo{
  display:inline-flex; align-items:center; text-decoration:none; line-height:1;
  font-family: 'Oswald', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  font-weight: 700; letter-spacing: .4px;
  font-size: clamp(38px, 3.6vw, 64px); margin-right: 14px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.bw-header .bw-logo .b{ color: var(--bw-blue); }
.bw-header .bw-logo .y{ color: var(--bw-yellow); }
.bw-header .bw-logo:hover{ filter: brightness(1.06); }

/* Segment-Dropdown */
.bw-header .bw-segment{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.bw-header .bw-segment__trigger{
  display:inline-flex; align-items:center; gap:10px;
  height: 38px; padding: 0 14px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--bw-line);
  color: var(--bw-text); cursor:pointer; font: inherit; font-weight:700;
}
.bw-header .bw-segment__trigger:hover{ background: rgba(255,255,255,.07); }
.bw-header .bw-segment__menu[aria-hidden="true"]{ display:none; }
.bw-header .bw-segment__menu{
  position:absolute; top:calc(100% + 8px); left:0; min-width:220px;
  background: rgba(10,14,18,.98); border:1px solid var(--bw-line); border-radius:12px;
  padding:6px; box-shadow:0 16px 40px rgba(0,0,0,.35);
}
.bw-header .bw-segment__item{
  display:block; padding:10px 12px; border-radius:8px;
  color: var(--bw-text); text-decoration:none; font-weight:600;
}
.bw-header .bw-segment__item:hover{ background: rgba(255,255,255,.06); }

/* Hauptnavigation (nur in der Header-Zeile) */
.bw-header .bw-header__inner > .bw-nav{
  position:absolute; left:50%;
  transform: translateX(calc(-40% + var(--bw-nav-shift)));
  display:flex; align-items:center; gap:24px; white-space:nowrap;
}
.bw-header .bw-link{
  position: relative; color: var(--bw-text); text-decoration:none;
  font-weight:700; font-size: var(--bw-nav-font);
}
.bw-header .bw-link:hover{ color: #aee9ff; }
.bw-header .bw-link::after{
  content:""; position:absolute; left:0; bottom:-10px;
  width:100%; height:3px; border-radius:3px; background: var(--bw-blue);
  transform: scaleX(0); transform-origin: left center; transition: transform .18s ease;
}
.bw-header .bw-link:hover::after{ transform: scaleX(1); }
.bw-header .bw-link.bw-active{ color:#21c2ff; }
.bw-header .bw-link.bw-active::after{ transform: scaleX(1); }

/* Actions (rechts) – nur in der Header-Zeile */
.bw-header .bw-header__inner > .bw-actions{
  margin-left:auto; display:flex; align-items:center; gap:10px;
}
.bw-header .bw-ghost,
.bw-header .bw-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:44px; padding:0 16px; border-radius:12px;
  font-weight:700; text-decoration:none; cursor:pointer; border:1px solid var(--bw-line);
}
.bw-header .bw-ghost{ color: var(--bw-blue); background: transparent; }
.bw-header .bw-ghost:hover{ background: rgba(255,255,255,.06); }
.bw-header .bw-btn{ background: var(--bw-blue); color:#03121a; border-color: var(--bw-blue); }
.bw-header .bw-btn:hover{ filter: brightness(1.07); }

/* User-Menü */
.bw-header .bw-user #bw-user-trigger{
  display:inline-flex; align-items:center; gap:10px;
  height:44px; padding:0 16px; border-radius:12px;
  font-weight:700; cursor:pointer; background: var(--bw-blue);
  color:#03121a; border:1px solid var(--bw-blue);
}
.bw-header .bw-user #bw-user-trigger:hover{ filter:brightness(1.07); }
.bw-header .bw-avatar{
  width:30px; height:30px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(0,0,0,.25); background: rgba(255,255,255,.18);
  font-weight:800;
}
.bw-header #bw-user-menu[hidden]{ display:none !important; }
.bw-header #bw-user-menu{
  position:absolute; right:0; top: calc(100% + 10px); min-width:260px;
  background: rgba(10,14,18,.98); border:1px solid var(--bw-line);
  border-radius:12px; padding:8px; box-shadow:0 16px 40px rgba(0,0,0,.35);
}
.bw-header #bw-user-menu .bw-link,
.bw-header #bw-user-menu .bw-ghost{
  display:block; width:100%; text-align:left; margin:0; height:auto;
  padding:10px 12px; border-radius:8px; border:none; background:transparent;
  color: var(--bw-text);
}
.bw-header #bw-user-menu .bw-link:hover,
.bw-header #bw-user-menu .bw-ghost:hover{ background: rgba(255,255,255,.06); }

/* Burger */
.bw-header .bw-burger{
  display:none; height:40px; width:40px; border-radius:10px;
  border:1px solid var(--bw-line); background: transparent; color: var(--bw-text);
  cursor:pointer;
}

/* ===========================
   RIGHT Drawer – #bw-drawer
   =========================== */
#bw-drawer[hidden]{ display:none !important; }
#bw-drawer{
  position: fixed;
  top: var(--bw-h);
  right: max(0px, env(safe-area-inset-right));
  width: min(88vw, 360px);
  height: calc(100dvh - var(--bw-h));
  overflow: auto; -webkit-overflow-scrolling: touch;
  background: rgba(5,8,12,.92);              /* gleich wie Header-Opacity */
  border-left: 1px solid var(--bw-line);
  box-shadow: -18px 0 48px rgba(0,0,0,.45);
  padding: 12px;
  z-index: 1100;
  display:flex; flex-direction:column;
}

/* Navigation im Drawer */
#bw-drawer .bw-nav{
  position: static; transform: none;
  display:flex; flex-direction:column; align-items:stretch;
  gap:12px; margin:0;
}
#bw-drawer .bw-nav .bw-link{ display:block; padding:12px 2px; border-radius:10px; font-weight:700; }
#bw-drawer .bw-nav .bw-link:hover{ background: rgba(255,255,255,.06); }

/* Öffentliche Seiten Block */
#bw-drawer #bw-segment-mobile{
  display:flex; flex-direction:column; gap:8px;
  margin:10px 0 12px; padding-top:10px; border-top:1px dashed var(--bw-line);
}
#bw-drawer #bw-segment-mobile .bw-segment__item{
  display:block; padding:10px 12px; border-radius:10px; color:var(--bw-text); text-decoration:none;
}
#bw-drawer #bw-segment-mobile .bw-segment__item:hover{ background: rgba(255,255,255,.06); }

/* Labels, wenn eingeloggt */
#bw-drawer[data-logged="1"] .bw-nav::before{
  content:"Mitgliederbereich"; display:block; margin:4px 0 10px; color:var(--bw-muted); font-weight:700; letter-spacing:.02em;
}
#bw-drawer[data-logged="1"] #bw-segment-mobile{ margin-top:16px; padding-top:10px; border-top:1px dashed var(--bw-line); }
#bw-drawer[data-logged="1"] #bw-segment-mobile::before{
  content:"Öffentliche Seiten"; display:block; margin:0 0 10px; color:var(--bw-muted); font-weight:700;
}

/* Actions unten im Drawer */
#bw-drawer #bw-actions-mobile{
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(5,8,12,.75) 40%, rgba(5,8,12,.94));
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  margin-top: auto;

  /* NEU: sauberer Abstand & Zentrierung für alle Zustände */
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#bw-drawer #bw-actions-mobile .bw-btn.bw-block,
#bw-drawer #bw-actions-mobile .bw-ghost.bw-block{
  width:100%;
  display:inline-flex;            /* statt block: für zentrierte Inhalte */
  justify-content:center;
  align-items:center;
  text-align:center;
}
/* einheitliche Schriftgröße unten */
#bw-drawer #bw-actions-mobile .bw-btn,
#bw-drawer #bw-actions-mobile .bw-ghost{ font-size:16px; }

/* Responsive */
@media (max-width: 1100px){
  .bw-header .bw-header__inner > .bw-nav{ display:none; }
  .bw-header .bw-burger{ display:inline-flex; align-items:center; justify-content:center; }
  .bw-header .bw-header__inner{ gap: 10px; }
  .bw-header .bw-header__inner .bw-actions{ display:none !important; }
  .bw-header .bw-header__inner #bw-seg-trigger{ display:none !important; }
  .bw-header .bw-segment{ gap: 8px; }
}

/* Tap-Highlight aus */
.bw-header a, .bw-header button{ -webkit-tap-highlight-color: rgba(255,255,255,0); }

/* Sehr kleine Screens */
@media (max-width: 380px){ :root{ --bw-h: 72px; } }
