/* =========================================================
   ELVANEA - Consentement cookies / Google Analytics
   ========================================================= */

.elv-consent-banner[hidden],
.elv-consent-modal[hidden],
.elv-consent-manage[hidden] {
  display: none !important;
}

.elv-consent-banner,
.elv-consent-modal,
.elv-consent-manage,
.elv-consent-banner *,
.elv-consent-modal *,
.elv-consent-manage * {
  box-sizing: border-box;
}

/* ---------- Bandeau principal ---------- */

.elv-consent-banner {
  position: fixed;
  z-index: 2147483000;
  left: 16px;
  right: 16px;
  bottom: 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  max-width: 1020px;
  margin: 0 auto;
  padding: 16px 20px;

  background: #fffaf4;
  color: #3f2b20;
  border: 1px solid rgba(63, 43, 32, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 36px rgba(35, 22, 14, 0.20);

  font-family: inherit;
}

.elv-consent-content {
  flex: 1 1 auto;
  min-width: 0;
}

.elv-consent-content h2 {
  margin: 0 0 6px;
  color: #3f2b20;
  font-size: 1.05rem;
  line-height: 1.3;
}

.elv-consent-content p {
  margin: 0;
  max-width: 720px;
  color: #55443a;
  font-size: 0.86rem;
  line-height: 1.4;
}

.elv-consent-link {
  display: inline-block;
  margin-top: 6px;
  color: #704c37;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.elv-consent-link:hover,
.elv-consent-link:focus-visible {
  color: #3f2b20;
}

/* ---------- Boutons ---------- */

.elv-consent-actions,
.elv-consent-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.elv-consent-button {
  min-height: 38px;
  padding: 8px 14px;

  border-radius: 999px;
  border: 1px solid #4a3326;

  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.2;

  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.elv-consent-button:hover {
  transform: translateY(-1px);
}

.elv-consent-button-primary {
  background: #3f2b20;
  color: #ffffff;
}

.elv-consent-button-primary:hover,
.elv-consent-button-primary:focus-visible {
  background: #2f2018;
}

.elv-consent-button-secondary {
  background: #ffffff;
  color: #3f2b20;
}

.elv-consent-button-secondary:hover,
.elv-consent-button-secondary:focus-visible {
  background: #f4ece4;
}

.elv-consent-button:focus-visible,
.elv-consent-link:focus-visible,
.elv-consent-close:focus-visible,
.elv-consent-manage:focus-visible,
.elv-consent-switch input:focus-visible + span {
  outline: 3px solid rgba(112, 76, 55, 0.35);
  outline-offset: 3px;
}

/* ---------- Fenêtre de préférences ---------- */

.elv-consent-modal {
  position: fixed;
  z-index: 2147483100;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(26, 18, 13, 0.62);
}

.elv-consent-modal-panel {
  position: relative;

  width: min(580px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;

  padding: 24px;

  background: #fffaf4;
  color: #3f2b20;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(20, 13, 9, 0.32);

  font-family: inherit;
}

.elv-consent-modal-panel h2 {
  margin: 0 44px 16px 0;
  color: #3f2b20;
  font-size: 1.2rem;
  line-height: 1.3;
}

.elv-consent-close {
  position: absolute;
  top: 14px;
  right: 14px;

  width: 36px;
  height: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  background: transparent;
  color: #3f2b20;
  border: 0;
  border-radius: 50%;

  font: inherit;
  font-size: 1.6rem;
  line-height: 1;

  cursor: pointer;
}

.elv-consent-close:hover {
  background: #f0e5dc;
}

.elv-consent-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 14px 0;

  border-top: 1px solid rgba(63, 43, 32, 0.14);
}

.elv-consent-category:last-of-type {
  border-bottom: 1px solid rgba(63, 43, 32, 0.14);
}

.elv-consent-category strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.elv-consent-category p {
  margin: 0;
  max-width: 420px;

  color: #655247;
  font-size: 0.86rem;
  line-height: 1.45;
}

.elv-consent-required {
  flex: 0 0 auto;

  padding: 5px 8px;

  background: #eee4da;
  color: #4a3326;
  border-radius: 999px;

  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

/* ---------- Option mesure d'audience ---------- */

.elv-consent-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;

  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}

.elv-consent-switch input {
  width: 18px;
  height: 18px;
  margin: 0;

  accent-color: #3f2b20;
  cursor: pointer;
}

/* ---------- Actions de la fenêtre ---------- */

.elv-consent-modal-actions {
  margin-top: 18px;
}

/* ---------- Bouton permanent "Gérer mes cookies" ---------- */

.elv-consent-manage {
  position: fixed;
  z-index: 2147482900;
  left: 14px;
  bottom: 14px;

  min-height: 32px;
  padding: 5px 11px;

  background: #fffaf4;
  color: #3f2b20;
  border: 1px solid rgba(63, 43, 32, 0.35);
  border-radius: 999px;
  box-shadow: 0 3px 12px rgba(35, 22, 14, 0.13);

  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;

  cursor: pointer;
}

.elv-consent-manage:hover,
.elv-consent-manage:focus-visible {
  background: #f4ece4;
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  .elv-consent-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;

    flex-direction: column;
    align-items: stretch;
    gap: 14px;

    padding: 14px;
    border-radius: 12px;
  }

  .elv-consent-content h2 {
    font-size: 1rem;
  }

  .elv-consent-content p {
    font-size: 0.82rem;
  }

  .elv-consent-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .elv-consent-button {
    width: 100%;
    min-height: 40px;
    font-size: 0.86rem;
  }

  .elv-consent-modal {
    padding: 10px;
  }

  .elv-consent-modal-panel {
    width: min(340px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    padding: 18px 16px;
    border-radius: 12px;
  }

  .elv-consent-modal-panel h2 {
    font-size: 1.05rem;
    margin-bottom: 12px;
  }

  .elv-consent-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 0;
  }

  .elv-consent-category p {
    font-size: 0.82rem;
  }

  .elv-consent-required {
    font-size: 0.72rem;
    padding: 4px 7px;
  }

  .elv-consent-switch {
    font-size: 0.84rem;
  }

  .elv-consent-switch input {
    width: 18px;
    height: 18px;
  }

  .elv-consent-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .elv-consent-manage {
    left: 8px;
    bottom: 8px;
    font-size: 0.70rem;
    padding: 4px 9px;
    min-height: 28px;
  }
}

/* ---------- Réduction des animations ---------- */

@media (prefers-reduced-motion: reduce) {
  .elv-consent-button {
    transition: none;
  }
}
