/* Consentement aux cookies : bandeau + fenêtre « Personnaliser »
   (plan 2 du module Pubs, D13 ; gabarit _consent_banner.html, JS zic-consent.js).

   - Bandeau fixe en bas d'écran : il ne décale jamais la page. Empilement :
     bandeau 2400 et « Personnaliser » 2410, au-dessus du bouton flottant du
     chat (100) et des couches de la vitrine (fiche 1500, tiroir 2000, succès
     2200, toasts 2300, landing-public-shop.css : le lien de pub ouvre la
     fiche dès l'arrivée, le visiteur doit pouvoir répondre) ; sous les
     feuilles de paiement (billets / RDV 3000, Mobile Money 4000-9500 : le
     bouton « Payer » reste visible), la modale d'inscription (9999) et la
     modale légale (10050) qui peut s'ouvrir par-dessus.
   - 3 boutons `zc-btn` identiques (même taille, même poids visuel) : grille
     de colonnes égales, empilées sur mobile.
   - Clair par défaut, sombre selon le système ou le thème du profil public
     (data-pp-theme sur <html>). */

.zc-banner,
.zc-prefs {
  --zc-bg: #ffffff;
  --zc-text: #1a0a3d;
  --zc-muted: #4f4868;
  --zc-border: rgba(109, 40, 217, 0.16);
  --zc-accent: #6d28d9;
  --zc-accent-hover: #5b21b6;
  --zc-on-accent: #ffffff;
  --zc-switch-off: #b9b4c9;
  --zc-focus: #a78bfa;
  --zc-shadow: 0 12px 40px rgba(15, 7, 34, 0.28);
}

@media (prefers-color-scheme: dark) {
  .zc-banner,
  .zc-prefs {
    --zc-bg: #15121f;
    --zc-text: #f5f3ff;
    --zc-muted: rgba(245, 243, 255, 0.74);
    --zc-border: rgba(255, 255, 255, 0.12);
    --zc-switch-off: #4a4560;
    --zc-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}

html[data-pp-theme="light"] .zc-banner,
html[data-pp-theme="light"] .zc-prefs {
  --zc-bg: #ffffff;
  --zc-text: #1a0a3d;
  --zc-muted: #4f4868;
  --zc-border: rgba(109, 40, 217, 0.16);
  --zc-switch-off: #b9b4c9;
  --zc-shadow: 0 12px 40px rgba(15, 7, 34, 0.28);
}

html[data-pp-theme="dark"] .zc-banner,
html[data-pp-theme="dark"] .zc-prefs {
  --zc-bg: #15121f;
  --zc-text: #f5f3ff;
  --zc-muted: rgba(245, 243, 255, 0.74);
  --zc-border: rgba(255, 255, 255, 0.12);
  --zc-switch-off: #4a4560;
  --zc-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.zc-banner[hidden], .zc-prefs[hidden] {
  display: none !important;
}

/* ─── Bandeau ─────────────────────────────────────────────────────────── */

.zc-banner {
  position: fixed;
  z-index: 2400;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  max-width: 960px;
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  background: var(--zc-bg);
  color: var(--zc-text);
  border: 1px solid var(--zc-border);
  border-radius: 16px;
  box-shadow: var(--zc-shadow);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
}

.zc-banner-text {
  flex: 1 1 320px;
  min-width: 0;
}

.zc-title {
  margin: 0 0 4px;
  font-family: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--zc-text);
}

.zc-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--zc-muted);
}

.zc-link {
  color: var(--zc-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Boutons : 3 colonnes égales, même style ─────────────────────────── */

.zc-actions {
  flex: 0 1 auto;
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.zc-btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--zc-accent);
  color: var(--zc-on-accent);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.zc-btn:hover {
  background: var(--zc-accent-hover);
}

.zc-btn:focus-visible,
.zc-close:focus-visible,
.zc-link:focus-visible,
.zc-panel:focus-visible {
  outline: 3px solid var(--zc-focus);
  outline-offset: 2px;
}

/* ─── Fenêtre « Personnaliser » ───────────────────────────────────────── */

.zc-prefs {
  position: fixed;
  inset: 0;
  z-index: 2410;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(15, 7, 34, 0.55);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.zc-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  background: var(--zc-bg);
  color: var(--zc-text);
  border: 1px solid var(--zc-border);
  border-radius: 16px;
  box-shadow: var(--zc-shadow);
  text-align: left;
}

.zc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.zc-panel-head .zc-title {
  margin: 0;
  font-size: 1.125rem;
}

.zc-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: rgba(109, 40, 217, 0.1);
  color: var(--zc-text);
  cursor: pointer;
}

.zc-cats {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.zc-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--zc-border);
}

.zc-cat-text {
  min-width: 0;
}

.zc-cat-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.zc-cat-help {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--zc-muted);
}

.zc-panel-policy {
  margin-bottom: 16px;
}

/* Interrupteur : vraie case à cocher (role=switch) posée sur la piste. */
.zc-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 44px;
  height: 26px;
  margin-top: 2px;
}

.zc-switch-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.zc-switch-input:disabled {
  cursor: not-allowed;
}

.zc-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--zc-switch-off);
  transition: background-color 0.15s ease;
}

.zc-switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.zc-switch-input:checked + .zc-switch-track {
  background: var(--zc-accent);
}

.zc-switch-input:checked + .zc-switch-track::before {
  transform: translateX(18px);
}

.zc-switch-input:disabled + .zc-switch-track {
  opacity: 0.55;
}

.zc-switch-input:focus-visible + .zc-switch-track {
  outline: 3px solid var(--zc-focus);
  outline-offset: 2px;
}

/* ─── Mobile : boutons empilés, pleine largeur ────────────────────────── */

@media (max-width: 719px) {
  .zc-banner {
    padding: 16px;
  }

  .zc-actions {
    flex: 1 1 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .zc-btn {
    white-space: normal;
  }
}

/* ─── Lien « Gérer les cookies » du pied de page fixe ─────────────────── */

/* home/_site_footer.html : la rangée (réseaux + copyright) est déjà pleine
   du mobile au desktop. Le côté droit passe donc en grille : les réseaux et
   le copyright gardent leur place sur la 1re ligne, et le lien prend une
   2e ligne, calé à droite et large de son seul texte. Hauteur : réseaux
   (28 px au plus) + une ligne de 15 px, sous la boîte du logo (44 px).
   Sélecteurs en `.zh-ft …` : landing-home.css, chargée après cette feuille,
   pose `gap` et `justify-content` sur `.zh-ft-side`. Les pieds de page du
   profil, de la Marketplace et de Discover passent déjà à la ligne : le lien
   y prend le style de ses voisins. */
.zh-ft .zh-ft-side--r {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  row-gap: 0;
}

.zh-ft .zh-ft-link--cookies {
  grid-column: 1 / -1;
  justify-self: end;
  line-height: 1.2;
}

@media (max-width: 768px) {
  /* Mobile : le copyright est masqué (landing-home.css) et tout le côté
     droit est calé à droite. Une seule colonne : une 2e colonne vide
     ajouterait son `gap` à droite des réseaux. */
  .zh-ft .zh-ft-side--r {
    grid-template-columns: auto;
    justify-content: end;
  }

  .zh-ft .zh-ft-side--r > .zh-ft-soc {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zc-btn,
  .zc-switch-track,
  .zc-switch-track::before {
    transition: none;
  }
}
