/* Canvas décors personnalisés */
body.akar-has-custom-decors {
  position: relative;
}

.akar-decor-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  pointer-events: none;
  /* Dans <main> : au-dessus des fonds de section, sous le texte */
  z-index: 1;
  overflow: visible;
}

.akar-decor-canvas .akar-decor-item {
  position: absolute;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: none;
  box-shadow: none;
}

body.akar-has-custom-decors main {
  position: relative;
  overflow: visible;
}

body.akar-has-custom-decors main.produits-page,
body.akar-has-custom-decors main.histoire-page,
body.akar-has-custom-decors main.services-page {
  overflow: visible;
}

/* Texte au-dessus des décors (pas de z-index sur les sections : sinon le texte reste piégé sous le canvas) */
body.akar-has-custom-decors main .container,
body.akar-has-custom-decors main .hero__inner,
body.akar-has-custom-decors main .prod-hero__inner,
body.akar-has-custom-decors main .hist-intro__text,
body.akar-has-custom-decors main .hist-missions__body,
body.akar-has-custom-decors main .hist-block__inner,
body.akar-has-custom-decors main .svc-catalogue__inner,
body.akar-has-custom-decors main .svc-dedie__inner,
body.akar-has-custom-decors main .svc-delivery__wrap,
body.akar-has-custom-decors main .contact-infos .container,
body.akar-has-custom-decors main .contact-form-section .container,
body.akar-has-custom-decors main .zones .container,
body.akar-has-custom-decors main .catalogue__inner,
body.akar-has-custom-decors main .cat-zones .container {
  position: relative;
  z-index: 2;
}

/* z-index négatif dans l’éditeur = renforce le passage derrière */
.akar-decor-canvas .akar-decor-item.is-behind-content {
  z-index: -1;
}

/* Mode édition */
body.akar-decor-edit-mode .akar-decor-canvas {
  z-index: 35;
}

body.akar-decor-edit-mode .akar-decor-canvas.is-editing .akar-decor-item {
  pointer-events: auto;
  cursor: default;
  outline: 2px dashed rgba(79, 171, 156, 0.85);
  outline-offset: 2px;
}

body.akar-decor-edit-mode .akar-decor-item.is-selected {
  outline-color: var(--coral, #e74c33);
  outline-width: 3px;
}

body.akar-decor-edit-mode .akar-decor-item.is-flush-x.is-selected {
  box-shadow: -3px 0 0 0 var(--coral, #e74c33);
}

body.akar-decor-edit-mode .akar-decor-item.is-flush-y.is-selected {
  box-shadow: 0 -3px 0 0 var(--coral, #e74c33);
}

body.akar-decor-edit-mode .akar-decor-item.is-flush-x.is-flush-y.is-selected {
  box-shadow: -3px -3px 0 0 var(--coral, #e74c33);
}

body.akar-decor-edit-mode .akar-decor-item {
  transform: none !important;
  will-change: auto;
}

/* Poignées d’axe (sur l’image sélectionnée) */
.akar-decor-handle {
  position: absolute;
  pointer-events: auto;
  z-index: 2;
  background: var(--coral, #e74c33);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body.akar-decor-edit-mode .akar-decor-item:not(.is-selected) .akar-decor-handle {
  display: none;
}

.akar-decor-handle--y {
  top: -7px;
  left: 10%;
  right: 10%;
  height: 10px;
  border-radius: 5px;
  cursor: ns-resize;
}

.akar-decor-handle--x {
  top: 15%;
  bottom: 15%;
  width: 10px;
  border-radius: 5px;
  cursor: ew-resize;
}

.akar-decor-item[data-anchor="left"] .akar-decor-handle--x {
  left: -7px;
}

.akar-decor-item[data-anchor="right"] .akar-decor-handle--x {
  right: -7px;
}

/* Poignée largeur — côté opposé à l’ancrage (bord ancré fixe) */
.akar-decor-handle--w {
  top: 15%;
  bottom: 15%;
  width: 10px;
  border-radius: 5px;
  cursor: ew-resize;
  background: #4fab9c;
}

.akar-decor-item[data-anchor="left"] .akar-decor-handle--w {
  right: -7px;
  left: auto;
}

.akar-decor-item[data-anchor="right"] .akar-decor-handle--w {
  left: -7px;
  right: auto;
}

body.akar-decor-edit-mode .akar-decor-item:not(.is-selected) .akar-decor-handle--w {
  display: none;
}

/* Panneau latéral */
.akar-decor-editor {
  position: fixed;
  top: 32px;
  left: 16px;
  z-index: 100001;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  border: 1px solid #e0dbd6;
  font-size: 0.88rem;
  color: #2a2a2a;
}

.admin-bar .akar-decor-editor {
  top: 46px;
}

.akar-decor-editor__head {
  padding: 14px 16px 8px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.akar-decor-editor__head strong {
  font-size: 1rem;
  color: #4fab9c;
}

.akar-decor-editor__page {
  font-size: 0.82rem;
  color: #777;
}

.akar-decor-editor__hint {
  margin: 0;
  padding: 10px 16px;
  color: #666;
  line-height: 1.45;
  font-size: 0.82rem;
}

.akar-decor-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.akar-decor-editor__actions .btn {
  padding: 10px 16px;
  font-size: 0.82rem;
}

.btn--sm {
  padding: 10px 16px;
  font-size: 0.82rem;
}

.akar-decor-editor__selected {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #faf8f6;
}

.akar-decor-editor__selected h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.akar-decor-editor__field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.akar-decor-editor__field input[type="number"],
.akar-decor-editor__field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}

.akar-decor-editor__field-hint {
  display: block;
  color: #888;
  font-size: 0.78rem;
  line-height: 1.35;
}

.akar-decor-editor__field input[type="range"] {
  width: 100%;
  accent-color: #4fab9c;
}

.akar-decor-editor__field--range small {
  display: block;
  color: #888;
  font-weight: 400;
  margin-top: 2px;
}

.akar-decor-editor__range-label output {
  font-weight: 700;
  color: #4fab9c;
}

.akar-decor-editor__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.akar-decor-editor__delete {
  background: #fff;
  color: #c0392b;
  border: 1.5px solid #c0392b;
}

.akar-decor-editor__list {
  list-style: none;
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid #eee;
}

.akar-decor-editor__list button {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: #444;
}

.akar-decor-editor__list button:hover,
.akar-decor-editor__list button.is-active {
  background: #e8f6f3;
  color: #4fab9c;
}

.akar-decor-editor__status {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.akar-decor-editor__status.is-ok {
  color: #459488;
  font-weight: 600;
}

.akar-decor-editor__status.is-err {
  color: #c0392b;
  font-weight: 600;
}

.akar-decor-editor__foot {
  padding: 12px 16px 14px;
  border-top: 1px solid #eee;
}

.akar-decor-editor__exit {
  color: #666;
  font-size: 0.82rem;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .akar-decor-editor {
    left: 8px;
    right: 8px;
    width: auto;
  }
}
