/* ===================================================================
   Cookie-Consent-Widget -- OPRO #1701. Selbst gehostet, kein Drittanbieter.
   Bewusst KEIN Vollbild-Overlay auf der Bannerebene: der Hintergrund bleibt
   bedienbar, solange nur der Banner steht (Kriterium 9). Der Backdrop
   erscheint ausschliesslich, wenn die Einstellungs-Ebene offen ist.
   =================================================================== */
.cac-consent {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.cac-consent[hidden] {
  display: none;
}

.cac-consent__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cac-consent.is-panel-open .cac-consent__backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Ebene 1: Banner ---- */
.cac-consent__banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  background: var(--cac-white, #fff);
  border-top: 3px solid var(--cac-red, #c0392b);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
  padding: 20px clamp(16px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}
.cac-consent__banner[hidden] {
  display: none;
}

.cac-consent__text {
  flex: 1 1 320px;
  min-width: 0;
}
.cac-consent__title {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--cac-dark, #1a1a1a);
  font-size: 1rem;
}
.cac-consent__desc {
  margin: 0;
  color: var(--cac-gray-700, #555);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cac-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

/* Annehmen und Ablehnen sind bewusst gleich dimensioniert (Kriterium 3):
   gleiches Padding, gleiche Schriftgroesse, kein Groessenunterschied durch
   Farbe/Gewicht. */
.cac-consent__btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.cac-consent__btn--solid {
  background: var(--cac-red, #c0392b);
  border-color: var(--cac-red, #c0392b);
  color: var(--cac-white, #fff);
}
.cac-consent__btn--solid:hover {
  background: var(--cac-red-dark, #a93226);
  border-color: var(--cac-red-dark, #a93226);
}
.cac-consent__btn--outline {
  background: var(--cac-white, #fff);
  border-color: var(--cac-dark, #1a1a1a);
  color: var(--cac-dark, #1a1a1a);
}
.cac-consent__btn--outline:hover {
  background: var(--cac-gray-100, #f5f5f5);
}
.cac-consent__btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--cac-gray-700, #555);
  text-decoration: underline;
  padding-left: 8px;
  padding-right: 8px;
}

/* ---- Ebene 2: Einstellungen-Panel ---- */
.cac-consent__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--cac-white, #fff);
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}
.cac-consent__panel[hidden] {
  display: none;
}

.cac-consent__panel-inner {
  position: relative;
  padding: 32px 28px 24px;
}

.cac-consent__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--cac-gray-500, #888);
}

.cac-consent__panel-inner h2 {
  margin: 0 0 20px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.3rem;
  color: var(--cac-dark, #1a1a1a);
}

.cac-consent__category {
  border-top: 1px solid var(--cac-gray-300, #d5d5d5);
  padding: 14px 0;
}
.cac-consent__category:first-of-type {
  border-top: none;
}
.cac-consent__cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--cac-dark, #1a1a1a);
  cursor: default;
}
.cac-consent__cat-head input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.cac-consent__category p {
  margin: 6px 0 0 28px;
  font-size: 0.85rem;
  color: var(--cac-gray-700, #555);
  line-height: 1.4;
}

.cac-consent__panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Fuegt sich neben die <a>-Links in .cac-footer__legal-links ein (style.css
   Zeile ~1165) -- gleiche Farbe/Groesse, nur als <button>, weil es kein Ziel
   aufruft, sondern das Panel oeffnet. */
.cac-footer__cookie-settings-btn {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--cac-gray-400, #999);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}
.cac-footer__cookie-settings-btn:hover {
  color: var(--cac-white, #fff);
}

@media (max-width: 480px) {
  .cac-consent__banner {
    flex-direction: column;
    align-items: stretch;
  }
  .cac-consent__actions {
    justify-content: stretch;
  }
  .cac-consent__actions .cac-consent__btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .cac-consent__actions .cac-consent__btn--ghost {
    flex-basis: 100%;
    text-align: center;
    order: -1;
  }
}
