/* ============================================================
   Café Schloss Diedersdorf – Cookie Consent
   DSGVO-/TDDDG-konformes Banner
   ============================================================ */

.wm-cookie-banner[hidden] { display:none !important; }

.wm-cookie-banner {
  position: fixed; inset: 0;
  z-index: 99990;
  display: flex; align-items: flex-end; justify-content: center;
  font-family: var(--theme-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  color: var(--theme-text, #1f2937);
}

.wm-cookie-banner__overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.wm-cookie-banner__inner {
  position: relative;
  width: min(720px, calc(100% - 2rem));
  margin: 1rem;
  background: var(--theme-bg, #fff);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  padding: 1.5rem 1.5rem 1.25rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

@media (min-width: 700px) {
  .wm-cookie-banner { align-items: center; }
  .wm-cookie-banner__inner { padding: 1.75rem 1.75rem 1.5rem; }
}

.wm-cookie-banner__title {
  margin: 0 0 .5rem;
  font-size: clamp(1.05rem, 1vw + .9rem, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--theme-primary, #1a3a6c);
  font-family: var(--theme-font-heading, inherit);
}

.wm-cookie-banner__body p {
  margin: 0 0 .65rem;
  font-size: .94rem;
  line-height: 1.55;
  color: var(--theme-text, #1f2937);
}
.wm-cookie-banner__body a {
  color: var(--theme-accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wm-cookie-banner__legal {
  font-size: .82rem !important;
  color: var(--theme-text-muted, #6b7280);
}

.wm-cookie-banner__categories {
  margin-top: .75rem;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: .75rem;
  display: grid; gap: .5rem;
}

.wm-cc-cat {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.02);
  padding: 0;
  overflow: hidden;
}
.wm-cc-cat[open] { background: rgba(0,0,0,.035); }
.wm-cc-cat > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  font-weight: 600;
}
.wm-cc-cat > summary::-webkit-details-marker { display: none; }
.wm-cc-cat > summary::after {
  content: "▾"; opacity: .55; font-size: .85em;
  transition: transform .2s ease;
}
.wm-cc-cat[open] > summary::after { transform: rotate(180deg); }
.wm-cc-cat > p {
  margin: 0; padding: 0 1rem 1rem; font-size: .88rem; line-height: 1.5;
  color: var(--theme-text-muted, #6b7280);
}

.wm-cc-cat__title { font-size: .98rem; }
.wm-cc-cat__state {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: var(--theme-text-muted, #6b7280);
  font-weight: 500;
}
.wm-cc-cat__state input[type="checkbox"] {
  width: 1.05rem; height: 1.05rem; accent-color: var(--theme-accent, #2563eb);
}
.wm-cc-cat__state input[type="checkbox"][disabled] { opacity: .55; }

.wm-cookie-banner__actions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: 1rem; padding-top: .85rem;
  border-top: 1px solid rgba(0,0,0,.06);
  justify-content: flex-end;
}

.wm-cc-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  font: inherit; font-weight: 600;
  padding: .65rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
  min-height: 44px; /* a11y: Touch-Target */
}
.wm-cc-btn:focus-visible {
  outline: 3px solid var(--theme-accent, #2563eb);
  outline-offset: 2px;
}
.wm-cc-btn--primary {
  background: var(--theme-primary, #1a3a6c);
  color: #fff;
  border-color: var(--theme-primary, #1a3a6c);
}
.wm-cc-btn--primary:hover {
  background: var(--theme-primary-hover, #14305a);
  border-color: var(--theme-primary-hover, #14305a);
  transform: translateY(-1px);
}
.wm-cc-btn--ghost {
  background: transparent;
  color: var(--theme-text, #1f2937);
  border-color: rgba(0,0,0,.18);
}
.wm-cc-btn--ghost:hover {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.30);
}
.wm-cc-btn--save {
  background: var(--theme-accent, #2563eb);
  color: #fff; border-color: var(--theme-accent, #2563eb);
}
.wm-cc-btn--save:hover {
  background: var(--theme-accent-hover, #1d4ed8);
  border-color: var(--theme-accent-hover, #1d4ed8);
}

/* Floating Action Button (Reopen) */
.wm-cookie-fab {
  position: fixed; bottom: 1rem; left: 1rem;
  z-index: 99980;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  display: none; /* aktiviert via JS, sobald Consent gespeichert ist */
  align-items: center; justify-content: center;
}
.wm-cookie-fab.is-visible { display: inline-flex; }
.wm-cookie-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
.wm-cookie-fab:focus-visible {
  outline: 3px solid var(--theme-accent, #2563eb);
  outline-offset: 2px;
}

/* Dark Mode Anpassung */
.theme-dark .wm-cookie-banner__inner,
[data-theme="dark"] .wm-cookie-banner__inner {
  background: #111827;
  color: #e5e7eb;
  border-color: rgba(255,255,255,.08);
}
.theme-dark .wm-cookie-banner__title,
[data-theme="dark"] .wm-cookie-banner__title { color: #93c5fd; }
.theme-dark .wm-cookie-banner__body p,
[data-theme="dark"] .wm-cookie-banner__body p { color: #e5e7eb; }
.theme-dark .wm-cookie-banner__legal,
[data-theme="dark"] .wm-cookie-banner__legal { color: #9ca3af; }
.theme-dark .wm-cc-cat,
[data-theme="dark"] .wm-cc-cat {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}
.theme-dark .wm-cc-btn--ghost,
[data-theme="dark"] .wm-cc-btn--ghost {
  color: #e5e7eb;
  border-color: rgba(255,255,255,.18);
}
.theme-dark .wm-cookie-fab,
[data-theme="dark"] .wm-cookie-fab {
  background: #111827;
  border-color: rgba(255,255,255,.12);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wm-cc-btn, .wm-cookie-fab, .wm-cc-cat > summary::after { transition: none !important; }
}
