/* ==========================================================================
   CONFIGURATEUR PRODUIT - STYLE PROFESSIONNEL (RESTORED)
   ========================================================================== */

:root {
  --wcppcm-primary: #ff8900;
  --wcppcm-primary-hover: #e67e00;
  --wcppcm-bg-modal: #ffffff;
  --wcppcm-bg-sidebar: #ffffff;
  --wcppcm-bg-preview: #f8fafc;
  --wcppcm-text-main: #1e293b;
  --wcppcm-text-light: #64748b;
  --wcppcm-border: #e2e8f0;
  --wcppcm-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --wcppcm-radius: 12px;
}

/* Modal Overlay */
#wcppcmLogoToolModal {
  display: none;
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 2147483647 !important;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.wcppcm-modal-open {
  overflow: hidden !important;
}

/* Main Content Container - GRID SIDE-BY-SIDE */
.wcppcm-logo-tool-content {
  display: grid;
  grid-template-columns: 380px 1fr;
  width: 100vw;
  height: 100vh;
  background: #fff;
  position: relative;
  box-shadow: none;
  border: none;
}

/* Sidebar */
.wcppcm-sidebar {
  background: #fff;
  padding: 25px;
  overflow-y: auto;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
}

/* Preview Area */
.wcppcm-preview-area {
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wcppcm-preview-wrapper {
  width: 100%;
  height: 100%;
  /* Remove flex centering to allow 100% image/zone overlap */
  cursor: grab;
  overflow: hidden;
  position: relative;
}

#wcppcmProductContainer {
  position: relative;
  transform-origin: center top;
  transition: transform 0.1s ease-out;
  /* Smooth but reactive */
}

#wcppcmProductBg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Marking Zone & Canvas */
.wcppcm-marking-zone {
  border: 1px dashed rgba(255, 137, 0, 0.4);
  box-sizing: border-box;
  pointer-events: auto;
}

.wcppcm-marking-zone canvas {
  width: 100% !important;
  height: 100% !important;
  cursor: move;
}

/* UI Elements - Tabs */
.wcppcm-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.wcppcm-tab-btn,
.wcppcm-tabtarget-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wcppcm-text-light);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wcppcm-tab-btn.active,
.wcppcm-tabtarget-btn.active {
  background: #fff;
  color: var(--wcppcm-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Stepper */
.wcppcm-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
  padding: 0 10px;
}

.wcppcm-step {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  position: relative;
  padding-top: 20px;
}

.wcppcm-step.active {
  color: var(--wcppcm-primary);
}

.wcppcm-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  z-index: 2;
}

.wcppcm-step.active::before {
  background: var(--wcppcm-primary);
  box-shadow: 0 0 0 1px var(--wcppcm-primary);
}

/* Handles */
.wcppcm-resize-handle,
.wcppcm-rotate-handle,
.wcppcm-delete-handle,
.wcppcm-drag-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2px solid var(--wcppcm-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  /* Priorité haute */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Extension de la zone cliquable pour la précision */
.wcppcm-resize-handle::before,
.wcppcm-rotate-handle::before,
.wcppcm-delete-handle::before,
.wcppcm-drag-handle::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.wcppcm-resize-handle::after {
  content: '↔';
  font-size: 12px;
  color: var(--wcppcm-primary);
  transform: rotate(45deg);
}

.wcppcm-rotate-handle::after {
  content: '↻';
  font-size: 14px;
  color: var(--wcppcm-primary);
}

.wcppcm-delete-handle::after {
  content: '×';
  font-size: 18px;
  color: #ef4444;
}

.wcppcm-drag-handle::after {
  content: '✥';
  font-size: 16px;
  color: var(--wcppcm-primary);
}

.wcppcm-delete-handle {
  border-color: #ef4444;
}

/* Misc UI */
.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--wcppcm-text-main);
  margin-bottom: 8px;
}

.wcppcm-logo-tool-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

#wcppcmToolSave {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: auto;
  min-width: 200px;
  background: var(--wcppcm-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(255, 137, 0, 0.4);
  transition: all 0.2s;
  cursor: pointer;
}

#wcppcmToolSave:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -3px rgba(255, 137, 0, 0.5);
}

#wcppcmToolPreview {
  position: absolute;
  top: 24px;
  right: 64px;
  /* A gauche de la croix de fermeture */
  z-index: 1000;
  background: #fff;
  color: var(--wcppcm-text-main);
  border: 1px solid var(--wcppcm-border);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

#wcppcmToolPreview:hover {
  border-color: var(--wcppcm-primary);
  color: var(--wcppcm-primary);
}

.wcppcm-upload-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--wcppcm-border);
}

.wcppcm-upload-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--wcppcm-text-main);
  cursor: pointer;
}

.wcppcm-upload-option input {
  margin: 0;
}

@media (max-width: 1024px) {
  #wcppcmToolSave {
    position: static;
    width: 100%;
    margin-top: 20px;
  }
}

.wcppcm-logo-tool-close:hover {
  transform: rotate(90deg);
}