/* Consent-UI im Stil von torgejaniesch.de — eigenes Theme für CookieConsent 3.1.0.
   Deckt die von der Bibliothek erzeugte Struktur (#cc-main, .cm, .pm) ab. */

#cc-main {
  --tj-blue: #1d4fd1;
  --tj-blue-hover: #163ba3;
  --tj-ink: #0f172a;
  --tj-body: #334155;
  --tj-meta: #64748b;
  --tj-line: #e2e8f0;
  --tj-soft: #f8fafc;
  position: fixed;
  z-index: 2147483647;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--tj-ink);
  line-height: 1.5;
}
#cc-main *, #cc-main *::before, #cc-main *::after { box-sizing: border-box; }
#cc-main h2 { margin: 0; }
#cc-main p { margin: 0; }
#cc-main svg { fill: none; width: 100%; }
#cc-main button { font-family: inherit; cursor: pointer; }
#cc-main a { color: var(--tj-blue); font-weight: 700; text-decoration: underline; }
#cc-main a:hover { color: var(--tj-blue-hover); }
#cc-main :focus-visible { outline: 2px solid var(--tj-blue); outline-offset: 2px; }

/* ---------- Consent-Banner (erste Ebene) ---------- */
#cc-main .cm-wrapper { position: relative; }
#cc-main .cm {
  position: fixed; bottom: 24px; left: 24px; right: auto;
  width: min(440px, calc(100vw - 48px));
  background: #fff; border: 1px solid var(--tj-line); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(12px);
}
#cc-main .cc--anim .cm { transition: opacity .25s ease, transform .25s ease, visibility .25s ease; }
.show--consent #cc-main .cc--anim .cm { opacity: 1; visibility: visible !important; transform: translateY(0); }
#cc-main .cm__body { display: flex; flex-direction: column; position: relative; }
#cc-main .cm__texts { padding: 26px 26px 0; }
#cc-main .cm__title { font-size: 17px; font-weight: 800; }
#cc-main .cm__desc { margin-top: 10px; font-size: 14px; color: var(--tj-body); max-height: 42vh; overflow-y: auto; }
#cc-main .cm__btns { padding: 20px 26px 22px; display: flex; flex-direction: column; gap: 10px; }
#cc-main .cm__btn-group { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 10px; }
#cc-main .cm__btn, #cc-main .pm__btn {
  min-height: 48px; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-align: center;
  background: var(--tj-blue); color: #fff; border: 1px solid var(--tj-blue);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
#cc-main .cm__btn:hover, #cc-main .pm__btn:hover { background: var(--tj-blue-hover); border-color: var(--tj-blue-hover); }
/* Zustimmen und Ablehnen gleichwertig: gleiche Fläche, gleiche Farbe.
   Nur "Einstellungen" ist als sekundäre Aktion gesetzt. */
#cc-main .cm__btn[data-role='show'], #cc-main .pm__btn--secondary {
  background: #fff; color: var(--tj-ink); border-color: var(--tj-line);
}
#cc-main .cm__btn[data-role='show']:hover, #cc-main .pm__btn--secondary:hover {
  background: var(--tj-soft); color: var(--tj-ink); border-color: #cbd5e1;
}
#cc-main .cm__btn--close { display: none; }
#cc-main .cm__footer { padding: 0 26px 22px; }
#cc-main .cm__links { display: flex; }
#cc-main .cm__link-group { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
#cc-main .cm__link-group a { font-weight: 600; }

/* ---------- Einstellungen (zweite Ebene) ---------- */
#cc-main .pm-wrapper { position: relative; z-index: 2; }
#cc-main .pm-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .6);
  opacity: 0; visibility: hidden;
}
#cc-main .pm {
  position: fixed; left: 24px; right: 24px; top: 50%;
  margin: 0 auto; width: auto; max-width: 640px; max-height: calc(100% - 48px);
  background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(calc(-50% + 12px));
}
#cc-main .cc--anim .pm, #cc-main .cc--anim .pm-overlay { transition: opacity .25s ease, transform .25s ease, visibility .25s ease; }
.show--preferences #cc-main .cc--anim .pm { opacity: 1; visibility: visible !important; transform: translateY(-50%); }
.show--preferences #cc-main .cc--anim .pm-overlay { opacity: 1; visibility: visible; }
#cc-main .pm__header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px; border-bottom: 1px solid var(--tj-line);
}
#cc-main .pm__title { font-size: 17px; font-weight: 800; }
#cc-main .pm__close-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--tj-line); background: #fff; color: var(--tj-meta);
  display: flex; align-items: center; justify-content: center;
}
#cc-main .pm__close-btn:hover { background: var(--tj-soft); }
#cc-main .pm__close-btn span { display: flex; width: 100%; height: 100%; }
#cc-main .pm__close-btn svg { stroke: currentColor; transform: scale(.5); }
#cc-main .pm__body { padding: 22px 26px; overflow-y: auto; flex: 1; }
#cc-main .pm__section { display: flex; flex-direction: column; border-radius: 12px; }
#cc-main .pm__section:first-child { margin-bottom: 22px; }
#cc-main .pm__section-toggles + .pm__section { margin-top: 22px; }
#cc-main .pm__section--toggle { border: 1px solid var(--tj-line); margin-bottom: 10px; overflow: hidden; }
#cc-main .pm__section-title-wrapper { position: relative; display: flex; align-items: center; }
#cc-main .pm__section--toggle .pm__section-title {
  width: 100%; min-height: 64px; display: flex; align-items: center;
  padding: 16px 96px 16px 46px; background: #fff; border: 0;
  font-size: 15px; font-weight: 700; color: var(--tj-ink); text-align: left;
}
#cc-main .pm__section--toggle .pm__section-title:hover { background: var(--tj-soft); }
#cc-main .pm__section--expandable .pm__section-arrow {
  position: absolute; left: 16px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--tj-soft); display: flex; justify-content: center; pointer-events: none;
}
#cc-main .pm__section--expandable .pm__section-arrow svg { stroke: var(--tj-meta); transform: scale(.5); }
#cc-main .pm__section--toggle.is-expanded .pm__section-arrow svg { transform: scale(.5) rotate(180deg); }
#cc-main .pm__section-desc-wrapper { display: none; flex-direction: column; border-top: 1px solid var(--tj-line); font-size: 14px; color: var(--tj-body); }
#cc-main .pm__section--toggle.is-expanded .pm__section-desc-wrapper { display: flex; }
#cc-main .pm__section:not(.pm__section--toggle) .pm__section-desc-wrapper { display: flex; border: 0; margin-top: 10px; }
#cc-main .pm__section-desc { padding: 16px; line-height: 1.6; }
#cc-main .pm__section:not(.pm__section--toggle) .pm__section-desc { padding: 0; }
#cc-main .pm__section:not(.pm__section--toggle) .pm__section-title { font-size: 15px; font-weight: 800; }
#cc-main .pm__badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 12px; padding: 2px 10px; border-radius: 999px;
  background: var(--tj-soft); color: var(--tj-meta); font-size: 12px; font-weight: 700;
}
#cc-main .pm__footer { padding: 18px 26px; border-top: 1px solid var(--tj-line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
#cc-main .pm__btn-group { display: flex; gap: 10px; flex: 1; }
#cc-main .pm__btn { flex: 1; min-width: 150px; }

/* ---------- Schalter ---------- */
#cc-main .section__toggle-wrapper { position: absolute; right: 16px; cursor: pointer; z-index: 1; }
#cc-main .section__toggle, #cc-main .section__toggle-wrapper, #cc-main .toggle__icon, #cc-main .toggle__label {
  width: 52px; height: 26px; border-radius: 999px;
}
#cc-main .section__toggle { position: absolute; top: 0; left: 0; margin: 0; border: 0; opacity: 0; cursor: pointer; }
#cc-main .section__toggle:disabled { cursor: not-allowed; }
#cc-main .toggle__icon { position: absolute; display: flex; background: #94a3b8; pointer-events: none; transition: background .2s ease; }
#cc-main .toggle__icon-circle {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s ease;
}
#cc-main .toggle__icon-off, #cc-main .toggle__icon-on { position: absolute; width: 100%; height: 100%; transition: opacity .15s ease; }
#cc-main .toggle__icon-on { opacity: 0; }
#cc-main .toggle__icon-on svg { stroke: var(--tj-blue); transform: scale(.5); }
#cc-main .toggle__icon-off svg { stroke: #94a3b8; transform: scale(.5); }
#cc-main .section__toggle:checked ~ .toggle__icon { background: var(--tj-blue); }
#cc-main .section__toggle:checked ~ .toggle__icon .toggle__icon-circle { transform: translateX(26px); }
#cc-main .section__toggle:checked ~ .toggle__icon .toggle__icon-on { opacity: 1; }
#cc-main .section__toggle:checked ~ .toggle__icon .toggle__icon-off { opacity: 0; }
#cc-main .section__toggle:disabled ~ .toggle__icon { background: #cbd5e1; }
#cc-main .section__toggle:focus-visible ~ .toggle__icon { outline: 2px solid var(--tj-blue); outline-offset: 2px; }
#cc-main .toggle__label { position: absolute; top: 0; opacity: 0; overflow: hidden; pointer-events: none; z-index: -1; }

/* ---------- Mobil ---------- */
@media screen and (max-width: 720px) {
  #cc-main .cm { left: 12px; right: 12px; bottom: 12px; width: auto; }
  #cc-main .cm__texts { padding: 22px 20px 0; }
  #cc-main .cm__btns { padding: 18px 20px 20px; }
  #cc-main .cm__btn-group { grid-auto-flow: row; }
  #cc-main .cm__footer { padding: 0 20px 20px; }
  #cc-main .pm { left: 0; right: 0; top: 0; bottom: 0; max-width: none; max-height: 100%; border-radius: 0; transform: none; }
  .show--preferences #cc-main .cc--anim .pm { transform: none; }
  #cc-main .pm__body, #cc-main .pm__footer, #cc-main .pm__header { padding: 18px 20px; }
  #cc-main .pm__footer, #cc-main .pm__btn-group { flex-direction: column; }
}
@media (prefers-reduced-motion) {
  #cc-main .cc--anim .cm, #cc-main .cc--anim .pm, #cc-main .cc--anim .pm-overlay { transition: none; }
}

/* ---------- Dienste innerhalb eines Zwecks ---------- */
#cc-main .pm__section-desc-wrapper > :not(:last-child) { border-bottom: 1px solid var(--tj-line); }
#cc-main .pm__section-services { display: flex; flex-direction: column; }
#cc-main .pm__service {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px; position: relative;
}
#cc-main .pm__service + .pm__service { border-top: 1px solid var(--tj-line); }
#cc-main .pm__service:hover { background: var(--tj-soft); }
#cc-main .pm__service-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
#cc-main .pm__service-icon {
  width: 8px; min-width: 8px; height: 8px; border: 2px solid #94a3b8; border-radius: 50%;
}
#cc-main .pm__service-title { font-size: 14px; font-weight: 600; color: var(--tj-ink); word-break: break-word; }
#cc-main .toggle-service { position: relative; right: auto; flex-shrink: 0; }
#cc-main .toggle-service,
#cc-main .toggle-service .section__toggle,
#cc-main .toggle-service .toggle__icon,
#cc-main .toggle-service .toggle__label { width: 44px; height: 22px; }
#cc-main .toggle-service .toggle__icon { position: relative; }
#cc-main .toggle-service .toggle__icon-circle { width: 18px; height: 18px; }
#cc-main .toggle-service .section__toggle:checked ~ .toggle__icon .toggle__icon-circle { transform: translateX(22px); }
