/**
 * Bandeau de consentement cookies — style autonome, sans dépendance.
 * Personnalisable via variables CSS (couleur définie en inline par
 * consent-banner.js à partir de fiche_infosarl.consent_banner_color) :
 *   --cb-accent  couleur principale (boutons "Accepter", switches actifs)
 */
.cb-banner {
  --cb-accent: #2563eb;
  --cb-bg: #ffffff;
  --cb-text: #1f2937;
  --cb-muted: #6b7280;
  --cb-border: #e5e7eb;

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: var(--cb-bg);
  color: var(--cb-text);
  border-top: 1px solid var(--cb-border);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.cb-banner-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.cb-banner-text {
  flex: 1 1 320px;
  min-width: 240px;
}

.cb-banner-text p {
  margin: 0 0 4px;
}

.cb-link {
  color: var(--cb-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}
.cb-link:hover { text-decoration: underline; }

.cb-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.cb-btn {
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: opacity .15s ease, background-color .15s ease;
  font-family: inherit;
}
.cb-btn:hover { opacity: .88; }

.cb-btn-primary {
  background: var(--cb-accent);
  color: #fff;
}

.cb-btn-outline {
  background: transparent;
  border-color: var(--cb-border);
  color: var(--cb-text);
}

.cb-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4px 20px 20px;
  border-top: 1px solid var(--cb-border);
}

.cb-panel-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--cb-border);
}
.cb-panel-row:last-of-type { border-bottom: none; }

.cb-panel-info strong {
  display: block;
  margin-bottom: 2px;
}

.cb-panel-info p {
  margin: 0;
  color: var(--cb-muted);
  font-size: 13px;
}

.cb-panel-actions {
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
}

/* Switch (case à cocher stylée) pour Analytics / Marketing */
.cb-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cb-switch input { opacity: 0; width: 0; height: 0; }
.cb-switch span {
  position: absolute;
  inset: 0;
  background: var(--cb-border);
  border-radius: 999px;
  transition: background-color .15s ease;
  cursor: pointer;
}
.cb-switch span::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.cb-switch input:checked + span { background: var(--cb-accent); }
.cb-switch input:checked + span::before { transform: translateX(18px); }
.cb-switch input:focus-visible + span { outline: 2px solid var(--cb-accent); outline-offset: 2px; }

/* Case "Nécessaire" (non-cliquable, toujours cochée) */
.cb-panel-row input[type="checkbox"][disabled] {
  width: 18px;
  height: 18px;
  accent-color: var(--cb-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .cb-banner-inner { padding: 14px; }
  .cb-banner-actions { width: 100%; }
  .cb-btn { flex: 1 1 auto; }
}

[dir="rtl"] .cb-panel-row { flex-direction: row-reverse; }
[dir="rtl"] .cb-switch input:checked + span::before { transform: translateX(-18px); }
