/* MPS Consent – Banner, Einstellungsdialog, Platzhalter für externe Inhalte */
/* Nur MPS-Markenfarben (Orange, Grau, Hellorange, Dunkelorange, Fast Schwarz) + Abstufungen davon */
.mps-cc,
.mps-cc-dialog,
.mps-cc-embed,
.mps-cc-fab {
  --cc-orange: var(--mps-orange, #f37032);
  --cc-orange-dark: var(--mps-orange-dark, #672f05);
  --cc-orange-light: var(--mps-orange-light, #ffb18b);
  --cc-tint: color-mix(in srgb, #ffb18b 18%, #fff);
  --cc-text: var(--mps-black, #1c1f24);
  --cc-muted: #6e7277; /* Markengrau, 4,8:1 auf Weiß */
  --cc-border: color-mix(in srgb, #6e7277 18%, #fff);
  --cc-radius: 1.25rem;
  font-family: inherit;
  color: var(--cc-text);
  line-height: 1.5;
}

/* ---------- Banner ---------- */
.mps-cc {
  position: fixed;
  z-index: 9999;
  inset: auto 1rem 1rem 1rem;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}
.mps-cc[hidden] { display: none; }

.mps-cc__card {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 30rem;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(28, 31, 36, .06), 0 24px 48px -12px rgba(28, 31, 36, .28);
  overflow: hidden;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.mps-cc__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cc-orange), var(--cc-orange-light));
}
.mps-cc.is-visible .mps-cc__card { opacity: 1; transform: none; }

.mps-cc__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }

.mps-cc__icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
  background: var(--cc-tint);
  color: var(--cc-orange-dark);
}

.mps-cc__title { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }

.mps-cc__text { margin: 0; font-size: .9rem; color: var(--cc-muted); }
.mps-cc__text a,
.mps-cc-embed__text a {
  color: var(--cc-orange-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mps-cc__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: 1.25rem;
}
.mps-cc__actions .mps-cc__link { grid-column: 1 / -1; justify-self: center; }

/* ---------- Buttons ---------- */
.mps-cc__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .625rem 1.125rem;
  border-radius: .75rem;
  border: 1.5px solid var(--cc-orange-dark);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.mps-cc__btn:active { transform: translateY(1px); }
.mps-cc__btn--primary { background: var(--cc-orange-dark); color: #fff; }
.mps-cc__btn--primary:hover { background: color-mix(in srgb, #672f05 80%, #1c1f24); border-color: color-mix(in srgb, #672f05 80%, #1c1f24); }
.mps-cc__btn--secondary { background: #fff; color: var(--cc-orange-dark); }
.mps-cc__btn--secondary:hover { background: var(--cc-tint); }

.mps-cc__link {
  appearance: none;
  background: none;
  border: 0;
  padding: .375rem .5rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--cc-orange-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: .375rem;
}
.mps-cc__link:hover { text-decoration-thickness: 2px; }

.mps-cc__btn:focus-visible,
.mps-cc__link:focus-visible,
.mps-cc-dialog__close:focus-visible,
.mps-cc-cat summary:focus-visible,
.mps-cc__text a:focus-visible {
  outline: 3px solid var(--cc-orange);
  outline-offset: 2px;
}

/* ---------- Dauerhafter Button unten links ---------- */
.mps-cc-fab {
  position: fixed;
  z-index: 9998;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 .6875rem;
  border: 1px solid var(--mps-orange-light, #ffb18b);
  border-radius: 999px;
  background: #fff;
  color: var(--mps-orange-dark, #672f05);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 6px 20px -6px rgba(28, 31, 36, .35);
  cursor: pointer;
  transition: box-shadow .2s, background-color .2s;
  animation: mps-cc-pop .3s cubic-bezier(.2, .8, .2, 1);
}
.mps-cc-fab[hidden] { display: none; }
.mps-cc-fab { --fab-bg: #fff; }
.mps-cc-fab:hover, .mps-cc-fab:focus-visible { --fab-bg: color-mix(in srgb, #ffb18b 18%, #fff); }

/* Keks mit Biss und Krümeln */
.mps-cc-fab__cookie { position: relative; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; }
.mps-cc-fab__cookie svg { display: block; overflow: visible; transform-origin: 50% 60%; }
.mps-cc-fab__bite { fill: var(--fab-bg); transform: scale(0); transform-origin: 4.6px 18.6px; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), fill .2s; }
.mps-cc-fab__crumb {
  position: absolute;
  left: 4px;
  top: 16px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
}
.mps-cc-fab__crumb:nth-child(3) { width: 2.5px; height: 2.5px; }
.mps-cc-fab__crumb:nth-child(5) { width: 4px; height: 3px; border-radius: 1.5px; }

.mps-cc-fab:hover .mps-cc-fab__cookie svg { animation: mps-cc-nibble .45s ease-in-out; }
.mps-cc-fab:hover .mps-cc-fab__bite { transform: scale(1); transition-delay: .12s; }
.mps-cc-fab:hover .mps-cc-fab__crumb { animation: mps-cc-crumb .9s cubic-bezier(.4, 0, .9, .6) .15s forwards; }
.mps-cc-fab:hover .mps-cc-fab__crumb:nth-child(2) { --dx: -9px; --dy: 12px; --rot: 140deg; }
.mps-cc-fab:hover .mps-cc-fab__crumb:nth-child(3) { --dx: 3px; --dy: 15px; --rot: -90deg; animation-delay: .22s; }
.mps-cc-fab:hover .mps-cc-fab__crumb:nth-child(4) { --dx: -15px; --dy: 9px; --rot: 220deg; animation-delay: .19s; }
.mps-cc-fab:hover .mps-cc-fab__crumb:nth-child(5) { --dx: -4px; --dy: 17px; --rot: 60deg; animation-delay: .28s; }
.mps-cc-fab:hover .mps-cc-fab__crumb:nth-child(6) { --dx: 8px; --dy: 11px; --rot: -160deg; animation-delay: .25s; }

@keyframes mps-cc-nibble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg) scale(1.08); }
  55% { transform: rotate(9deg); }
  80% { transform: rotate(-4deg); }
}
@keyframes mps-cc-crumb {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 20px)) rotate(var(--rot, 90deg)); }
}
.mps-cc-fab__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .3s cubic-bezier(.2, .8, .2, 1), opacity .2s, margin .3s;
}
.mps-cc-fab:hover,
.mps-cc-fab:focus-visible { background: color-mix(in srgb, #ffb18b 18%, #fff); box-shadow: 0 10px 28px -8px rgba(28, 31, 36, .45); }
.mps-cc-fab:hover .mps-cc-fab__label,
.mps-cc-fab:focus-visible .mps-cc-fab__label { max-width: 12rem; opacity: 1; margin: 0 .25rem 0 .5rem; }
.mps-cc-fab:focus-visible { outline: 3px solid var(--mps-orange, #f37032); outline-offset: 2px; }

/* ---------- Dialog ---------- */
.mps-cc-dialog {
  /* Tailwind-Preflight setzt margin:0 → Zentrierung explizit */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(36rem, calc(100% - 2rem));
  max-height: min(48rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--cc-radius);
  background: #fff;
  box-shadow: 0 32px 64px -16px rgba(28, 31, 36, .4);
  overflow: hidden;
}
.mps-cc-dialog[open] { display: flex; animation: mps-cc-pop .25s cubic-bezier(.2, .8, .2, 1); }
.mps-cc-dialog::backdrop { background: rgba(28, 31, 36, .55); backdrop-filter: blur(3px); }

.mps-cc-dialog__inner { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0; }

.mps-cc-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--cc-border);
}
.mps-cc-dialog__eyebrow {
  margin: 0 0 .25rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--cc-orange-dark);
}
.mps-cc-dialog__title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }

.mps-cc-dialog__close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, #6e7277 8%, #fff);
  color: var(--cc-text);
  cursor: pointer;
}
.mps-cc-dialog__close:hover { background: var(--cc-tint); color: var(--cc-orange-dark); }

.mps-cc-dialog__body { padding: .5rem 1.5rem; overflow-y: auto; overscroll-behavior: contain; }

.mps-cc-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--cc-border);
  background: color-mix(in srgb, #6e7277 4%, #fff);
}

/* Kategorien */
.mps-cc-cat { padding: 1rem 0; }
.mps-cc-cat + .mps-cc-cat { border-top: 1px solid var(--cc-border); }
.mps-cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mps-cc-cat__label { font-weight: 700; cursor: pointer; }
.mps-cc-cat__always {
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .625rem;
  border-radius: 999px;
  background: var(--cc-tint);
  color: var(--cc-orange-dark);
}
.mps-cc-cat__text { margin: .375rem 0 0; font-size: .875rem; color: var(--cc-muted); }
.mps-cc-cat__details { margin-top: .5rem; font-size: .8125rem; }
.mps-cc-cat summary {
  display: inline-block;
  cursor: pointer;
  font-weight: 600;
  color: var(--cc-orange-dark);
  border-radius: .25rem;
}
.mps-cc-cat summary::-webkit-details-marker { display: none; }
.mps-cc-cat summary::after { content: " ▾"; }
.mps-cc-cat details[open] summary::after { content: " ▴"; }
.mps-cc-cat ul { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .25rem; }
.mps-cc-cat li {
  padding: .375rem .625rem;
  border-radius: .5rem;
  background: color-mix(in srgb, #6e7277 6%, #fff);
  color: var(--cc-text);
}

/* Schalter */
.mps-cc-switch { position: relative; flex: none; display: inline-flex; }
.mps-cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.mps-cc-switch__track {
  display: inline-flex;
  align-items: center;
  width: 3rem;
  height: 1.75rem;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, #6e7277 75%, #fff);
  transition: background-color .2s;
}
.mps-cc-switch__thumb {
  width: calc(1.75rem - 6px);
  height: calc(1.75rem - 6px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 31, 36, .25);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.mps-cc-switch input:checked + .mps-cc-switch__track { background: var(--cc-orange-dark); }
.mps-cc-switch input:checked + .mps-cc-switch__track .mps-cc-switch__thumb { transform: translateX(1.25rem); }
.mps-cc-switch input:focus-visible + .mps-cc-switch__track { outline: 3px solid var(--cc-orange); outline-offset: 2px; }

/* ---------- Platzhalter für Iframes ---------- */
.mps-cc-embed {
  display: grid;
  place-items: center;
  min-height: 16rem;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  border: 1px dashed var(--cc-orange-light);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 177, 139, .25), transparent 60%),
    var(--cc-tint);
  text-align: center;
}
.mps-cc-embed__inner { max-width: 26rem; display: grid; justify-items: center; gap: .5rem; }
.mps-cc-embed .mps-cc__icon { background: #fff; }
.mps-cc-embed__title { margin: .25rem 0 0; font-weight: 700; font-size: 1.05rem; }
.mps-cc-embed__text { margin: 0; font-size: .875rem; color: var(--cc-muted); }
.mps-cc-embed__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin-top: .5rem; }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .mps-cc { inset: auto 0 0 0; }
  .mps-cc__card {
    max-width: none;
    border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    border-bottom: 0;
    padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom));
  }
  .mps-cc__actions { grid-template-columns: 1fr; }
  .mps-cc-dialog { width: 100%; max-width: none; max-height: calc(100% - 1.5rem); margin: auto 0 0; border-radius: var(--cc-radius) var(--cc-radius) 0 0; }
  .mps-cc-dialog__footer { flex-direction: column-reverse; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
  .mps-cc-dialog__footer .mps-cc__btn { width: 100%; }
}

@keyframes mps-cc-pop {
  from { opacity: 0; transform: translateY(.75rem) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mps-cc__card, .mps-cc-switch__thumb, .mps-cc-switch__track { transition: none; }
  .mps-cc-dialog[open], .mps-cc-fab { animation: none; }
  .mps-cc-fab__label, .mps-cc-fab__bite { transition: none; }
  .mps-cc-fab:hover .mps-cc-fab__cookie svg, .mps-cc-fab:hover .mps-cc-fab__crumb { animation: none; }
}

@media print {
  .mps-cc, .mps-cc-dialog, .mps-cc-fab { display: none !important; }
}
