/* =====================================================
   EIDP — cookie-banner.css
   GDPR Cookie Consent Banner
   ===================================================== */

/* ─── Banner wrapper ─── */
.cookie-banner {
  position: fixed;
  bottom: var(--space-6);
  left: 12px;
  right: 12px;
  margin-inline: auto;
  width: min(760px, calc(100% - 24px));
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124,92,252,0.1);
  z-index: var(--z-cookie);
  display: none;
}

.cookie-banner[aria-hidden="false"] {
  display: block;
}

/* ─── Content ─── */
.cookie-banner__content {
  padding: var(--space-6) var(--space-8);
}

@media (max-width: 600px) {
  .cookie-banner__content { padding: var(--space-4) var(--space-4); }
  .cookie-banner { bottom: var(--space-3); }
}


@media (max-width: 400px) {
  .cookie-banner__content { padding: var(--space-3) var(--space-3); }
  .cookie-banner__title { font-size: var(--text-lg); }
}

.cookie-banner__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cookie-banner__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cookie-banner__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.cookie-banner__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-5);
}

.cookie-banner__policy-link {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* ─── Actions ─── */
.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.cookie-banner__save {
  margin-top: var(--space-4);
}

@media (max-width: 600px) {
  .cookie-banner__actions { flex-direction: column; }
  .cookie-banner__actions .btn { width: 100%; }
  .cookie-banner__save   .btn  { width: 100%; }
}

/* ─── Preferences panel ─── */
.cookie-prefs {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
  padding-block: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cookie-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.cookie-pref-item__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.cookie-pref-item__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.cookie-pref-item__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ─── Toggle switch ─── */
.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.cookie-toggle__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

.cookie-toggle__track {
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-base);
}

.cookie-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: transform var(--transition-base), background var(--transition-base);
}

.cookie-toggle__input:checked + .cookie-toggle__track {
  background: var(--color-brand);
}

.cookie-toggle__input:checked + .cookie-toggle__track::after {
  transform: translateX(20px);
  background: #fff;
}

.cookie-toggle__input:focus-visible + .cookie-toggle__track {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Disabled toggle (necessary cookies) */
.cookie-toggle--disabled .cookie-toggle__track {
  background: var(--color-brand);
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-toggle--disabled .cookie-toggle__track::after {
  transform: translateX(20px);
  background: #fff;
}
