/* 🍪 Cookie-Zustimmung — Aussehen.
   Farben, Ecken, Breite und Schleier kommen als CSS-Variablen vom Server
   (im style="" des Kastens), damit alles im Baukasten einstellbar bleibt. */

/* Die Hülle selbst ist KEIN Kasten (display:contents): Schleier, Fenster und 🍪-Knopf
   liegen jeder für sich fest am Bildschirm. Früher war die Hülle ein bildschirmgroßer,
   „durchklickbarer" Rahmen (pointer-events:none) — auf dem Handy (v.a. iPhone/Safari)
   kamen Tipps auf die Knöpfe dann nicht an, sobald das Fenster scrollbar wurde.
   Nebenbei greift so auch die Unschärfe des KI-Hinweises nicht auf das Fenster durch. */
.ofccb { display: contents; }
.ofccb__bd, .ofccb__card, .ofccb__reopen { z-index: 2147482000; }
.ofccb__bd {
  position: fixed; inset: 0; background: var(--ofccb-bd, rgba(6,10,20,.55));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.ofccb.is-open.is-block .ofccb__bd { opacity: 1; pointer-events: auto; }

/* ---- Der Kasten ---- */
.ofccb__card {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(var(--ofccb-w, 900px), calc(100vw - 24px));
  /* dvh = wirklich sichtbare Höhe (ohne Browserleisten am Handy); vh nur für alte Browser */
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--ofccb-bg, #fff); color: var(--ofccb-fg, #1a1a2e);
  border-radius: var(--ofccb-r, 14px);
  box-shadow: 0 18px 60px rgba(6,10,20,.35), 0 2px 8px rgba(6,10,20,.2);
  padding: 22px 24px; font-size: 15px; line-height: 1.6;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.ofccb.is-open .ofccb__card { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease, transform .25s ease; }

/* Fenster in der Mitte */
.ofccb--modal .ofccb__card { top: 50%; transform: translate(-50%, calc(-50% + 14px)); }
.ofccb--modal.is-open .ofccb__card { transform: translate(-50%, -50%); }
/* Leiste unten */
.ofccb--bar .ofccb__card { bottom: 12px; transform: translate(-50%, 14px); }
.ofccb--bar.is-open .ofccb__card { transform: translate(-50%, 0); }
/* Leiste oben */
.ofccb--top .ofccb__card { top: 12px; transform: translate(-50%, -14px); }
.ofccb--top.is-open .ofccb__card { transform: translate(-50%, 0); }

.ofccb__title { margin: 0 0 10px; font-size: 21px; line-height: 1.3; font-family: var(--hfont, inherit); }
.ofccb__text { margin: 0 0 16px; }
.ofccb__note { margin: 10px 0 0; font-size: 13px; opacity: .75; }

/* ---- Knöpfe ---- */
.ofccb__btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ofccb__btn {
  flex: 1 1 220px; max-width: 340px; min-height: 46px; padding: 11px 20px;
  border: 2px solid var(--ofccb-acc, #0a3b7c); border-radius: calc(var(--ofccb-r, 14px) * .55);
  background: var(--ofccb-acc, #0a3b7c); color: var(--ofccb-accfg, #fff);
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; /* Tipp zählt sofort, kein Doppeltipp-Zoom */
  transition: filter .15s ease, transform .1s ease;
}
.ofccb__btn:hover { filter: brightness(1.08); }
.ofccb__btn:active { transform: translateY(1px); }
.ofccb__btn--ghost { background: transparent; color: var(--ofccb-acc, #0a3b7c); }
.ofccb__btn:focus-visible, .ofccb__link:focus-visible, .ofccb__cbx:focus-visible + .ofccb__sw {
  outline: 3px solid var(--ofccb-acc, #0a3b7c); outline-offset: 2px;
}

/* ---- Kleine Linkzeile ---- */
.ofccb__links { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; margin-top: 12px; font-size: 13px; }
.ofccb__link {
  background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13px;
  color: var(--ofccb-acc, #0a3b7c); text-decoration: underline; cursor: pointer;
}

/* ---- Bereiche mit Schaltern ---- */
.ofccb__cats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px; margin-top: 18px; border-top: 1px solid rgba(127,127,127,.28); padding-top: 16px;
}
/* „hidden" muss stärker sein als das display:grid von oben. */
.ofccb__cats[hidden] { display: none; }
.ofccb__cat {
  display: grid; grid-template-rows: auto auto auto; justify-items: center; gap: 6px;
  text-align: center; padding: 12px 10px; border-radius: 10px; cursor: pointer;
}
.ofccb__cat:hover { background: rgba(127,127,127,.08); }
.ofccb__cat.is-fix { cursor: default; }
.ofccb__cbx { position: absolute; opacity: 0; width: 0; height: 0; }
.ofccb__cn { font-weight: 600; font-size: 14px; order: -1; }
.ofccb__ct { font-size: 12px; line-height: 1.45; opacity: .75; }
.ofccb__sw {
  width: 52px; height: 28px; border-radius: 99px; background: #b9c2cf;
  position: relative; transition: background .18s ease; flex: none;
}
.ofccb__sw::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: transform .18s ease;
}
.ofccb__cbx:checked + .ofccb__sw { background: #2fa84f; }
.ofccb__cbx:checked + .ofccb__sw::after { transform: translateX(24px); }
.ofccb__sw.is-fix { background: #8a95a5; opacity: .7; }
.ofccb__sw.is-fix::after { transform: translateX(24px); }
.ofccb__save { grid-column: 1 / -1; display: flex; justify-content: center; margin-top: 10px; }
.ofccb__save .ofccb__btn { flex: 0 1 280px; }

/* ---- Knopf zum späteren Ändern ---- */
.ofccb__reopen {
  position: fixed; bottom: 16px; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(127,127,127,.35); background: var(--ofccb-bg, #fff); color: var(--ofccb-fg, #1a1a2e);
  font-size: 22px; line-height: 1; cursor: pointer; pointer-events: auto;
  box-shadow: 0 6px 20px rgba(6,10,20,.28); opacity: .75; transition: opacity .15s ease, transform .15s ease;
}
.ofccb__reopen:hover { opacity: 1; transform: scale(1.06); }
.ofccb__reopen--left { left: 16px; }
.ofccb__reopen--right { right: 16px; }
.ofccb.is-open .ofccb__reopen { display: none; }

/* Solange gesperrt ist, soll nichts dahinter scrollen. */
body.ofc-cookieblock { overflow: hidden; }

@media (max-width: 560px) {
  .ofccb__card { padding: 18px 16px; font-size: 14px; }
  .ofccb__title { font-size: 18px; }
  .ofccb__btn { flex: 1 1 100%; max-width: none; }
  .ofccb__cats { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ofccb__card, .ofccb__bd, .ofccb__sw, .ofccb__sw::after, .ofccb__reopen { transition: none; }
}
