/* ===================================================
   Cookie Consent Banner – Energieteam Zimmer
   =================================================== */

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.consent-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.consent-overlay--hiding {
  opacity: 0;
  pointer-events: none;
}

/* Das eigentliche Banner */
.consent-banner {
  width: 100%;
  max-width: 760px;
  background: var(--color-surface-2, #fff);
  border: 1px solid var(--color-border, #d4d0c8);
  border-radius: var(--radius-xl, 1.5rem);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  padding: var(--space-6, 1.5rem);
  transform: translateY(24px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: var(--space-4, 1rem);
}

.consent-overlay--visible .consent-banner {
  transform: translateY(0);
}

/* Oberer Bereich: Icon + Text */
.consent-top {
  display: flex;
  gap: var(--space-4, 1rem);
  align-items: flex-start;
  margin-bottom: var(--space-5, 1.25rem);
}

.consent-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--color-secondary-light, #e8f0e6);
  border-radius: var(--radius-lg, 0.875rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary, #2d5a27);
}

.consent-title {
  font-family: var(--font-display, serif);
  font-size: var(--text-lg, 1.25rem);
  font-weight: 700;
  color: var(--color-text, #1e2318);
  margin: 0 0 var(--space-2, 0.5rem);
  line-height: 1.2;
}

.consent-desc {
  font-size: var(--text-sm, 0.9rem);
  color: var(--color-text-muted, #6b6e63);
  line-height: 1.6;
  margin: 0;
  max-width: 100%;
}

/* Einstellungen (ausgeklappt) */
.consent-details {
  border-top: 1px solid var(--color-divider, #ddd9d2);
  margin-bottom: var(--space-5, 1.25rem);
  padding-top: var(--space-4, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
}

.consent-details[hidden] { display: none; }

.consent-category {
  background: var(--color-surface-offset, #f0ede7);
  border-radius: var(--radius-md, 0.5rem);
  padding: var(--space-4, 1rem);
}

.consent-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
}

.consent-cat-header strong {
  display: block;
  font-size: var(--text-sm, 0.9rem);
  font-weight: 600;
  color: var(--color-text, #1e2318);
  margin-bottom: var(--space-1, 0.25rem);
}

.consent-cat-desc {
  display: block;
  font-size: var(--text-xs, 0.8rem);
  color: var(--color-text-muted, #6b6e63);
  line-height: 1.5;
}

/* "Immer aktiv" Badge */
.consent-badge--required {
  flex-shrink: 0;
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  background: var(--color-secondary-light, #e8f0e6);
  color: var(--color-secondary, #2d5a27);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  border-radius: var(--radius-full, 9999px);
  white-space: nowrap;
}

/* Toggle Switch */
.consent-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.consent-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border, #d4d0c8);
  border-radius: var(--radius-full, 9999px);
  transition: background 0.2s;
}

.consent-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.consent-toggle input:checked + .consent-slider {
  background: var(--color-secondary, #2d5a27);
}

.consent-toggle input:checked + .consent-slider::before {
  transform: translateX(20px);
}

.consent-toggle input:focus-visible + .consent-slider {
  outline: 2px solid var(--color-primary, #c68b00);
  outline-offset: 2px;
}

/* Aktions-Buttons */
.consent-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
  margin-bottom: var(--space-4, 1rem);
}

.consent-main-actions {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

.consent-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3, 0.75rem) var(--space-5, 1.25rem);
  font-size: var(--text-sm, 0.9rem);
  font-weight: 600;
  border-radius: var(--radius-full, 9999px);
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  font-family: var(--font-body, sans-serif);
}

.consent-btn--details {
  background: none;
  color: var(--color-text-muted, #6b6e63);
  padding-left: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 0;
}

.consent-btn--details:hover {
  color: var(--color-text, #1e2318);
}

.consent-btn--reject {
  background: var(--color-surface-offset, #f0ede7);
  color: var(--color-text, #1e2318);
  border: 1px solid var(--color-border, #d4d0c8);
}

.consent-btn--reject:hover {
  background: var(--color-surface-offset-2, #e8e4dd);
  transform: translateY(-1px);
}

.consent-btn--accept {
  background: var(--color-secondary, #2d5a27);
  color: #fff;
}

.consent-btn--accept:hover {
  background: var(--color-secondary-hover, #1e3e1a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45,90,39,0.3);
}

/* Rechtliche Links */
.consent-legal {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-faint, #b0b3a8);
  text-align: center;
  border-top: 1px solid var(--color-divider, #ddd9d2);
  padding-top: var(--space-4, 1rem);
  margin: 0;
}

.consent-legal a {
  color: var(--color-text-muted, #6b6e63);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-legal a:hover {
  color: var(--color-primary, #c68b00);
}

/* Dark Mode */
[data-theme="dark"] .consent-banner {
  background: var(--color-surface, #191c14);
  border-color: var(--color-border, #373d2b);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .consent-category {
  background: var(--color-surface-offset, #1c1f17);
}

/* Mobile */
@media (max-width: 520px) {
  .consent-overlay { padding: var(--space-3, 0.75rem); align-items: flex-end; }
  .consent-banner { border-radius: var(--radius-xl, 1.5rem) var(--radius-xl, 1.5rem) var(--radius-lg, 0.875rem) var(--radius-lg, 0.875rem); margin-bottom: 0; }
  .consent-actions { flex-direction: column; align-items: stretch; }
  .consent-main-actions { flex-direction: column; }
  .consent-btn { justify-content: center; }
  .consent-btn--details { text-align: center; }
}
