/* ======================================
   COOKIE-CONSENT (assets/js/consent.js)
   Modaler Dialog unten rechts: Bis zur Auswahl ist die Seite dahinter
   gesperrt (inert), der Fokus bleibt im Dialog. "Alle akzeptieren" und
   "Nur notwendige" sind bewusst gleich gestaltet.
   ====================================== */

.cj-consent {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1000;
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--c-bg, #fff);
  color: var(--c-text, #555);
  border-top: 4px solid var(--c-red, #D20A11);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .22);
  font-family: var(--f-sans, "Montserrat", Arial, sans-serif);
  font-size: var(--fs-small, .875rem);
  line-height: 1.55;
}

.cj-consent[hidden] { display: none; }

/* Abgedunkelter Hintergrund, solange der Dialog offen ist */
.cj-consent-offen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .35);
}
.cj-consent:focus { outline: none; }
.cj-consent:focus-visible { outline: 2px solid var(--c-red, #D20A11); outline-offset: 2px; }

.cj-consent__box { padding: 1.5rem; }

.cj-consent__title {
  margin: 0 0 .75rem;
  color: var(--c-ink, #333);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.cj-consent__text { margin: 0 0 1rem; }

.cj-consent__details {
  display: grid;
  gap: .75rem;
  margin: 0 0 1rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--c-line, #E5E5E5);
}

.cj-consent__details[hidden] { display: none; }

.cj-consent__option {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: .75rem;
  align-items: start;
  cursor: pointer;
}

.cj-consent__option input {
  width: 1.125rem;
  height: 1.125rem;
  margin: .2rem 0 0;
  accent-color: var(--c-red, #D20A11);
}

.cj-consent__option input:disabled { cursor: not-allowed; }
.cj-consent__option strong { color: var(--c-ink, #333); }

.cj-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.cj-consent__btn {
  flex: 1 1 auto;
  padding: .7rem 1.25rem;
  white-space: nowrap;
  font-family: inherit;
  font-size: var(--fs-small, .875rem);
  font-weight: 600;
  color: #fff;
  background: var(--c-red, #D20A11);
  border: 2px solid var(--c-red, #D20A11);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.cj-consent__btn:hover {
  background: var(--c-red-dark, #A50509);
  border-color: var(--c-red-dark, #A50509);
}

.cj-consent__btn--outline {
  color: var(--c-ink, #333);
  background: transparent;
  border-color: var(--c-ink, #333);
}

.cj-consent__btn--outline:hover {
  color: #fff;
  background: var(--c-ink, #333);
  border-color: var(--c-ink, #333);
}

.cj-consent__btn[hidden] { display: none; }

.cj-consent__btn:focus-visible,
.cj-consent__legal a:focus-visible {
  outline: 2px solid var(--c-ink, #333);
  outline-offset: 2px;
}

.cj-consent__legal {
  display: flex;
  gap: 1.25rem;
  margin: 1rem 0 0;
  font-size: var(--fs-xs, .75rem);
}

.cj-consent__legal a { color: var(--c-text, #555); text-decoration: underline; }
.cj-consent__legal a:hover { color: var(--c-red, #D20A11); }

/* Link "Cookie-Einstellungen" im Footer, sieht aus wie die übrigen Links */
.footer__consent {
  padding: 0;
  font: inherit;
  color: var(--c-text, #555);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.footer__consent:hover { color: var(--c-red, #D20A11); }

@media (max-width: 600px) {
  .cj-consent {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    max-height: calc(100vh - 2rem);
  }
  .cj-consent__box { padding: 1.25rem; }
  .cj-consent__btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cj-consent__btn { transition: none; }
}
