/* Bandeau de consentement aux cookies — couleurs de la boutique (mauve) */
.ifcookies {
  --ifc-accent: #6f4f99;        /* mauve foncé : texte blanc lisible (contraste AA) */
  --ifc-accent-hover: #5c3f82;
  --ifc-soft: #f3eef8;          /* fond mauve très clair */
  --ifc-line: #e2d8ec;
  --ifc-ink: #2b2433;
  --ifc-muted: #6b6273;
  position: fixed;
  z-index: 10000;
  left: 24px;
  bottom: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ifc-ink);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}
.ifcookies[hidden] { display: none; }
.ifcookies--visible { opacity: 1; transform: none; }

.ifcookies__card {
  position: relative;
  background: #fff;
  border: 1px solid var(--ifc-line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(43, 36, 51, .18);
  padding: 22px 22px 18px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.ifcookies__close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--ifc-muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
}
.ifcookies__close:hover { color: var(--ifc-ink); }

.ifcookies__title {
  margin: 18px 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ifc-ink);
}
.ifcookies__text { margin: 0; color: var(--ifc-muted); }
.ifcookies__text a { color: var(--ifc-accent); text-decoration: underline; }

.ifcookies__prefs { margin-top: 16px; border-top: 1px solid var(--ifc-line); }
.ifcookies__prefs[hidden] { display: none; }
.ifcookies__pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ifc-line);
}
.ifcookies__pref-name { margin: 0; font-weight: 600; color: var(--ifc-ink); }
.ifcookies__pref-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--ifc-muted); }
.ifcookies__always {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ifc-accent);
  background: var(--ifc-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.ifcookies__switch { position: relative; flex: none; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.ifcookies__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ifcookies__slider {
  position: absolute;
  inset: 0;
  background: #cfc6d8;
  border-radius: 999px;
  transition: background .2s ease;
}
.ifcookies__slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s ease;
}
.ifcookies__switch input:checked + .ifcookies__slider { background: var(--ifc-accent); }
.ifcookies__switch input:checked + .ifcookies__slider::after { transform: translateX(18px); }
.ifcookies__switch input:focus-visible + .ifcookies__slider { outline: 2px solid var(--ifc-accent); outline-offset: 2px; }

.ifcookies__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}
.ifcookies__btn {
  min-height: 42px;
  padding: 8px 12px;
  border: 1.5px solid var(--ifc-accent);
  border-radius: 10px;
  background: var(--ifc-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ifcookies__btn:hover { background: var(--ifc-accent-hover); border-color: var(--ifc-accent-hover); }
.ifcookies__btn--ghost { background: #fff; color: var(--ifc-accent); }
.ifcookies__btn--ghost:hover { background: var(--ifc-soft); color: var(--ifc-accent-hover); }
.ifcookies__btn[hidden] { display: none; }
/* « Personnaliser » / « Enregistrer » sur toute la largeur, refus et accord côte à côte, à égalité */
.ifcookies__btn--ghost { grid-column: 1 / -1; order: 3; }
.ifcookies__btn:focus-visible, .ifcookies__close:focus-visible { outline: 2px solid var(--ifc-accent); outline-offset: 2px; }

.ifcookies-footer { text-align: center; font-size: 13px; padding: 4px 0 8px; }
.ifcookies-footer a { color: inherit; text-decoration: underline; }

@media (max-width: 575px) {
  .ifcookies { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
  .ifcookies__card { padding: 18px 16px 14px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ifcookies, .ifcookies__slider, .ifcookies__slider::after { transition: none; }
}
