/* ==========================================================================
   BacklinkHub – Cookie Consent (Bottom Banner mit Overlay)
   ========================================================================== */

.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: flex-end;
  padding: 0 1rem 1rem;
  pointer-events: none;
  font-size: 14px;

  /* Wichtig für Mobile: Inhalt darf scrollen */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cookie-consent--visible {
  display: flex;
  pointer-events: auto;
}

/* Backdrop (verpixelte / geblurter Hintergrund) */

.cookie-consent__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 3px 3px,
    rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px) saturate(115%);
}

/* Card (Banner) */

.cookie-consent__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  border-radius: 18px;
  padding: 1.3rem 1.6rem 1.4rem;
  background: var(--popover, #0f1118f5);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
  color: var(--fg, #f5f7ff);

  /* Höhe des Banners begrenzen – hier kannst du ihn "größer" machen */
  max-height: 95vh; /* z.B. 95vh */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* Für iPhones mit Notch */
  margin-bottom: env(safe-area-inset-bottom, 0);
}

/* Header */

.cookie-consent__header {
  margin-bottom: 1.1rem;
}

.cookie-consent__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(24, 172, 78, 0.12);
  color: var(--brand, #18AC4E);
  margin-bottom: 0.55rem;
}

.cookie-consent__header h2 {
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cookie-consent__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(24, 172, 78, 0.18);
  font-size: 0.95rem;
}

/* Body Layout */

.cookie-consent__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: 1.4rem;
}

.cookie-consent__column--text {
  font-size: 0.88rem;
  color: var(--fg-soft, #c9d0e1);
}

.cookie-consent__lead {
  font-size: 0.9rem;
  color: var(--fg-soft, #c9d0e1);
  margin: 0 0 0.7rem;
  max-width: 52rem;
}

.cookie-consent__list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.8rem;
}

.cookie-consent__list li {
  margin-bottom: 0.3rem;
}

.cookie-consent__hint {
  font-size: 0.78rem;
  margin: 0.3rem 0 0.15rem;
}

.cookie-consent__hint a {
  color: var(--brand, #18AC4E);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Scroll-Box für Lead + Liste */

.cookie-consent__scroll {
  position: relative;
}

/* Controls */

.cookie-consent__group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.cookie-consent__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-consent__row-text {
  flex: 1;
}

.cookie-consent__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
}

.cookie-consent__label-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted, #7b8194);
}

/* Switch */

.cookie-consent__switch {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.25));
  background: rgba(9, 11, 18, 0.9);
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.cookie-consent__switch input {
  display: none;
}

.cookie-consent__switch-knob {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #666c80;
  transform: translateX(0);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cookie-consent__switch input:checked + .cookie-consent__switch-knob {
  transform: translateX(20px);
  background: var(--brand, #18AC4E);
  box-shadow: 0 0 0 4px rgba(24, 172, 78, 0.28);
}

/* Locked Switch (Essentiell) */

.cookie-consent__switch--locked {
  cursor: default;
  opacity: 0.78;
  justify-content: flex-start;
}

.cookie-consent__switch--locked .cookie-consent__switch-knob {
  transform: translateX(20px);
  background: var(--brand, #18AC4E);
}

/* Buttons */

.cookie-consent__buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.cookie-consent__btn {
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-size: 0.83rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

/* Primary Button – ohne Glow, Schrift weiß */
.cookie-consent__btn--primary {
  background: var(--brand, #18AC4E);
  color: #ffffff;
  box-shadow: none;
}

.cookie-consent__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: none;
  filter: brightness(1.05);
}

.cookie-consent__btn--outline {
  background: transparent;
  color: var(--fg, #f5f7ff);
  border-color: rgba(255, 255, 255, 0.22);
}

.cookie-consent__btn--outline:hover {
  border-color: var(--brand, #18AC4E);
}

.cookie-consent__btn--ghost {
  background: rgba(8, 11, 18, 0.94);
  color: var(--fg-soft, #c9d0e1);
  border-color: rgba(255, 255, 255, 0.12);
}

.cookie-consent__btn--ghost:hover {
  background: rgba(12, 16, 26, 0.98);
}

/* Details Toggle */

.cookie-consent__details-toggle {
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted, #7b8194);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Details Bereich */

.cookie-consent__details {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--fg-soft, #c9d0e1);
}

.cookie-consent__details h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.cookie-consent__details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.cookie-consent__details h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  color: var(--muted, #7b8194);
}

.cookie-consent__details ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.cookie-consent__details li {
  margin-bottom: 0.25rem;
}

/* Responsive */

@media (max-width: 900px) {
  .cookie-consent__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .cookie-consent__details-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .cookie-consent {
    /* etwas kompakter + Safe Area */
    padding: 0.75rem 0.75rem calc(env(safe-area-inset-bottom, 0) + 0.75rem);
  }

  .cookie-consent__card {
    padding: 1rem 1.1rem 1.2rem;
    max-width: 100%;
  }

  .cookie-consent__header {
    margin-bottom: 0.7rem;
  }

  .cookie-consent__lead {
    font-size: 0.86rem;
  }

  .cookie-consent__group {
    gap: 0.5rem;
    margin-bottom: 0.7rem;
  }

  .cookie-consent__buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 🔥 Smartphone: Scrollfenster für Lead + Liste,
     oben 3–4 Zeilen normal, Rest per Scroll + Fade */
  .cookie-consent__scroll {
    max-height: 6.5rem;           /* Hier kannst du einstellen, wie viel Text ohne Scroll sichtbar ist */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.3rem;
  }

  .cookie-consent__scroll::after {
    content: "";
    position: sticky;
    bottom: 0;
    display: block;
    height: 2rem;
    margin-top: -2rem;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      rgba(15, 17, 24, 0),
      rgba(5, 7, 14, 0.98)
    );
  }
}
