/* ── Bouton déclencheur ─────────────────────────────────────────────────── */
.pspd-open-modal {
  margin-top: 12px;
  font-size: 1rem;
  padding: 10px 24px;
}

/* ── Overlay plein écran — indépendant de Bootstrap ────────────────────── */
#pspdOverlay {
  display: none;
  position: fixed;
  inset: 0;                /* top/right/bottom/left = 0 */
  z-index: 99999;
  background: rgba(0,0,0,.55);
  align-items: stretch;
  justify-content: center;
}
#pspdOverlay.pspd-open {
  display: flex;
}

#pspdPanel {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
#pspdHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
  background: #f8f9fa;
}
#pspdClose {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 4px 10px;
  border-radius: 4px;
}
#pspdClose:hover { background: #e9ecef; color: #000; }

/* ── Body ───────────────────────────────────────────────────────────────── */
#pspdBody {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px 0;
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */
#pspdToolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  flex-shrink: 0;
}

/* ── Layout canvas + contrôles ──────────────────────────────────────────── */
#pspdLayout {
  display: flex;
  gap: 16px;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

/* ── Zone canvas ────────────────────────────────────────────────────────── */
#pspdCanvasWrap {
  flex: 1 1 auto;
  overflow: auto;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Neutraliser les règles max-width du thème sur Fabric.js */
#pspdCanvasWrap .canvas-container {
  position: relative !important;
  display: block !important;
  line-height: 0 !important;
}
#pspdCanvasWrap .canvas-container canvas {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  max-width: none !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
}
#pspdCanvasWrap .canvas-container canvas.lower-canvas {
  position: relative !important;
}

/* ── Panneau de contrôles ───────────────────────────────────────────────── */
#pspdControls {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  padding-right: 4px;
}
#pspdControls label {
  display: block;
  margin-top: 14px;
  font-weight: 600;
  font-size: .9rem;
}
#pspdControls input[type="color"] {
  width: 52px; height: 38px;
  padding: 2px; cursor: pointer;
  border: 1px solid #ccc; border-radius: 4px;
}
#pspdPrice {
  margin-top: 16px;
  font-size: 1.1rem;
  line-height: 1.6;
}
#pspdPrice strong {
  font-size: 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
#pspdFooter {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: #f8f9fa;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #pspdLayout { flex-direction: column; }
  #pspdControls { width: 100%; }
  #pspdCanvasWrap { min-height: 220px; }
}
