/* ==========================================================================
   Cookie Banner — OK-MARKED
   DSGVO-konform: Opt-in, gleichwertige Buttons, kein Pre-Ticking
   ========================================================================== */

.cb-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cb-root[hidden] { display: none; }

/* Backdrop nur bei geöffneten Settings */
.cb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}

.cb-root.is-settings-open .cb-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Banner Card — bottom sheet
   ========================================================================== */

.cb-card {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, calc(100% + 48px));
  width: calc(100% - 48px);
  max-width: 720px;
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 28px;
  pointer-events: auto;
  transition: transform .45s var(--ease), opacity .3s var(--ease);
  opacity: 0;
}

.cb-root.is-visible .cb-card {
  transform: translate(-50%, 0);
  opacity: 1;
}

.cb-card__title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.cb-card__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-700);
  margin: 0 0 20px;
}

.cb-card__text a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cb-card__text a:hover {
  color: var(--brand-dark);
}

/* Buttons — gleichwertig */
.cb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.cb-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid var(--gray-900);
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  line-height: 1.2;
  text-align: center;
}

.cb-btn:hover {
  background: var(--gray-900);
  color: var(--white);
}

.cb-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.cb-btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--white);
}

.cb-card__settings-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 10px;
  margin: 0;
  color: var(--gray-500);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
}

.cb-card__settings-link:hover {
  color: var(--gray-900);
}

/* ==========================================================================
   Settings Panel — ersetzt Card-Content
   ========================================================================== */

.cb-settings {
  display: none;
}

.cb-root.is-settings-open .cb-default { display: none; }
.cb-root.is-settings-open .cb-settings { display: block; }

.cb-settings__list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cb-option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

.cb-option__body {
  flex: 1;
  min-width: 0;
}

.cb-option__title {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--gray-900);
}

.cb-option__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-500);
  margin: 0;
}

/* Toggle Switch */
.cb-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin-top: 2px;
}

.cb-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.cb-toggle input:disabled { cursor: not-allowed; }

.cb-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 999px;
  transition: background .2s var(--ease);
}

.cb-toggle__slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .25s var(--ease);
}

.cb-toggle input:checked + .cb-toggle__slider {
  background: var(--brand);
}

.cb-toggle input:checked + .cb-toggle__slider::before {
  transform: translateX(18px);
}

.cb-toggle input:disabled + .cb-toggle__slider {
  background: var(--gray-300);
  opacity: 0.7;
}

.cb-toggle input:disabled:checked + .cb-toggle__slider {
  background: var(--gray-500);
}

.cb-toggle input:focus-visible + .cb-toggle__slider {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ==========================================================================
   Re-Open Button (floating, nach Consent)
   ========================================================================== */

.cb-reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9998;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.cb-reopen.is-visible {
  display: flex;
}

.cb-reopen:hover {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}

.cb-reopen svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 640px) {
  .cb-card {
    width: calc(100% - 24px);
    bottom: 12px;
    padding: 24px 20px;
    border-radius: 14px;
  }

  .cb-card__title {
    font-size: 18px;
  }

  .cb-card__text {
    font-size: 14px;
  }

  .cb-actions {
    grid-template-columns: 1fr;
  }

  .cb-btn {
    padding: 14px 20px;
  }

  .cb-option {
    padding: 14px;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .cb-card,
  .cb-backdrop,
  .cb-btn,
  .cb-toggle__slider,
  .cb-toggle__slider::before,
  .cb-reopen {
    transition: none !important;
  }
}
