/* ==========================================================
   WeddingPart — Outils de plan : plein-largeur + MODE PLEIN ÉCRAN
   ----------------------------------------------------------
   Chargé UNIQUEMENT sur plan-technique / amenagement-exterieur /
   plan-interactif (enqueue conditionnel par slug).
   Cibles : classes body posées par chaque outil
   (idd-ps-active / idd-pt-active / idd-am-active).
   ========================================================== */

/* ---- Plein-largeur (les outils le font déjà ; renfort non destructif) ---- */
body.idd-ps-active .app-workspace__inner > #idd-ps-root,
body.idd-pt-active .app-workspace__inner > #idd-pt-root,
body.idd-am-active .app-workspace__inner > .idd-am-root {
  max-width: none;
  width: 100%;
  margin-inline: 0;
}
@media (min-width: 1024px) {
  body.idd-ps-active #idd-ps-root,
  body.idd-pt-active #idd-pt-root,
  body.idd-am-active .idd-am-root {
    border-radius: 0;
    box-shadow: none;
  }
}

/* ==========================================================
   MODE PLEIN ÉCRAN DE CONSTRUCTION
   ----------------------------------------------------------
   Activé par la classe body `idd-fullscreen-plan` (posée par
   idd-tool-fullbleed.js via le bouton « Plein écran »).
   L'éditeur recouvre tout l'écran : on masque le chrome de
   l'app-shell et on recolle la barre d'outils + le canvas.
   ========================================================== */

/* 1) Masquer le chrome de l'app-shell. */
body.idd-fullscreen-plan .app-header,
body.idd-fullscreen-plan .app-sidebar,
body.idd-fullscreen-plan .app-bottomnav,
body.idd-fullscreen-plan .idd-shell-bar {
  display: none !important;
}

/* 2) Le main occupe tout (plus de marge sidebar ni de réserve barre). */
body.idd-fullscreen-plan .app-main {
  margin-left: 0 !important;
  padding-bottom: 0 !important;
}
body.idd-fullscreen-plan .app-workspace {
  padding: 0 !important;
  max-width: none !important;
}
/* Neutralise les offsets header/adminbar dans les calculs de hauteur. */
body.idd-fullscreen-plan {
  --app-header-h: 0px !important;
  --app-adminbar-h: 0px !important;
  overflow: hidden;
}

/* 3) Barre d'outils de l'éditeur (fixe) recollée tout en bas, PLEINE largeur :
      on annule l'offset sidebar du #20 (la sidebar est masquée en plein écran). */
body.idd-fullscreen-plan .idd-tool-toolbar {
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

/* 4) Le canvas remplit tout l'écran moins la barre d'outils (60px). */
body.idd-fullscreen-plan .idd-ps-editor,
body.idd-fullscreen-plan .idd-pt-editor,
body.idd-fullscreen-plan .idd-am-editor,
body.idd-fullscreen-plan .idd-pb-editor,
body.idd-fullscreen-plan .idd-ps-canvas-area,
body.idd-fullscreen-plan .idd-pt-canvas-area,
body.idd-fullscreen-plan .idd-am-canvas-area,
body.idd-fullscreen-plan .idd-pb-canvas-area {
  min-height: calc(100dvh - 60px) !important;
  height: calc(100dvh - 60px) !important;
}

/* ---- Bouton « Plein écran » injecté dans la barre d'outils ---- */
.idd-fs-toggle { display: inline-flex; align-items: center; gap: 6px; }
.idd-fs-toggle svg { width: 18px; height: 18px; }

/* ---- Bouton « Fermer le plein écran » flottant ---- */
.idd-fs-close {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 2147483000;
  display: none;
  align-items: center; gap: 8px;
  padding: 10px 16px;
  border: none; border-radius: 999px;
  background: #1D1819; color: #fff;
  font: 600 14px/1 var(--font-sans, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.4);
}
.idd-fs-close svg { width: 16px; height: 16px; }
.idd-fs-close:hover { background: #B5637A; }
body.idd-fullscreen-plan .idd-fs-close { display: inline-flex; }
