/* MW Consent v1.1.2 – Banner CSS
   KEIN :root-Block hier - alle Defaults kommen von get_color_css() im PHP-Output.
   Damit greifen Theme-Variablen (auch beim Dark-Mode-Toggle) korrekt durch.
   Jeder var()-Call hat einen Fallback für Robustheit. */

#mw-consent-banner {
  position: fixed;
  z-index: 100000;
  /* v1.1.4: font-family inherit damit Theme-Schrift verwendet wird */
  font-family: inherit;
  /* v1.1.5: Stabile Default-Schriftgrößen damit Banner immer lesbar bleibt */
  font-size: 16px !important;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#mw-consent-banner.mw-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   POSITION 1: Volle Breite unten (Streifen)
   ============================================ */
#mw-consent-banner.mw-pos-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(20px);
}
#mw-consent-banner.mw-pos-bottom.mw-visible {
  transform: translateY(0);
}
.mw-pos-bottom .mw-inner {
  background: var(--mwc-bg, #ffffff);
  border-top: 3px solid var(--mwc-primary, #00B4D8);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  /* v1.1.6: Mehr Padding für luftigeres Layout */
  padding: 28px 32px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================
   POSITIONS 2-10: Kompakte Card (Ecken, Seiten, Mitte)
   Breite: 680px (1.5x von vorher 440px)
   ============================================ */
#mw-consent-banner:not(.mw-pos-bottom) {
  width: min(680px, calc(100vw - 32px));
  margin: 16px;
}

#mw-consent-banner:not(.mw-pos-bottom) .mw-inner {
  background: var(--mwc-bg, #ffffff);
  border-radius: 12px;
  border-top: 3px solid var(--mwc-primary, #00B4D8);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  /* v1.1.6: Mehr Padding für luftigeres Layout */
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* TOP-Reihe */
#mw-consent-banner.mw-pos-top-left,
#mw-consent-banner.mw-pos-top-center,
#mw-consent-banner.mw-pos-top-right {
  top: 0;
  transform: translateY(-20px);
}
#mw-consent-banner.mw-pos-top-left.mw-visible,
#mw-consent-banner.mw-pos-top-center.mw-visible,
#mw-consent-banner.mw-pos-top-right.mw-visible {
  transform: translateY(0);
}
#mw-consent-banner.mw-pos-top-left    { left: 0; }
#mw-consent-banner.mw-pos-top-right   { right: 0; }
#mw-consent-banner.mw-pos-top-center  { left: 50%; transform: translate(-50%, -20px); }
#mw-consent-banner.mw-pos-top-center.mw-visible { transform: translate(-50%, 0); }

/* MIDDLE-Reihe */
#mw-consent-banner.mw-pos-middle-left,
#mw-consent-banner.mw-pos-middle-center,
#mw-consent-banner.mw-pos-middle-right {
  top: 50%;
}
#mw-consent-banner.mw-pos-middle-left  { left: 0;  transform: translateY(calc(-50% + 20px)); }
#mw-consent-banner.mw-pos-middle-right { right: 0; transform: translateY(calc(-50% + 20px)); }
#mw-consent-banner.mw-pos-middle-left.mw-visible,
#mw-consent-banner.mw-pos-middle-right.mw-visible { transform: translateY(-50%); }

#mw-consent-banner.mw-pos-middle-center {
  left: 50%;
  transform: translate(-50%, calc(-50% + 20px));
}
#mw-consent-banner.mw-pos-middle-center.mw-visible {
  transform: translate(-50%, -50%);
}

/* BOTTOM-Reihe (außer .mw-pos-bottom) */
#mw-consent-banner.mw-pos-bottom-left,
#mw-consent-banner.mw-pos-bottom-center,
#mw-consent-banner.mw-pos-bottom-right {
  bottom: 0;
  transform: translateY(20px);
}
#mw-consent-banner.mw-pos-bottom-left.mw-visible,
#mw-consent-banner.mw-pos-bottom-center.mw-visible,
#mw-consent-banner.mw-pos-bottom-right.mw-visible {
  transform: translateY(0);
}
#mw-consent-banner.mw-pos-bottom-left   { left: 0; }
#mw-consent-banner.mw-pos-bottom-right  { right: 0; }
#mw-consent-banner.mw-pos-bottom-center { left: 50%; transform: translate(-50%, 20px); }
#mw-consent-banner.mw-pos-bottom-center.mw-visible { transform: translate(-50%, 0); }

/* ============================================
   TEXT-BEREICH - Schriftgrößen erbt vom Theme,
   v1.1.6: Mehr Abstand zwischen Überschrift, Body und Links
   ============================================ */
.mw-text { flex: 1; min-width: 0; }
.mw-text .mw-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--mwc-text-strong, #0D1117);
}
.mw-text p {
  margin: 0 0 16px;
  color: var(--mwc-text, #475569);
}

.mw-links {
  display: flex;
  /* v1.1.6: Größerer Gap für Touch-Target-Konformität (24px+) */
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 14px;
  row-gap: 6px; /* bei flex-wrap: kompaktere Zeilenabstände */
}
.mw-links a {
  color: var(--mwc-primary, #00B4D8);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  /* v1.1.6: Touch-Target-Padding für 24x24+ Min-Größe */
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  min-height: 24px;
}
.mw-links a:hover { filter: brightness(0.85); }
.mw-link-settings { cursor: pointer; }

/* ============================================
   BUTTONS
   ============================================ */
.mw-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.mw-pos-bottom .mw-actions {
  flex-direction: column;
  min-width: 200px;
  align-items: stretch;
}

#mw-consent-banner:not(.mw-pos-bottom) .mw-actions {
  flex-direction: row;
  width: 100%;
}
#mw-consent-banner:not(.mw-pos-bottom) .mw-btn-equal {
  flex: 1;
  min-width: 0;
}

.mw-btn-equal {
  padding: 12px 22px;
  /* v1.1.4: Buttons erben Schriftart vom Theme, eigene Größe für UI-Konsistenz */
  font-family: inherit;
  font-size: 0.95em;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  min-width: 180px;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
  letter-spacing: 0.01em;
  background: var(--mwc-primary, #00B4D8);
  color: #ffffff;
}
.mw-btn-equal:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.mw-btn-equal:active { transform: scale(0.98); }
.mw-btn-equal:focus-visible {
  outline: 3px solid var(--mwc-primary, #00B4D8);
  outline-offset: 2px;
  filter: brightness(1.05);
}
.mw-btn-dark, .mw-btn-primary {
  background: var(--mwc-primary, #00B4D8);
  color: #ffffff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  #mw-consent-banner:not(.mw-pos-bottom) {
    width: calc(100vw - 16px);
    margin: 8px;
  }

  .mw-pos-bottom .mw-inner {
    flex-direction: column;
    gap: 18px;
    padding: 18px 20px;
  }
  .mw-pos-bottom .mw-actions {
    min-width: auto;
    width: 100%;
    flex-direction: column-reverse;
  }
  #mw-consent-banner:not(.mw-pos-bottom) .mw-actions {
    flex-direction: column-reverse;
  }

  .mw-btn-equal {
    width: 100%;
    min-width: auto;
    padding: 14px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mw-consent-banner { transition: none; transform: none !important; }
  .mw-btn-equal { transition: none; }
}
