.j2pcn-root {
  --cream: #fff8f3;
  --peach: #f5c3ad;
  --terra: #c96f55;
  --brown: #4e2918;
  --sage: #8fa58d;
  --j2pcn-viewport-height: 100vh;
  position: static;
  z-index: 999999;
  color: var(--brown);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.j2pcn-root,
.j2pcn-root *,
.j2pcn-root *::before,
.j2pcn-root *::after {
  box-sizing: border-box;
}

/* Protection contre les règles globales des thèmes et constructeurs de pages. */
.j2pcn-root [hidden] {
  display: none !important;
}

.j2pcn-root button,
.j2pcn-root input {
  font: inherit;
}

.j2pcn-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(50, 31, 23, 0.58);
}

@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))) {
  .j2pcn-backdrop {
    background: rgba(50, 31, 23, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
}

.j2pcn-banner {
  position: fixed;
  right: auto;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 2147483001;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: calc(100% - 36px);
  width: min(900px, calc(100% - 36px));
  max-width: 900px;
  max-height: calc(100vh - 36px);
  max-height: calc(var(--j2pcn-viewport-height, 100vh) - 36px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: 0;
  overflow: hidden;
  color: var(--brown);
  background: var(--cream);
  border: 1px solid rgba(201, 111, 85, 0.25);
  border-radius: 26px;
  box-shadow: 0 24px 80px rgba(50, 31, 23, 0.3);
  transform: translateX(-50%);
  isolation: isolate;
}

.j2pcn-root[data-position="center"] .j2pcn-banner {
  top: 50%;
  bottom: auto;
  max-height: calc(100vh - 36px);
  max-height: calc(var(--j2pcn-viewport-height, 100vh) - 36px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, -50%);
}

.j2pcn-scroll {
  min-width: 0;
  min-height: 0;
  padding: 24px 24px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.j2pcn-footer {
  position: relative;
  min-width: 0;
  padding: 8px 24px 20px;
  background: var(--cream);
  border-top: 1px solid rgba(78, 41, 24, 0.06);
}

.j2pcn-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.j2pcn-heading > div {
  min-width: 0;
}

.j2pcn-heading h2 {
  margin: 4px 0 8px;
  color: var(--brown);
  font-size: clamp(22px, 2.3vw, 28px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.j2pcn-eyebrow {
  color: var(--terra);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.j2pcn-close {
  flex: 0 0 auto;
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  color: var(--brown);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
  -webkit-appearance: none;
  appearance: none;
}

.j2pcn-close:hover,
.j2pcn-close:focus-visible {
  background: rgba(201, 111, 85, 0.12);
}

.j2pcn-description {
  margin: 6px 0 0;
  line-height: 1.55;
}

.j2pcn-policy-link {
  margin: 8px 0 0;
}

.j2pcn-policy-link a {
  color: var(--brown);
  font-weight: 700;
}

.j2pcn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.j2pcn-actions[data-j2pcn-main-actions] .j2pcn-button:not(.is-ghost) {
  min-width: 170px;
}

.j2pcn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  color: inherit;
  background: transparent;
  border: 2px solid var(--terra);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.j2pcn-button.is-primary {
  color: #fff;
  background: var(--terra);
}

.j2pcn-button.is-secondary {
  color: var(--terra);
  background: #fff;
}

.j2pcn-button.is-ghost {
  color: var(--brown);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.j2pcn-button:hover,
.j2pcn-button:focus-visible {
  filter: brightness(0.96);
}

.j2pcn-button:focus-visible,
.j2pcn-close:focus-visible,
.j2pcn-category input:focus-visible,
.j2pcn-reopen:focus-visible {
  outline: 3px solid rgba(78, 41, 24, 0.35);
  outline-offset: 3px;
}

/* Les deux vues sont pilotées par la classe is-customizing.
   Cela évite qu'un thème ou un navigateur affiche les deux groupes à la fois. */
.j2pcn-preferences,
.j2pcn-actions[data-j2pcn-custom-actions] {
  display: none !important;
}

.j2pcn-banner.is-customizing .j2pcn-preferences {
  display: grid !important;
}

.j2pcn-banner.is-customizing .j2pcn-actions[data-j2pcn-main-actions] {
  display: none !important;
}

.j2pcn-banner.is-customizing .j2pcn-actions[data-j2pcn-custom-actions] {
  display: flex !important;
}

.j2pcn-preferences {
  gap: 10px;
  margin-top: 18px;
}

.j2pcn-category {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 72px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid rgba(78, 41, 24, 0.1);
  border-radius: 16px;
  cursor: pointer;
}

.j2pcn-category > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.j2pcn-category strong {
  font-size: 16px;
}

.j2pcn-category small {
  color: #6d5b51;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.j2pcn-category input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--terra);
  cursor: pointer;
}

.j2pcn-category input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.j2pcn-test-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 10px;
  color: #684d00;
  background: #fff0b8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.j2pcn-reopen {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  left: max(16px, env(safe-area-inset-left, 0px));
  z-index: 2147482999;
  min-height: 42px;
  padding: 10px 15px;
  color: #fff;
  background: var(--brown);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.j2pcn-status {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
}

html.j2pcn-open,
body.j2pcn-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.j2pcn-embed {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  background: #f6eee9;
  border-radius: 18px;
}

.j2pcn-embed iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
}

.j2pcn-embed-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  padding: 24px;
  color: var(--brown);
  background: #f6eee9;
  place-content: center;
  text-align: center;
}

.j2pcn-embed-placeholder button {
  justify-self: center;
  min-height: 42px;
  padding: 10px 16px;
  color: #fff;
  background: var(--terra);
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 900px) {
  .j2pcn-banner {
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(var(--j2pcn-viewport-height, 100vh) - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .j2pcn-root[data-position="center"] .j2pcn-banner {
    max-height: calc(100vh - 24px);
    max-height: calc(var(--j2pcn-viewport-height, 100vh) - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .j2pcn-scroll {
    padding: 20px 20px 6px;
  }

  .j2pcn-footer {
    padding: 8px 20px 18px;
  }

  .j2pcn-category {
    min-height: 68px;
  }
}

@media (max-width: 640px) {
  .j2pcn-banner {
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(var(--j2pcn-viewport-height, 100vh) - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
  }

  .j2pcn-root[data-position="center"] .j2pcn-banner {
    max-height: calc(100vh - 16px);
    max-height: calc(var(--j2pcn-viewport-height, 100vh) - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .j2pcn-scroll {
    padding: 18px 18px 5px;
  }

  .j2pcn-footer {
    padding: 7px 18px 16px;
  }

  .j2pcn-actions,
  .j2pcn-banner.is-customizing .j2pcn-actions[data-j2pcn-custom-actions] {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .j2pcn-actions[data-j2pcn-main-actions] .j2pcn-button:not(.is-ghost),
  .j2pcn-button {
    width: 100%;
    min-width: 0;
  }

  .j2pcn-category {
    gap: 12px;
    min-height: 64px;
    padding: 12px 13px;
  }

  .j2pcn-category strong {
    font-size: 15px;
  }

  .j2pcn-category small {
    font-size: 13px;
  }

  .j2pcn-reopen {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
  }
}

@media (max-height: 720px) and (min-width: 641px) {
  .j2pcn-scroll {
    padding-top: 18px;
  }

  .j2pcn-category {
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .j2pcn-preferences {
    gap: 8px;
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .j2pcn-root *,
  .j2pcn-root *::before,
  .j2pcn-root *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.j2pcn-policy-catalogue {
  margin: 32px 0;
  padding: 24px;
  color: #4e2918;
  background: #fff8f3;
  border: 1px solid rgba(201, 111, 85, 0.22);
  border-radius: 22px;
}

.j2pcn-policy-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.j2pcn-policy-services article {
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(78, 41, 24, 0.1);
  border-radius: 16px;
}

.j2pcn-policy-services article > span {
  color: #c96f55;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.j2pcn-policy-services h3 {
  margin: 5px 0 12px;
  overflow-wrap: anywhere;
}

.j2pcn-policy-services dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}

.j2pcn-policy-services dt {
  font-weight: 800;
}

.j2pcn-policy-services dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.j2pcn-policy-manage {
  min-height: 42px;
  margin-top: 18px;
  padding: 10px 16px;
  color: #fff;
  background: #c96f55;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 700px) {
  .j2pcn-policy-services {
    grid-template-columns: 1fr;
  }

  .j2pcn-policy-services dl {
    grid-template-columns: 1fr;
  }
}
