/**
 * BDSF Cookie Consent — Frontend.
 */
:root {
  --bdsf-cc-brand: #0c4da2;
  --bdsf-cc-text: #1d2327;
  --bdsf-cc-bg: #ffffff;
  --bdsf-cc-overlay: rgba(15, 23, 42, 0.55);
  --bdsf-cc-radius: 8px;
  --bdsf-cc-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  --bdsf-cc-z-banner: 99990;
  --bdsf-cc-z-modal: 99999;
  --bdsf-cc-z-floating: 99989;
}

.bdsf-cc-root {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bdsf-cc-text);
}

.bdsf-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--bdsf-cc-radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bdsf-cc-btn--primary {
  background: var(--bdsf-cc-brand);
  color: #fff;
}

.bdsf-cc-btn--primary:hover,
.bdsf-cc-btn--primary:focus {
  filter: brightness(1.05);
}

.bdsf-cc-btn--secondary {
  border-color: #c3c4c7;
  background: #fff;
}

.bdsf-cc-btn--outline {
  background: #fff;
  border-color: var(--bdsf-cc-brand);
  color: var(--bdsf-cc-brand);
}

.bdsf-cc-btn--text {
  color: var(--bdsf-cc-brand);
  text-decoration: underline;
  min-height: auto;
  padding: 0 8px;
}

/* Banner */
.bdsf-cc-banner {
  position: fixed;
  z-index: var(--bdsf-cc-z-banner);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bdsf-cc-bg);
  border-top: 1px solid #dcdcde;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

.bdsf-cc-banner--box {
  left: 16px;
  right: 16px;
  bottom: 16px;
  border: 1px solid #dcdcde;
  border-radius: var(--bdsf-cc-radius);
}

.bdsf-cc-banner--hidden {
  display: none !important;
}

/*
 * Erstbesuch: Banner sichtbar → Floating-Zahnrad ausblenden.
 * Geschwister-Selektor (ohne :has), damit es auch greift, wenn das Icon
 * noch im Markup steht (alte PHP-Version / Cache).
 */
#bdsf-cc-banner:not(.bdsf-cc-banner--hidden) ~ #bdsf-cc-floating {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.bdsf-cc-root:has(#bdsf-cc-banner:not(.bdsf-cc-banner--hidden)) .bdsf-cc-floating {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.bdsf-cc-banner__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}

.bdsf-cc-banner__text {
  flex: 1 1 280px;
}

.bdsf-cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Modal */
.bdsf-cc-modal {
  position: fixed;
  inset: 0;
  z-index: var(--bdsf-cc-z-modal);
  display: none;
}

.bdsf-cc-modal.is-open {
  display: block;
}

.bdsf-cc-modal-open {
  overflow: hidden;
}

.bdsf-cc-modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--bdsf-cc-overlay);
}

.bdsf-cc-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  background: var(--bdsf-cc-bg);
  border-radius: calc(var(--bdsf-cc-radius) + 2px);
  box-shadow: var(--bdsf-cc-shadow);
  overflow: hidden;
}

.bdsf-cc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.bdsf-cc-modal__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

.bdsf-cc-modal__close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #50575e;
}

.bdsf-cc-modal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f6f7f7;
}

.bdsf-cc-modal__tab {
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #50575e;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.bdsf-cc-modal__tab.is-active {
  color: var(--bdsf-cc-brand);
  border-bottom-color: var(--bdsf-cc-brand);
  background: #fff;
}

.bdsf-cc-modal__panels {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0;
}

.bdsf-cc-modal__panel {
  display: none;
  padding: 20px 24px 24px;
}

.bdsf-cc-modal__panel.is-active {
  display: block;
}

.bdsf-cc-panel__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.bdsf-cc-panel__intro {
  margin: 0 0 1.25rem;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.55;
}

.bdsf-cc-panel__intro p {
  margin: 0 0 0.75em;
}

.bdsf-cc-panel__intro p:last-child {
  margin-bottom: 0;
}

.bdsf-cc-panel__consent-note {
  margin: 1rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  line-height: 1.45;
  color: #3c434a;
}

.bdsf-cc-panel__consent-note p {
  margin: 0 0 0.5em;
}

.bdsf-cc-panel__consent-note p:last-child {
  margin-bottom: 0;
}

.bdsf-cc-panel__consent-note code {
  font-size: 0.92em;
}

.bdsf-cc-panel__subtitle {
  margin: 16px 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.bdsf-cc-panel__block + .bdsf-cc-panel__subtitle {
  margin-top: 20px;
}

.bdsf-cc-panel__block {
  margin-bottom: 8px;
}

.bdsf-cc-panel__content {
  margin-bottom: 16px;
  line-height: 1.55;
}

/* Theme-Body nutzt Inter mit font-variation-settings wght 400 — ohne eigene
   Variation wirkt <strong>/<b> im Modal optisch nicht fett. */
.bdsf-cc-root strong,
.bdsf-cc-root b {
  font-weight: 700;
  font-variation-settings: "wght" 700;
}

.bdsf-cc-root em,
.bdsf-cc-root i {
  font-style: italic;
}

.bdsf-cc-root a {
  color: var(--bdsf-cc-brand, #0c4da2);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.bdsf-cc-panel__content p {
  margin: 0 0 0.85em;
}

.bdsf-cc-panel__content p:last-child {
  margin-bottom: 0;
}

.bdsf-cc-panel__content ul,
.bdsf-cc-panel__content ol {
  margin: 0.5em 0 1em;
  padding-left: 1.35em;
}

.bdsf-cc-panel__content li {
  margin: 0.35em 0;
}

.bdsf-cc-panel__content li + li {
  margin-top: 0.45em;
}

.bdsf-cc-panel__content code {
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: #f0f0f1;
}

.bdsf-cc-panel__content .bdsf-cc-table,
.bdsf-cc-panel__content table {
  width: 100%;
  table-layout: fixed;
  margin: 0.75em 0 1.1em;
  border-collapse: collapse;
  font-size: 0.95em;
  line-height: 1.45;
}

.bdsf-cc-panel__cookies-before {
  margin-bottom: 0.35em;
}

.bdsf-cc-panel__cookies-after {
  margin-top: 0.35em;
}

.bdsf-cc-panel__content .bdsf-cc-table th,
.bdsf-cc-panel__content .bdsf-cc-table td,
.bdsf-cc-panel__content table th,
.bdsf-cc-panel__content table td {
  padding: 0.65em 0.75em;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.bdsf-cc-panel__content .bdsf-cc-table thead th,
.bdsf-cc-panel__content table thead th {
  background: #f6f7f7;
  font-weight: 600;
  color: var(--bdsf-cc-text);
}

.bdsf-cc-panel__content .bdsf-cc-table thead th:nth-child(1),
.bdsf-cc-panel__content table thead th:nth-child(1),
.bdsf-cc-panel__content .bdsf-cc-table tbody th,
.bdsf-cc-panel__content table tbody th {
  width: 22%;
  font-weight: 600;
  background: #fafafa;
  white-space: nowrap;
}

.bdsf-cc-panel__content .bdsf-cc-table thead th:nth-child(2),
.bdsf-cc-panel__content table thead th:nth-child(2) {
  width: 50%;
}

.bdsf-cc-panel__content .bdsf-cc-table thead th:nth-child(3),
.bdsf-cc-panel__content table thead th:nth-child(3),
.bdsf-cc-panel__content .bdsf-cc-table td:last-child,
.bdsf-cc-panel__content table td:last-child {
  width: 28%;
  white-space: normal;
}

@media (max-width: 640px) {
  .bdsf-cc-panel__content .bdsf-cc-table,
  .bdsf-cc-panel__content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bdsf-cc-panel__content .bdsf-cc-table tbody th,
  .bdsf-cc-panel__content table tbody th,
  .bdsf-cc-panel__content .bdsf-cc-table td:last-child,
  .bdsf-cc-panel__content table td:last-child {
    white-space: normal;
  }
}

.bdsf-cc-panel__hint {
  color: #646970;
  font-style: italic;
}

.bdsf-cc-panel__content--privacy {
  max-height: 320px;
  overflow: auto;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--bdsf-cc-radius);
  background: #fafafa;
}

.bdsf-cc-panel__link a {
  color: var(--bdsf-cc-brand);
  font-weight: 600;
}

.bdsf-cc-category-list {
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.bdsf-cc-category-list__item + .bdsf-cc-category-list__item {
  margin-top: 12px;
}

.bdsf-cc-panel__toggle {
  margin: 1.25rem 0 0.5rem;
}

.bdsf-cc-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.bdsf-cc-toggle__hint {
  color: #646970;
  font-size: 12px;
}

.bdsf-cc-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

/* Floating button — kompakt (Zahnrad), Text nur bei Hover/Fokus auf Desktop */
.bdsf-cc-floating {
  --bdsf-cc-floating-size: 48px;
  position: fixed;
  z-index: var(--bdsf-cc-z-floating);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  min-width: var(--bdsf-cc-floating-size);
  height: var(--bdsf-cc-floating-size);
  padding: 0;
  border: 1px solid #dcdcde;
  border-radius: 999px;
  background: #fff;
  color: var(--bdsf-cc-brand);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  transition: max-width 0.22s ease, padding 0.22s ease, gap 0.22s ease, box-shadow 0.15s ease;
}

.bdsf-cc-floating:hover,
.bdsf-cc-floating:focus-visible {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

.bdsf-cc-floating:focus-visible {
  outline: 2px solid var(--bdsf-cc-brand);
  outline-offset: 2px;
}

.bdsf-cc-floating__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--bdsf-cc-floating-size);
  height: var(--bdsf-cc-floating-size);
}

.bdsf-cc-floating__icon svg {
  display: block;
}

.bdsf-cc-floating__text {
  max-width: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--bdsf-cc-text);
  transition: max-width 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
}

.bdsf-cc-floating--compact {
  max-width: var(--bdsf-cc-floating-size);
  width: var(--bdsf-cc-floating-size);
}

/* Dauerhaft Icon + Text (Admin: „both“) */
.bdsf-cc-floating:not(.bdsf-cc-floating--compact) {
  width: auto;
  max-width: none;
  padding: 0 14px 0 4px;
  gap: 6px;
}

.bdsf-cc-floating:not(.bdsf-cc-floating--compact) .bdsf-cc-floating__text {
  max-width: none;
  opacity: 1;
  margin: 0;
}

/* Kompakt: Text nur bei echtem Hover/Fokus (nicht Touch-Hover-Artefakte) */
@media (hover: hover) and (pointer: fine) {
  .bdsf-cc-floating--compact:hover,
  .bdsf-cc-floating--compact:focus-visible {
    width: auto;
    max-width: min(92vw, 360px);
    padding-right: 14px;
    gap: 2px;
  }

  .bdsf-cc-floating--compact:hover .bdsf-cc-floating__text,
  .bdsf-cc-floating--compact:focus-visible .bdsf-cc-floating__text {
    max-width: 280px;
    opacity: 1;
    margin-right: 4px;
  }

  /* Rechts: Text nach links aufklappen */
  .bdsf-cc-floating--compact.bdsf-cc-floating--bottom-right:hover,
  .bdsf-cc-floating--compact.bdsf-cc-floating--bottom-right:focus-visible {
    flex-direction: row-reverse;
    padding-right: 0;
    padding-left: 14px;
  }

  .bdsf-cc-floating--compact.bdsf-cc-floating--bottom-right:hover .bdsf-cc-floating__text,
  .bdsf-cc-floating--compact.bdsf-cc-floating--bottom-right:focus-visible .bdsf-cc-floating__text {
    margin-right: 0;
    margin-left: 4px;
  }
}

/*
 * Abstand zum Theme-Scroll-to-Top (48px + Rand).
 * Unten links typisch Konflikt — Button höher setzen.
 */
.bdsf-cc-floating--bottom-left {
  left: 16px;
  bottom: 72px;
}

.bdsf-cc-floating--bottom-right {
  right: 16px;
  bottom: 72px;
}

.bdsf-cc-footer-link-wrap {
  display: none;
}

@media (max-width: 640px) {
  .bdsf-cc-floating {
    --bdsf-cc-floating-size: 44px;
  }

  /* Mobil: nie den langen Label-Pill erzwingen (auch bei Sticky-Hover) */
  .bdsf-cc-floating--compact:hover,
  .bdsf-cc-floating--compact:focus-visible {
    max-width: var(--bdsf-cc-floating-size);
    width: var(--bdsf-cc-floating-size);
    padding: 0;
    gap: 0;
    flex-direction: row;
  }

  .bdsf-cc-floating--compact:hover .bdsf-cc-floating__text,
  .bdsf-cc-floating--compact:focus-visible .bdsf-cc-floating__text {
    max-width: 0;
    opacity: 0;
    margin: 0;
  }

  .bdsf-cc-floating--bottom-left,
  .bdsf-cc-floating--bottom-right {
    bottom: 80px;
  }

  .bdsf-cc-banner__inner,
  .bdsf-cc-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .bdsf-cc-banner__actions .bdsf-cc-btn,
  .bdsf-cc-modal__footer .bdsf-cc-btn {
    width: 100%;
  }

  .bdsf-cc-modal__dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }
}
