/* WAF Consent Cookies — bandeau + panneau de préférences */

.waf-consent-banner,
.waf-consent-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
}
.waf-consent-banner.waf-consent-visible,
.waf-consent-panel.waf-consent-visible {
  display: flex;
}

/* Bandeau : bas d'écran, non bloquant */
.waf-consent-banner {
  align-items: flex-end;
  justify-content: center;
  inset: auto 0 0 0;
  pointer-events: none;
  padding: 16px;
}
.waf-consent-banner-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: var(--waf-black, #0d0b0b);
  color: var(--waf-cream, #faf6f2);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.35);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.waf-consent-text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.waf-consent-text a {
  color: var(--waf-nude, #e5cebb);
  text-decoration: underline;
}
.waf-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.waf-consent-btn {
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.waf-consent-btn--primary {
  background: var(--waf-accent, #e84d70);
  color: #fff;
}
.waf-consent-btn--ghost {
  background: transparent;
  color: var(--waf-cream, #faf6f2);
  border: 1px solid rgba(250,246,242,0.4);
}

/* Panneau de personnalisation : modale centrée */
.waf-consent-panel {
  align-items: center;
  justify-content: center;
  background: rgba(13,11,11,0.55);
  padding: 16px;
}
.waf-consent-panel-inner {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--waf-cream, #faf6f2);
  color: var(--waf-text, #2a2020);
  border-radius: 16px;
  padding: 24px;
}
.waf-consent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.waf-consent-panel-head h2 {
  font-size: 1.1rem;
  margin: 0;
}
.waf-consent-panel-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--waf-text, #2a2020);
  padding: 4px 8px;
}
.waf-consent-cat {
  padding: 14px 0;
  border-top: 1px solid rgba(42,32,32,0.12);
}
.waf-consent-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.waf-consent-cat p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--waf-muted, #9e8d84);
  line-height: 1.45;
}
.waf-consent-locked {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--waf-muted, #9e8d84);
}

/* Interrupteurs */
.waf-consent-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}
.waf-consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.waf-consent-slider {
  position: absolute;
  inset: 0;
  background: #cfc3ba;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.waf-consent-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.waf-consent-switch input:checked + .waf-consent-slider {
  background: var(--waf-accent, #e84d70);
}
.waf-consent-switch input:checked + .waf-consent-slider::before {
  transform: translateX(20px);
}

.waf-consent-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .waf-consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
    gap: 12px;
  }
  .waf-consent-text {
    /* Le flex-basis:320px de la règle desktop (pensée pour une largeur en
       ligne) devient une HAUTEUR une fois le conteneur passé en colonne ici
       — sans ce reset, le texte s'étire sur ~320px de haut. */
    flex: 0 0 auto;
    font-size: 0.82rem;
    line-height: 1.4;
  }
  .waf-consent-actions {
    justify-content: stretch;
    gap: 8px;
  }
  .waf-consent-actions .waf-consent-btn {
    flex: 1 1 0;
    padding: 10px 8px;
    font-size: 0.78rem;
  }
  /* Le bandeau cookies doit rester au-dessus de la barre CTA sticky et
     du widget de chat, déjà positionnés en bas d'écran sur mobile. */
  .waf-consent-banner {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  body.waf-sticky-visible .waf-consent-banner {
    inset: auto 0 84px 0;
  }
}
