/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

/* Overlay */
.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.consent-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Banner */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-surface, #ffffff);
  border-top: 1px solid var(--color-border, #d4d8df);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  padding: var(--space-6, 1.5rem) var(--space-6, 1.5rem);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.consent-banner.visible {
  transform: translateY(0);
}

[data-theme="dark"] .consent-banner {
  background: var(--color-surface, #1a1f26);
  border-top-color: var(--color-border, #2a313a);
}

.consent-inner {
  max-width: var(--content-wide, 1200px);
  margin: 0 auto;
}

/* Header row */
.consent-header {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  margin-bottom: var(--space-4, 1rem);
}

.consent-header svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary, #00856a);
  flex-shrink: 0;
}

.consent-header h3 {
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-base, 1rem);
  font-weight: 700;
  color: var(--color-text, #1a1d23);
  margin: 0;
}

/* Description */
.consent-description {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #5a6270);
  line-height: 1.6;
  margin-bottom: var(--space-5, 1.25rem);
  max-width: 72ch;
}
.consent-description a {
  color: var(--color-primary, #00856a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Toggle categories */
.consent-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4, 1rem);
  margin-bottom: var(--space-6, 1.5rem);
}

.consent-category {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  background: var(--color-bg, #f5f7fa);
  border: 1px solid var(--color-divider, #e2e6eb);
  border-radius: var(--radius-lg, 0.75rem);
  min-width: 200px;
  flex: 1;
  max-width: 320px;
  transition: border-color 0.18s ease;
}
.consent-category:has(input:checked) {
  border-color: var(--color-primary, #00856a);
}

[data-theme="dark"] .consent-category {
  background: var(--color-surface-2, #222830);
  border-color: var(--color-border, #2a313a);
}

.consent-category-info {
  flex: 1;
}
.consent-category-name {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text, #1a1d23);
  display: block;
  margin-bottom: 2px;
}
.consent-category-desc {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #5a6270);
  line-height: 1.4;
}

/* Toggle switch */
.consent-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.consent-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-text-faint, #9aa1ad);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.consent-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.consent-toggle input:checked + .consent-toggle-slider {
  background: var(--color-primary, #00856a);
}
.consent-toggle input:checked + .consent-toggle-slider::before {
  transform: translateX(20px);
}
.consent-toggle input:disabled + .consent-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Required badge */
.consent-required {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint, #9aa1ad);
  background: var(--color-surface, #ffffff);
  padding: 2px 6px;
  border-radius: 4px;
}

[data-theme="dark"] .consent-required {
  background: var(--color-surface-offset, #2a313a);
}

/* Action buttons */
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 0.75rem);
  align-items: center;
}

.consent-btn {
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  padding: var(--space-3, 0.75rem) var(--space-6, 1.5rem);
  border-radius: var(--radius-md, 0.5rem);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1;
}

.consent-btn-accept {
  background: var(--color-primary, #00856a);
  color: #ffffff;
  border-color: var(--color-primary, #00856a);
}
.consent-btn-accept:hover {
  background: var(--color-primary-hover, #006d57);
  border-color: var(--color-primary-hover, #006d57);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 133, 106, 0.3);
}

.consent-btn-save {
  background: transparent;
  color: var(--color-text, #1a1d23);
  border-color: var(--color-border, #d4d8df);
}
.consent-btn-save:hover {
  border-color: var(--color-primary, #00856a);
  color: var(--color-primary, #00856a);
}

.consent-btn-reject {
  background: transparent;
  color: var(--color-text-muted, #5a6270);
  border-color: transparent;
  padding-left: var(--space-3, 0.75rem);
  padding-right: var(--space-3, 0.75rem);
}
.consent-btn-reject:hover {
  color: var(--color-text, #1a1d23);
}

/* Settings link in footer */
.consent-settings-link {
  cursor: pointer;
  color: var(--color-text-muted, #7a8290);
  font-size: var(--text-xs, 0.75rem);
  background: none;
  border: none;
  font-family: var(--font-body, sans-serif);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.18s ease;
  padding: 0;
}
.consent-settings-link:hover {
  color: var(--color-primary, #00856a);
}

/* Responsive */
@media (max-width: 600px) {
  .consent-banner {
    padding: var(--space-5, 1.25rem) var(--space-4, 1rem);
  }
  .consent-categories {
    flex-direction: column;
  }
  .consent-category {
    max-width: 100%;
  }
  .consent-actions {
    flex-direction: column;
    width: 100%;
  }
  .consent-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
