/* Einwilligungs-Banner als Baum-Etikett: helles Papier, abgeschrägte Ecken, Öse */
.cp-consent {
  --cp-paper: #f3eee2;
  --cp-ink: #101d16;
  --cp-ink-soft: #3f4c43;
  --cp-gold: #a8873f;
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 3000;
  width: min(470px, calc(100vw - 48px));
  filter: drop-shadow(0 20px 44px rgba(0, 0, 0, .55));
  animation: cp-consent-in .55s cubic-bezier(.2, .6, .2, 1) both;
}

@keyframes cp-consent-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.cp-consent-tag {
  position: relative;
  box-sizing: border-box;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 58px 30px 24px;
  background: var(--cp-paper);
  color: var(--cp-ink);
  font-family: Outfit, sans-serif;
  border-radius: 0 0 6px 6px;
  clip-path: polygon(26px 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%, 0 26px);
  -webkit-mask: radial-gradient(circle 7px at 50% 26px, transparent 6.5px, #000 7px);
  mask: radial-gradient(circle 7px at 50% 26px, transparent 6.5px, #000 7px);
}

/* Öse um das Loch */
.cp-consent-tag::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  box-sizing: border-box;
  border: 2px solid var(--cp-gold);
  border-radius: 50%;
  pointer-events: none;
}

.cp-consent-title {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: var(--cp-ink);
  outline: none;
}

.cp-consent-text {
  margin: 0 0 18px;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--cp-ink-soft);
}

.cp-consent-text a {
  color: var(--cp-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cp-consent-details {
  margin: 0 0 18px;
  border-top: 1px solid rgba(16, 29, 22, .16);
}

.cp-consent-details[hidden],
.cp-consent-save[hidden],
.cp-consent-more[hidden] {
  display: none;
}

.cp-consent .cp-consent-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 10px 0;
  font-weight: 400;
  border-bottom: 1px solid rgba(16, 29, 22, .16);
  font-size: .86rem;
  line-height: 1.4;
  color: var(--cp-ink-soft);
  cursor: pointer;
}

.cp-consent-opt input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--cp-ink);
}

.cp-consent-opt strong {
  display: block;
  color: var(--cp-ink);
  font-weight: 500;
}

.cp-consent-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Zustimmen und Ablehnen: gleiche Größe, gleiche Farbe, gleicher Kontrast */
.cp-consent .cp-consent-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 9px 18px;
  font: inherit;
  text-align: left;
  color: var(--cp-paper);
  background: var(--cp-ink);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.cp-consent-btn:hover {
  background: #1f3327;
}

.cp-consent-btn-t {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.cp-consent-btn-s {
  font-size: .8rem;
  line-height: 1.3;
  color: #c7d2c8;
}

.cp-consent .cp-consent-save {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  color: var(--cp-ink);
  background: transparent;
  border: 1.5px solid var(--cp-ink);
  border-radius: 10px;
  cursor: pointer;
}

.cp-consent-save:hover {
  background: rgba(16, 29, 22, .07);
}

.cp-consent-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  margin: 12px 0 0;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--cp-ink-soft);
}

.cp-consent .cp-consent-more {
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: .86rem;
  color: var(--cp-ink);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cp-consent-btn:focus-visible,
.cp-consent-save:focus-visible,
.cp-consent-more:focus-visible,
.cp-consent-text a:focus-visible,
.cp-consent-opt input:focus-visible {
  outline: 2px solid var(--cp-gold);
  outline-offset: 3px;
}

.cp-consent-open {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.cp-consent-open:focus-visible {
  outline: 2px solid #dfc998;
  outline-offset: 3px;
}

/* Handy: Etikett als Bottom-Sheet über die volle Breite */
@media (max-width: 600px) {
  .cp-consent {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
  }

  .cp-consent-tag {
    max-height: 94vh;
    max-height: 94dvh;
    padding: 48px 20px calc(16px + env(safe-area-inset-bottom));
    border-radius: 0;
    clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%, 0 22px);
    -webkit-mask: radial-gradient(circle 7px at 50% 24px, transparent 6.5px, #000 7px);
    mask: radial-gradient(circle 7px at 50% 24px, transparent 6.5px, #000 7px);
  }

  .cp-consent-tag::before {
    top: 13px;
  }

  .cp-consent-title {
    font-size: 1.32rem;
  }

  .cp-consent-text {
    margin-bottom: 16px;
    font-size: .86rem;
  }

}

/* Kleine Handys: beide Schaltflächen sollen ohne Scrollen sichtbar bleiben */
@media (max-width: 600px) and (max-height: 640px) {
  .cp-consent-title {
    margin-bottom: 8px;
    font-size: 1.18rem;
  }

  .cp-consent-text {
    margin-bottom: 12px;
    font-size: .8rem;
    line-height: 1.45;
  }

  .cp-consent .cp-consent-btn {
    min-height: 52px;
  }

  .cp-consent-foot {
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cp-consent {
    animation: none;
  }
}
