/* Bandeau cookies RGPD (module accookies) — design Shopify Release.
   z-index au-dessus du header sticky (800) et du chat (1190/1200). */

#ac-cookies[hidden] { display: none !important; }
#ac-cookies .acck-banner[hidden],
#ac-cookies .acck-prefs[hidden],
#ac-cookies .acck-backdrop[hidden] { display: none !important; }

#ac-cookies {
  font-family: var(--font-body-family, inherit);
  color: #111;
}

/* Sélecteur avec l'id : base.css du thème masque tout div vide
   (`div:empty { display:none }`), ce qui neutraliserait ce voile. */
#ac-cookies .acck-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, .5);
}

/* Bandeau (1er écran) — en bas à gauche, pour ne pas masquer la bulle du chat */
.acck-banner {
  position: fixed;
  inset-block-end: 2rem;
  inset-inline-start: 2rem;
  z-index: 1310;
  width: 44rem;
  max-width: calc(100vw - 4rem);
  background: #fff;
  border-radius: var(--card-corner-radius, 12px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .28);
  padding: 2.2rem;
}

.acck-title {
  margin: 0 0 1rem;
  font-family: var(--font-heading-family, inherit);
  font-size: 1.7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.acck-text {
  margin: 0 0 1.8rem;
  font-size: 1.3rem;
  line-height: 1.55;
  color: #444;
}
.acck-text a { color: #111; text-decoration: underline; }

.acck-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
}

.acck-btn {
  font: inherit;
  font-size: 1.25rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 4rem;
  padding: 1.1rem 2rem;
  cursor: pointer;
  border: 1px solid #111;
  transition: opacity .15s ease, background-color .15s ease, color .15s ease;
  white-space: nowrap;
}
/* « Tout accepter » et « Tout refuser » ont exactement le même poids visuel :
   le refus doit être aussi simple que l'acceptation (exigence CNIL). */
.acck-btn--solid { background: #111; color: #fff; flex: 1 1 auto; }
.acck-btn--outline { background: transparent; color: #111; flex: 1 1 auto; }
.acck-btn--link {
  background: none;
  border: none;
  color: #666;
  text-decoration: underline;
  padding: 1.1rem .6rem;
  flex: 0 0 auto;
}
.acck-btn--solid:hover { opacity: .85; }
.acck-btn--outline:hover { background: #111; color: #fff; }
.acck-btn--link:hover { color: #111; }

/* Panneau de préférences (2e écran) — modale centrée */
.acck-prefs {
  position: fixed;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  z-index: 1320;
  width: 56rem;
  max-width: calc(100vw - 3rem);
  max-height: calc(100dvh - 6rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--card-corner-radius, 12px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.acck-prefs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 2.2rem 1.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.acck-prefs-head .acck-title { margin: 0; }
.acck-close {
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  padding: .4rem;
  line-height: 0;
}
.acck-prefs-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.8rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}
.acck-cat { display: flex; flex-direction: column; gap: .6rem; }
.acck-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.acck-cat-name {
  font-size: 1.4rem;
  font-weight: var(--font-weight-heading-semibold, 600);
}
label.acck-cat-name { cursor: pointer; }
.acck-cat-desc {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
  color: #666;
}
.acck-always {
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #888;
  white-space: nowrap;
}

/* Interrupteur */
.acck-switch { position: relative; display: inline-block; width: 4.4rem; height: 2.4rem; flex: 0 0 auto; }
.acck-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.acck-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 4rem;
  cursor: pointer;
  transition: background-color .2s ease;
}
.acck-slider:before {
  content: "";
  position: absolute;
  width: 1.8rem;
  height: 1.8rem;
  inset-block-start: .3rem;
  inset-inline-start: .3rem;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
}
.acck-switch input:checked + .acck-slider { background: #111; }
.acck-switch input:checked + .acck-slider:before { transform: translateX(2rem); }
.acck-switch input:focus-visible + .acck-slider { outline: 2px solid #111; outline-offset: 2px; }

/* « Enregistrer mes choix » pleine largeur, puis Refuser / Accepter côte à côte
   et strictement de même taille : refuser doit être aussi simple qu'accepter. */
.acck-prefs-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  padding: 1.6rem 2.2rem 2rem;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.acck-prefs-foot .acck-btn { width: 100%; }
.acck-prefs-foot .acck-btn--solid { grid-column: 1 / -1; }

/* La modale bloque le défilement de la page derrière elle */
body.ac-cookies-modal { overflow: hidden; }

/* Tant que le bandeau est visible, on remonte la bulle du chat (module
   acassistant) pour qu'elle ne le chevauche pas en mobile. */
@media screen and (max-width: 749px) {
  .acck-banner {
    inset-inline: 1rem;
    inset-block-end: 1rem;
    width: auto;
    max-width: none;
    padding: 1.8rem;
  }
  .acck-actions .acck-btn--solid { flex: 1 1 100%; }
  .acck-prefs-foot { grid-template-columns: 1fr; }
  .acck-btn--link { flex: 1 1 100%; text-align: center; }
  body.ac-cookies-visible #ac-assistant-toggle { inset-block-end: 22rem; }
}
