/* Bandeau de consentement aux témoins. Boutons, liens et focus : variables réelles du site ; fond de
   carte neutre et clair. Les trois boutons sont identiques. Sans @layer et en px : la feuille du site
   n'utilise pas de couches et sa police de base est de 10px. */

.mh-cc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.mh-cc__box {
  position: relative;
  width: 100%;
  max-width: 760px;
  padding: 20px 22px;
  border-radius: 10px;
  background: #fff;
  color: #202020;
  box-shadow: 0 12px 40px rgba(32, 32, 32, 0.22);
  font-family: var(--police-texte, sans-serif);
  font-weight: 400;
  pointer-events: auto;
}
.mh-cc__box:focus {
  outline: none;
}

/* X de fermeture : même effet que Refuser. */
.mh-cc__close {
  appearance: none;
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #202020;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}
.mh-cc__close:hover {
  color: var(--couleur-lien-survol);
}

.mh-cc__text {
  margin: 0 0 14px;
  padding-right: 28px;
  color: inherit;
  font-size: 15px;
  line-height: 1.5;
}
/* Liens au fil de la phrase : toujours en ligne, sinon le point final peut tomber seul sur une ligne.
   Graisse des liens du site (seule la graisse 300 de Lato est chargée : pas de faux gras). */
.mh-cc__text a {
  display: inline;
  margin: 0;
  color: var(--couleur-lien);
  font-weight: 400;
  text-decoration: underline;
}
.mh-cc__text a:hover {
  color: var(--couleur-lien-survol);
}

/* Panneau « Personnaliser » : une phrase sous chaque catégorie. */
.mh-cc__cats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 16px;
  font-size: 14.5px;
}
.mh-cc__cats[hidden] {
  display: none;
}
.mh-cc__cats label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
/* Case de largeur fixe et sans marge : la description s'aligne sur le nom de la catégorie. */
.mh-cc__cats input {
  flex: none;
  width: 13px;
  height: 13px;
  margin: 0;
}
.mh-cc__desc {
  margin: 2px 0 0 21px; /* case (13px) + espace (8px) */
  color: #4a4a4a;
  font-size: 13.5px;
  line-height: 1.4;
}

.mh-cc__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
/* Personnaliser / Valider mes choix, Refuser, Accepter : le vrai bouton du site, aucun mis en avant. */
.mh-cc__btn {
  appearance: none;
  display: inline-block;
  margin: 0;
  padding: 8px 18px;
  border: 2px solid var(--couleur-bouton);
  border-radius: var(--rayon-bouton, 0);
  background: var(--couleur-bouton);
  color: var(--couleur-bouton-texte);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.mh-cc__btn:hover {
  border-color: var(--couleur-bouton-survol);
  background: var(--couleur-bouton-survol);
  color: var(--couleur-bouton-texte-survol, var(--couleur-bouton-texte));
}
.mh-cc__close:focus-visible,
.mh-cc__btn:focus-visible {
  outline: 3px solid var(--couleur-lien);
  outline-offset: 2px;
}

/* Mobile : texte plus petit, boutons centrés, X flottant (le texte ne le contourne que sur ses premières
   lignes). Aucun bouton flottant dans le coin bas gauche : pas de marge à réserver. */
@media (max-width: 767px) {
  .mh-cc {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .mh-cc__box {
    padding: 12px 14px;
  }
  .mh-cc__close {
    position: static;
    float: right;
    width: 30px;
    height: 30px;
    margin: -8px -9px 3px 6px;
    font-size: 22px;
  }
  .mh-cc__text {
    margin-bottom: 10px;
    padding-right: 0;
    font-size: 13.5px;
  }
  .mh-cc__cats {
    gap: 5px;
    margin-bottom: 10px;
    font-size: 13.5px;
  }
  .mh-cc__desc {
    font-size: 12.5px;
  }
  .mh-cc__actions {
    justify-content: center;
    gap: 8px;
  }
  .mh-cc__btn {
    padding: 7px 12px;
    font-size: 14px;
  }
}
/* Petit écran : Personnaliser seul en haut, Refuser et Accepter côte à côte (jamais Accepter seul, mis en
   avant, sur sa ligne). */
@media (max-width: 479px) {
  .mh-cc__actions {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
  }
  .mh-cc__actions > :first-child {
    grid-column: 1 / -1;
    justify-self: center;
  }
}
