/* Bandeau de consentement aux cookies (static/js/consent.js).
   Charte Herbolistique : vert, creme, titres Poppins, texte Raleway,
   boutons du site (.btn). Repris du bandeau d'e-maprod. */

/* ------------------------------------------------------------- bandeau */
.hb-cookies {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9800;
  background: #fff;
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--green);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -12px rgba(31, 36, 32, .25);
  transform: translateY(20px);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.hb-cookies.is-open { transform: translateY(0); opacity: 1; }

.hb-cookies__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 28px;
}
.hb-cookies__texte { flex: 1; min-width: 0; }
.hb-cookies__titre {
  margin: 0 0 4px;
  font-family: var(--poppins);
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
}
.hb-cookies__corps {
  margin: 0;
  font-family: var(--raleway);
  font-size: 14px;
  line-height: 1.55;
  color: var(--grey);
}
.hb-cookies__lien {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hb-cookies__lien:hover { color: var(--green-hover); }

.hb-cookies__actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Boutons : ceux du site, en plus compact. */
.hb-cookies__btn {
  font-family: var(--poppins);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.hb-cookies__btn--premier { background: var(--green); border-color: var(--green); color: #fff; }
.hb-cookies__btn--premier:hover { background: var(--green-hover); border-color: var(--green-hover); }
.hb-cookies__btn--second { background: #fff; border-color: var(--green); color: var(--green); }
.hb-cookies__btn--second:hover { background: var(--green-pale); }
.hb-cookies__btn--lien {
  background: transparent;
  color: var(--ink);
  padding-left: 8px;
  padding-right: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hb-cookies__btn--lien:hover { color: var(--green); }
.hb-cookies__btn:focus-visible,
.hb-cookies-pastille:focus-visible,
.hb-cookies-fenetre__fermer:focus-visible,
.hb-cookies__deplier:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ------------------------------------------------- fenetre de preferences */
.hb-cookies-ouvert { overflow: hidden; }

.hb-cookies-fenetre {
  position: fixed;
  inset: 0;
  z-index: 9900;
  opacity: 0;
  transition: opacity .22s ease;
}
.hb-cookies-fenetre.is-open { opacity: 1; }
.hb-cookies-fenetre__fond { position: absolute; inset: 0; background: rgba(31, 36, 32, .55); }
.hb-cookies-fenetre__boite {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px rgba(31, 36, 32, .45);
  overflow: hidden;
}
.hb-cookies-fenetre__tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line-2);
}
.hb-cookies-fenetre__titre {
  margin: 0;
  font-family: var(--poppins);
  font-size: 20px;
  font-weight: 600;
  color: var(--green);
}
.hb-cookies-fenetre__fermer {
  display: flex;
  padding: 6px;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--grey);
  cursor: pointer;
}
.hb-cookies-fenetre__fermer:hover { color: var(--ink); background: var(--bg-soft); }
.hb-cookies-fenetre__corps { padding: 20px 26px; overflow-y: auto; }
.hb-cookies-fenetre__intro {
  margin: 0 0 18px;
  font-family: var(--raleway);
  font-size: 14px;
  line-height: 1.55;
  color: var(--grey);
}
.hb-cookies-fenetre__pied {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  background: var(--paper);
  border-top: 1px solid var(--line-2);
}

/* ------------------------------------------------------------ categories */
.hb-cookies__categorie { padding: 16px 0; border-top: 1px solid var(--line-2); }
.hb-cookies__categorie:first-of-type { border-top: 0; padding-top: 0; }
.hb-cookies__entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hb-cookies__libelle {
  font-family: var(--poppins);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.hb-cookies__badge {
  padding: 4px 10px;
  font-family: var(--poppins);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  background: var(--green-pale);
  border-radius: 20px;
  white-space: nowrap;
}
.hb-cookies__description {
  margin: 6px 0 0;
  font-family: var(--raleway);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--grey);
}

/* Interrupteur */
.hb-cookies__interrupteur {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  background: var(--grey-2);
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s;
}
.hb-cookies__interrupteur::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
}
.hb-cookies__interrupteur:checked { background: var(--green); }
.hb-cookies__interrupteur:checked::before { transform: translateX(18px); }
.hb-cookies__interrupteur:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.hb-cookies__deplier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
  background: none;
  border: 0;
  font-family: var(--poppins);
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  cursor: pointer;
}
.hb-cookies__deplier svg { transition: transform .2s; }
.hb-cookies__deplier.is-open svg { transform: rotate(180deg); }
.hb-cookies__liste { margin-top: 10px; }

.hb-cookies__tableau {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.hb-cookies__tableau table { width: 100%; border-collapse: collapse; font-family: var(--raleway); font-size: 12.5px; }
.hb-cookies__tableau th,
.hb-cookies__tableau td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
  color: var(--grey);
}
.hb-cookies__tableau tr:last-child td { border-bottom: 0; }
.hb-cookies__tableau th {
  font-family: var(--poppins);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  white-space: nowrap;
}
.hb-cookies__tableau code {
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink);
  word-break: break-all;
}
.hb-cookies__duree { white-space: nowrap; }

/* ------------------------------------------------- pastille (bas, gauche) */
.hb-cookies-pastille {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--green);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  box-shadow: 0 6px 16px -6px rgba(31, 36, 32, .25);
  cursor: pointer;
  transition: transform .18s, background .18s, color .18s;
}
.hb-cookies-pastille:hover { transform: translateY(-2px); background: var(--green); color: #fff; }

/* Lien « Cookies » du pied de page */
.footer-bottom .hb-cookies-pied {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.footer-bottom .hb-cookies-pied:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .hb-cookies__inner { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px 20px; }
  .hb-cookies__actions { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .hb-cookies { left: 12px; right: 12px; bottom: 12px; }
  .hb-cookies__actions { flex-direction: column-reverse; }
  .hb-cookies__btn { width: 100%; }
  .hb-cookies-fenetre__pied { flex-direction: column-reverse; }
  .hb-cookies-fenetre__tete,
  .hb-cookies-fenetre__corps,
  .hb-cookies-fenetre__pied { padding-left: 18px; padding-right: 18px; }
  .hb-cookies-pastille { left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-cookies, .hb-cookies-fenetre, .hb-cookies-pastille, .hb-cookies__interrupteur::before { transition: none; }
}
