/* =====================================================
   COOKIE BANNER – DSGVO-konform
   Ergänzung zu assets/css/style.css
   ===================================================== */

/* ── Overlay ───────────────────────────────────────── */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 18, 29, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#cookie-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Banner ────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--navy-dark);
  border-top: 1px solid rgba(4, 181, 214, 0.2);
  padding: 28px 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.4);
}

#cookie-banner.visible {
  transform: translateY(0);
}

.cookie-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Banner Simple View (Standard) ────────────────── */
.cookie-simple {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.cookie-text h3 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-text h3 svg {
  width: 18px;
  height: 18px;
  color: var(--cyan);
  flex-shrink: 0;
}

.cookie-text p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 640px;
}

.cookie-text p a {
  color: var(--cyan);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-cookie-all {
  background: var(--cyan);
  color: var(--navy-dark);
  border: none;
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-cookie-all:hover {
  background: var(--cyan-dark);
  transform: translateY(-1px);
}

.btn-cookie-essential {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 11px 18px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-cookie-essential:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--white);
}

.btn-cookie-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-cookie-settings:hover {
  color: var(--white);
}

/* ── Detail View (Einstellungen) ───────────────────── */
.cookie-detail {
  display: none;
}

.cookie-detail.visible {
  display: block;
}

.cookie-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cookie-detail-header h3 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
}

.btn-cookie-back {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.btn-cookie-back:hover { color: var(--cyan); }

.cookie-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.cookie-category {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--transition);
}

.cookie-category:has(.cookie-toggle:checked) {
  border-color: rgba(4, 181, 214, 0.25);
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-info strong {
  display: block;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.cookie-category-info p {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-category-info .cookie-services {
  color: rgba(4, 181, 214, 0.6);
  font-size: 0.7rem;
  margin-top: 4px;
}

/* Toggle Switch */
.cookie-toggle-wrap {
  flex-shrink: 0;
  padding-top: 2px;
}

.cookie-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.cookie-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: left var(--transition), background var(--transition);
}

.cookie-toggle:checked {
  background: var(--cyan);
}

.cookie-toggle:checked::after {
  left: 21px;
  background: var(--navy-dark);
}

.cookie-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-toggle:disabled::after {
  background: rgba(255, 255, 255, 0.7);
}

.cookie-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-detail-footer p {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
}

.cookie-detail-footer p a {
  color: rgba(4, 181, 214, 0.6);
  text-decoration: underline;
}

.cookie-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Cookie-Settings Re-Open Button (persistent) ───── */
#cookie-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9000;
  background: var(--navy);
  border: 1px solid rgba(4, 181, 214, 0.25);
  border-radius: var(--radius);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}

#cookie-reopen.visible {
  opacity: 1;
  pointer-events: auto;
}

#cookie-reopen:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

#cookie-reopen svg {
  width: 13px;
  height: 13px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .cookie-simple {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cookie-actions {
    flex-wrap: wrap;
  }

  .btn-cookie-all,
  .btn-cookie-essential {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  #cookie-banner { padding: 20px 0; }

  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-cookie-all,
  .btn-cookie-essential,
  .btn-cookie-settings {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .cookie-categories {
    grid-template-columns: 1fr;
  }

  .cookie-detail-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-detail-actions {
    width: 100%;
  }

  .cookie-detail-actions .btn-cookie-all,
  .cookie-detail-actions .btn-cookie-essential {
    flex: 1;
  }
}
