/* =========================================================
   Aicorvia — Cookie Consent Banner
   Standalone component, injected by cookie-consent.js.
   Uses the same design tokens as style.css.
   ========================================================= */

.cookie-consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent-panel {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  column-gap: 48px;
  padding: 20px max(24px, calc((100% - 1200px) / 2));
  background: var(--bg-white);
  color: var(--text-on-light);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -8px 24px rgba(5, 6, 15, 0.08);
  transform: translateY(16px);
  transition: transform var(--transition-med);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.cookie-consent.is-open .cookie-consent-panel { transform: translateY(0); }

.cookie-consent-body { padding: 0; }

.cookie-consent-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.cookie-consent-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-on-light-muted);
  margin-bottom: 10px;
}
.cookie-consent-text a,
.cookie-link-btn {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.cookie-consent-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 20px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.cookie-category { min-width: 0; }

.cookie-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-category-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.cookie-category-label {
  font-weight: 700;
  font-size: 13px;
}

.cookie-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-on-light-muted);
  cursor: pointer;
}
.cookie-category-toggle:hover { color: var(--color-primary); }
.cookie-category-toggle-icon {
  transition: transform var(--transition-fast);
}
.cookie-category-toggle[aria-expanded="true"] .cookie-category-toggle-icon {
  transform: rotate(180deg);
}

.cookie-category-details {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-on-light-muted);
  margin-top: 8px;
  max-width: 42ch;
}
.cookie-category-details[hidden] { display: none; }

.cookie-consent-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.cookie-consent-impressum {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-light-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: center;
  order: 2;
}
.cookie-consent-impressum:hover { color: var(--color-primary); }

.cookie-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* All three choices as equal, full-width buttons (accept, reject, save) */
.cookie-consent-actions .btn,
.cookie-consent-actions .cookie-link-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.cookie-consent-actions #cookieAcceptAll { order: 1; }
.cookie-consent-actions #cookieRejectAll { order: 2; }
.cookie-consent-actions #cookieSaveSelection { order: 3; }
.cookie-consent-actions #cookieRejectAll,
.cookie-consent-actions #cookieSaveSelection {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
}
.cookie-consent-actions #cookieRejectAll:hover,
.cookie-consent-actions #cookieSaveSelection:hover { background: #333; }

@media (max-width: 640px) {
  .cookie-consent-panel {
    grid-template-columns: 1fr;
    row-gap: 14px;
    padding: 16px;
    max-height: calc(100vh - 24px);
  }
  .cookie-consent-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
