/* ==========================================================================
   heygregor – Cookie-Einwilligung
   Nutzt die Tokens aus tokens.css (Fallbacks, falls sie fehlen).
   ========================================================================== */

.hg-consent {
  --cc-bg: var(--surface, #101310);
  --cc-ink: var(--brand-white, #ffffff);
  --cc-muted: var(--text-muted, #a3a8a3);
  --cc-line: var(--border, #2a2e2a);
  --cc-line-strong: var(--border-strong, #6b706b);
  --cc-lime: var(--brand-lime, #b7ff00);
  --cc-lime-hover: var(--accent-hover, #c9ff40);
  --cc-dark: var(--brand-near-black, #0a0b0a);
  --cc-radius: var(--radius-lg, 16px);
  --cc-ease: cubic-bezier(.2, .8, .2, 1);

  position: fixed;
  z-index: 2147483000;
  left: 24px;
  bottom: 24px;
  width: min(460px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 28px;
  background: var(--cc-bg);
  color: var(--cc-ink);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), 0 0 0 1px rgba(183, 255, 0, .04);
  font: var(--text-body-sm, 400 15px/1.55 Roboto, Arial, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-base, 320ms) var(--cc-ease),
              transform var(--duration-base, 320ms) var(--cc-ease);
}
.hg-consent *, .hg-consent *::before, .hg-consent *::after { box-sizing: border-box; }
.hg-consent[hidden],
.hg-consent [hidden] { display: none !important; }
.hg-consent.is-visible { opacity: 1; transform: none; }
.hg-consent:focus { outline: none; }

/* Kopf mit Lime-Cookie */
.hg-consent__head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.hg-consent__icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--radius-full, 999px);
  background: rgba(183, 255, 0, .08);
  border: 1px solid rgba(183, 255, 0, .25);
}
.hg-consent__icon svg { width: 30px; height: 30px; display: block; }
.hg-consent.is-visible .hg-consent__icon svg { animation: hg-cookie-in 700ms var(--cc-ease) 120ms both; }
@keyframes hg-cookie-in { from { transform: rotate(-35deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.hg-consent__kicker {
  display: block;
  margin: 0 0 4px;
  font: var(--text-kicker, 600 14px/1.2 "Roboto Condensed", "Arial Narrow", Arial, sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cc-lime);
}
.hg-consent__title {
  margin: 0;
  font: 700 26px/1 var(--font-display, "Roboto Condensed", "Arial Narrow", Arial, sans-serif);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--cc-ink);
}
.hg-consent__text { margin: 0 0 20px; color: var(--cc-muted); }
.hg-consent__text a,
.hg-consent__links a {
  color: var(--cc-ink);
  text-decoration: underline;
  text-decoration-color: var(--cc-lime);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.hg-consent__text a:hover,
.hg-consent__links a:hover { color: var(--cc-lime); }

.hg-consent__sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Kategorien */
.hg-consent__prefs { margin: 0 0 20px; padding: 0; border: 0; }
.hg-consent__prefs[hidden] { display: none; }
.hg-consent__cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--cc-line);
}
.hg-consent__cat:last-child { border-bottom: 1px solid var(--cc-line); }
.hg-consent__cat-name {
  font: 600 16px/1.2 var(--font-display, "Roboto Condensed", "Arial Narrow", Arial, sans-serif);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cc-ink);
}
.hg-consent__cat-desc { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.5; color: var(--cc-muted); }

/* Schalter */
.hg-switch { position: relative; display: inline-flex; width: 52px; height: 30px; cursor: pointer; }
.hg-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.hg-switch__track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--cc-dark);
  border: 1px solid var(--cc-line-strong);
  transition: background var(--duration-fast, 180ms), border-color var(--duration-fast, 180ms);
}
.hg-switch__track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--cc-muted);
  transition: transform var(--duration-fast, 180ms) var(--cc-ease), background var(--duration-fast, 180ms);
}
.hg-switch input:checked + .hg-switch__track { background: var(--cc-lime); border-color: var(--cc-lime); }
.hg-switch input:checked + .hg-switch__track::after { transform: translateX(22px); background: var(--cc-dark); }
.hg-switch input:disabled { cursor: not-allowed; }
.hg-switch input:disabled + .hg-switch__track { opacity: .55; }
.hg-switch input:focus-visible + .hg-switch__track { outline: 2px solid var(--cc-lime); outline-offset: 3px; }

/* Buttons – beide gleich groß, Ablehnen ist genauso leicht wie Annehmen */
.hg-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hg-consent__btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-min, 44px);
  padding: 0 16px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid transparent;
  font: var(--text-button, 700 15px/1 "Roboto Condensed", "Arial Narrow", Arial, sans-serif);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast, 180ms), color var(--duration-fast, 180ms),
              border-color var(--duration-fast, 180ms), transform var(--duration-fast, 180ms);
}
.hg-consent__btn:active { transform: scale(.98); }
.hg-consent__btn:focus-visible { outline: 2px solid var(--cc-lime); outline-offset: 3px; }
.hg-consent__btn--primary { background: var(--cc-lime); color: var(--cc-dark); }
.hg-consent__btn--primary:hover { background: var(--cc-lime-hover); }
.hg-consent__btn--ghost { background: transparent; color: var(--cc-ink); border-color: var(--cc-line-strong); }
.hg-consent__btn--ghost:hover { border-color: var(--cc-ink); }
.hg-consent__btn--wide { grid-column: 1 / -1; }

.hg-consent__links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin: 16px 0 0;
  font: var(--text-label, 500 13px/1.3 Roboto, Arial, system-ui, sans-serif);
  color: var(--cc-muted);
}
.hg-consent__toggle {
  appearance: none; background: none; border: 0; padding: 4px 0; margin: 0;
  font: inherit; color: var(--cc-ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--cc-lime); text-underline-offset: 3px;
}
.hg-consent__toggle:hover { color: var(--cc-lime); }
.hg-consent__toggle:focus-visible { outline: 2px solid var(--cc-lime); outline-offset: 2px; border-radius: 2px; }
.hg-consent__legal { display: flex; gap: 14px; }

/* Handy: Bottom-Sheet über die volle Breite */
@media (max-width: 560px) {
  .hg-consent {
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .hg-consent__title { font-size: 22px; }
  .hg-consent__icon { width: 42px; height: 42px; }
  .hg-consent__icon svg { width: 26px; height: 26px; }
  .hg-consent__text { font-size: 14px; margin-bottom: 16px; }
  .hg-consent__btn { min-height: 48px; font-size: 14px; padding: 0 10px; }
}
@media (max-width: 340px) {
  .hg-consent__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hg-consent { transition: none; transform: none; }
  .hg-consent.is-visible .hg-consent__icon svg { animation: none; }
}
@media print { .hg-consent { display: none !important; } }

/* Footer-Link „Cookie-Einstellungen“ – sieht aus wie die anderen Footer-Links */
.hg-consent-link {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: 400 17px/1.5 var(--font-sans, Roboto, Arial, system-ui, sans-serif);
  color: var(--text, #ffffff); text-align: left; cursor: pointer;
  transition: color var(--duration-fast, 180ms) ease-out;
}
.hg-consent-link:hover { color: var(--brand-lime, #b7ff00); }
.hg-consent-link:focus-visible { outline: 2px solid var(--brand-lime, #b7ff00); outline-offset: 3px; border-radius: 2px; }
