@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

/* =============================================================================
   WCPW Print Wizard — CSS
   Step 4 real: cleanup + hardening without UI changes.
   Notes:
   - Preserved cascade and responsive behavior.
   - Removed stale editor-overlay leftovers and empty rules.
   - Consolidated draw-modal styling to the canonical late section.
   ============================================================================= */

/* WCPW Print Wizard - Styles */
/* =========================
   Root
   ========================= */
.wcpw-root{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  color:#111827;
}

/* -------------------- */
/* PRESET SHAPES MODAL  */
/* -------------------- */

.wcpw-shape.wcpw-shape--more{ white-space:nowrap; }

.wcpw-modal-presets .wcpw-modal-head .wcpw-modal-title{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.wcpw-modal-presets .wcpw-modal-subtitle{
  font-weight:400;
  font-size:13px;
  color:#667085;
}


/* =========================================================
   PRESET SHAPES MODAL - MOBILE SCROLL FIX
   - Evita contenuti tagliati su mobile
   - Header e azioni sempre raggiungibili
   ========================================================= */

/* layout a colonna con area interna scrollabile */
.wcpw-modal-presets{
  max-height: 85vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.wcpw-modal-presets .wcpw-modal-head{
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.wcpw-modal-presets .wcpw-presets{
  flex: 1 1 auto;
  min-height: 0;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.wcpw-modal-presets .wcpw-modal-actions--presets{
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid rgba(17,24,39,.08);
  padding: 12px 16px;
}


.wcpw-modal-presets .wcpw-presets-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}

/* modal wrapper: su mobile riduce padding esterno per massimizzare area utile */
@media (max-width: 640px){
  .wcpw-modal{ padding: 12px; }
  .wcpw-modal-inner{ padding: 12px; border-radius: 16px; }
  .wcpw-modal-presets{ max-height: 90vh; }
}

@media (max-width: 420px){
  .wcpw-modal{ padding: 10px; }
  .wcpw-modal-presets .wcpw-presets{ padding: 12px; }
  .wcpw-modal-presets .wcpw-modal-actions--presets{ padding: 10px 12px; }
}

/* =========================================================
   ARTWORK BACKGROUND (UI) - swatch + picker
   ========================================================= */

.wcpw-bg{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(17,24,39,.08);
}

.wcpw-bg-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

.wcpw-bg-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* Unifica raggio bordi (coerente con i pulsanti del wizard: quasi squadrati) */
:root{ --wcpw-bg-radius: 12px; }

.wcpw-bg-swatch,
.wcpw-bg-picker{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--wcpw-bg-radius);

  /* Coerenza con UI del wizard: pill arancione */
  background:#ff5a36;
  color:#fff;
  border: 1px solid rgba(255,255,255,.18);

  font-weight: 800;
  font-size: 13px;
  cursor:pointer;
  user-select:none;
  text-decoration:none;
  line-height: 1;
}

.wcpw-bg-swatch{
  padding: 0 10px;
}

.wcpw-bg-swatch-dot{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.70);
  box-sizing:border-box;
  display:block;
}

/* "Nessuno": pallino a scacchiera per comunicare trasparenza */
.wcpw-bg-swatch.is-none .wcpw-bg-swatch-dot{
  background:
    linear-gradient(45deg, rgba(17,24,39,.10) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17,24,39,.10) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17,24,39,.10) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17,24,39,.10) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.wcpw-bg-swatch-label{
  font-weight: 800;
  line-height: 1;
}

/*
  Il pulsante "Personalizza" usa gli stessi stili degli swatch.
  Tenere una classe dedicata consente aggiornamenti UI senza dipendere dai reset dei <label>.
*/

/*
  Hardening: alcuni temi/Elementor applicano reset aggressivi ai <label>
  (background trasparente, border:0, display:block, text-decoration, ecc.).
  Qui forziamo lo stesso look dei pulsanti swatch, senza cambiare markup.
*/
.wcpw-wrap .wcpw-bg .wcpw-bg-picker,
.wcpw-wrap .wcpw-bg .wcpw-bg-swatch{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  height:38px !important;
  padding:0 12px !important;
  border-radius:var(--wcpw-bg-radius) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  background:#ff5a36 !important;
  color:#fff !important;
  text-decoration:none !important;
  line-height:1 !important;
  box-sizing:border-box !important;
}


/* Dot del picker: usa markup reale (vedi template) per centratura identica agli swatch */
.wcpw-bg-picker-dot{
  background: var(--wcpw-bg-picker-color, #ffffff);
}

.wcpw-bg-picker-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  margin:0;
}

/* Rimosso hardening duplicato (già gestito dal blocco precedente con specificità) */


/* Color input: viene aperto via JS (click programmatico). Deve restare nel DOM ma non influenzare layout. */
.wcpw-bg-picker-wrap{
  position: relative;
  display: inline-flex;
}

.wcpw-bg-picker-wrap .wcpw-bg-color{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
}

/* stati focus/active coerenti con resto UI */
.wcpw-bg-swatch:focus,
.wcpw-bg-picker:focus{
  outline:none;
}

.wcpw-bg-swatch:focus-visible,
.wcpw-bg-picker:focus-visible{
  box-shadow: 0 0 0 3px rgba(255, 90, 48, .25);
  border-color: rgba(255, 90, 48, .55);
}

/* selezione: il JS applicherà .is-active */
.wcpw-bg-swatch.is-active,
.wcpw-bg-picker.is-active{
  border-color: rgba(255, 90, 48, .65);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 48, .20);
}

@media (max-width: 640px){
  .wcpw-bg-row{ gap: 8px; }
  .wcpw-bg-swatch,
  .wcpw-bg-picker{ height: 40px; }
}

.wcpw-modal-presets .wcpw-preset-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:14px 12px 12px;
  border:1px solid #e6e8ee;
  border-radius:14px;
  background:#ffffff !important;
  color:#111827;
  cursor:pointer;
  width:100%;
  min-height:118px;
  box-shadow:0 1px 0 rgba(16,24,40,0.02);
}

.wcpw-modal-presets .wcpw-preset-card:hover{
  border-color:#d0d5dd;
  box-shadow:0 3px 14px rgba(16,24,40,0.08);
}

.wcpw-modal-presets .wcpw-preset-card:active{
  transform: translateY(1px);
}

.wcpw-modal-presets .wcpw-preset-card:focus{
  outline:none;
}

.wcpw-modal-presets .wcpw-preset-card:focus-visible{
  outline:3px solid rgba(0,0,0,0.18);
  outline-offset:2px;
}
.wcpw-modal-presets .wcpw-preset-preview{
  width:86px;
  height:66px;
  display:grid;
  place-items:center;
  background:transparent;
  color:#ff5a36;
  overflow:hidden;
}

.wcpw-modal-presets .wcpw-preset-preview svg{
  width:60px;
  height:60px;
  display:block;
}

.wcpw-modal-presets .wcpw-preset-preview svg path{
  fill:currentColor;
}

.wcpw-modal-presets .wcpw-preset-label{
  margin-top:auto;
  padding-top:2px;
  font-size:13px;
  line-height:1.15;
  font-weight:800;
  color:#111827;
  text-align:center;
  width:100%;
}

.wcpw-preset-card::-webkit-scrollbar,
.wcpw-preset-preview::-webkit-scrollbar{
  width:0;
  height:0;
}

@media (max-width:900px){
  .wcpw-modal-presets .wcpw-presets-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

@media (max-width:680px){
  .wcpw-modal-presets .wcpw-presets-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
  .wcpw-modal-presets .wcpw-preset-card{ min-height:112px; padding:12px 10px 10px; }
  .wcpw-modal-presets .wcpw-preset-preview{ width:82px; height:62px; }
  .wcpw-modal-presets .wcpw-preset-preview svg{ width:54px; height:54px; }
}
#wcpw-wrap,
#wcpw-wrap *{
  box-sizing:border-box;
}

.wcpw-title{
  margin: 0 0 4px 0;
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: 20px;
  line-height: 1.15;
}

.wcpw-free-shipping{
  margin: 0 0 8px;
  color: var(--wcpw-accent, #ff5a36);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.wcpw-subtitle{
  margin: 0;
  color:#6b7280;
  font-size: 13.5px;
  line-height: 1.35;
}

.wcpw-header{
  margin: 0 0 10px 0;
  padding: 0 2px;
}

.wcpw-muted{
  display:block;
  color:#6b7280;
  font-size: 12.5px;
  line-height: 1.35;
}

.wcpw-hint{
  display:block;
  margin-top:8px;
  color:#6b7280;
  font-size: 12.5px;
  line-height: 1.35;
}

.wcpw-inline-error{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(220, 38, 38, 0.06);
  border:1px solid rgba(220, 38, 38, 0.18);
  color:#991b1b;
  font-size: 13px;
}

/* =========================
   Layout base
   ========================= */
#wcpw-wrap{
  width:100%;
  max-width:100%;
  margin:6px 0;
  float:none;
}

/* STEP 1: Config + Preview nella stessa sezione (wizard.php) */
.wcpw-config-grid{
  display:grid;
  grid-template-columns: 1fr 380px;
  gap:24px;
  align-items:start;
  width:100%;
  min-width:0;
}

.wcpw-config-col{
  min-width:0;
}

.wcpw-config-preview-col{
  min-width:0;
}

/* =========================
   Sections (cards)
   ========================= */
.wcpw-step{
  background:#fff;
  border:0;
  padding:16px;
  border-radius:16px;
  margin-bottom:14px;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
  position: relative;
  z-index: 1;
}

.wcpw-step-title{
  font-weight:800;
  margin-bottom:10px;
  color:#111827;
  letter-spacing: -.01em;
}

.wcpw-row{ margin:12px 0; }

.wcpw-row label,
.wcpw-label{
  display:block;
  font-weight:700;
  margin-bottom:6px;
  color:#111827;
}

.wcpw-inline{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

/* =========================
   Inputs + buttons
   ========================= */
.wcpw-custom-box{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:6px;
}

.wcpw-custom-col{
  flex:1 1 260px;
  min-width: 240px;
  padding:12px;
  border-radius:14px;
  background:#f9fafb;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap input[type="file"],
#wcpw-wrap select{
  width:100%;
  max-width:100%;
  border:1px solid #d1d5db;
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  outline:none;
  color:#111827;
}

#wcpw-wrap input[type="text"]::placeholder,
#wcpw-wrap input[type="number"]::placeholder{
  color:#9ca3af;
}

#wcpw-wrap input[type="text"]:focus,
#wcpw-wrap input[type="number"]:focus,
#wcpw-wrap select:focus{
  border-color:#2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

#wcpw-wrap input[type="range"]{
  width: 100%;
  padding: 0;
}

/* File input */
#wcpw-wrap input[type="file"]{
  padding: 8px 10px;
}

#wcpw-wrap input[type="file"]::file-selector-button{
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  color: #111827;
  font-weight: 900;
  letter-spacing: -.01em;
  margin-right: 10px;
}

#wcpw-wrap input[type="file"]::file-selector-button:hover{
  background:#f3f4f6;
  border-color:#cbd5e1;
}

#wcpw-wrap input[type="file"]::file-selector-button:active{
  transform: translateY(1px);
}

/* WebKit fallback */
#wcpw-wrap input[type="file"]::-webkit-file-upload-button{
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  color: #111827;
  font-weight: 900;
  letter-spacing: -.01em;
  margin-right: 10px;
}

.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button{
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  padding:9px 12px;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
  color:#111827;
  font-weight:800;
  letter-spacing: -.01em;
  line-height: 1.1;
}

.wcpw-btn:hover,
#wcpw-wrap button:hover,
.wcpw-modal button:hover{
  background:#f3f4f6;
  border-color:#cbd5e1;
}

.wcpw-btn:active,
#wcpw-wrap button:active,
.wcpw-modal button:active{
  transform: translateY(1px);
}

.wcpw-btn--primary{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
  box-shadow: 0 10px 24px rgba(37,99,235,.18);
}

.wcpw-btn--primary:hover{
  background:#1d4ed8;
  border-color:#1d4ed8;
}

.wcpw-btn--secondary{
  background:#f9fafb;
  border-color:#d1d5db;
  color:#111827;
}

.wcpw-cta{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

#wcpw-wrap .wcpw-trigger-add-to-cart{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
  font-weight:900;
  box-shadow: 0 10px 24px rgba(37,99,235,.18);
}

#wcpw-wrap .wcpw-trigger-add-to-cart:hover{
  background:#1d4ed8;
  border-color:#1d4ed8;
}

.wcpw-cart-missing small{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(220,38,38,.06);
  border:1px solid rgba(220,38,38,.18);
  color:#991b1b;
  font-weight:700;
}

/* Hide Woo default add-to-cart */
.woocommerce div.product [data-wcpw-root="1"][data-wcpw-hide-woo-cta="1"] ~ form.cart .single_add_to_cart_button,
.woocommerce div.product [data-wcpw-root="1"][data-wcpw-hide-woo-cta="1"] ~ form.cart button[type="submit"],
.woocommerce div.product [data-wcpw-root="1"][data-wcpw-hide-woo-cta="1"] ~ form.cart input[type="submit"]{
  display:none !important;
}

/* =========================
   Shapes + dims
   ========================= */
.wcpw-shapes{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.wcpw-shape{
  border:1px solid rgba(255,90,54,.35);
  padding:9px 16px;
  border-radius:999px;
  background:#ff5a36;
  cursor:pointer;
  color:#fff;
  font-weight:900;
  font-size:13px;
  transition:background .15s ease, box-shadow .15s ease, transform .05s ease;
}

.wcpw-shape:hover{
  background:#e84e2e;
  border-color:rgba(255,90,54,.5);
}

.wcpw-shape.active{
  background:#c93d20;
  border-color:#c93d20;
  box-shadow: 0 0 0 3px rgba(255,90,54,.28);
  color:#fff;
}

.wcpw-dims{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.wcpw-dims > div{
  flex:1 1 220px;
  min-width: 220px;
}

/* =========================
   Pricing grid
   ========================= */
#wcpw_price_grid{
  border:1px solid #eef2f7;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
}

.wcpw-grid{
  width:100%;
  border-collapse:collapse;
}

.wcpw-grid th,
.wcpw-grid td{
  border-bottom:1px solid #eef2f7;
  border-right:1px solid #eef2f7;
  padding:10px;
  text-align:center;
}

.wcpw-grid th{
  background:#f9fafb;
  font-weight:900;
  color:#111827;
  font-size: 13px;
}

.wcpw-grid td{
  cursor:pointer;
  background:#fff;
  font-weight:800;
}

.wcpw-grid td:hover{ background:rgba(255,90,54,.07); }

.wcpw-grid td.active{
  background:rgba(255,90,54,.13);
  outline: 2px solid rgba(255,90,54,.40);
  outline-offset: -2px;
  color:#c93d20;
  font-weight:900;
}

/* =========================
   Preview + Summary (STEP 1 colonna destra)
   ========================= */
.wcpw-preview{
  background:#fff;
  border:0;
  border-radius:14px;
  padding:14px;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
}

.wcpw-preview-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.wcpw-preview-title{
  font-weight:900;
  color:#111827;
  letter-spacing: -.01em;
}

.wcpw-preview-dims{
  font-size:12.5px;
  color:#6b7280;
  white-space:nowrap;
}

.wcpw-preview-unit{ opacity:.85; margin-left:2px; }

.wcpw-preview-stage{
  position:relative;
  width:100%;
  height:240px;
  min-height:240px;
  border-radius:18px;
  background:#f8fafc;
  overflow:hidden;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

.wcpw-preview-stage::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  pointer-events:none;
  background: radial-gradient(120% 120% at 50% 10%, rgba(255,255,255,.85) 0%, rgba(255,255,255,.35) 40%, rgba(255,255,255,0) 70%);
  z-index:0;
}

.wcpw-preview-surface{
  position:relative;
  height:100%;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px 34px 30px 40px;
  z-index:1;
}

/* wrapper (wizard.php) per ridurre la sagoma senza distorcere assi */
.wcpw-preview-svg-wrap{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* SVG preview: viewBox in mm deciso dal JS; qui solo sizing */
#wcpw_stage_preview{
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none;
}

/* anche se per errore l'href venisse impostato, non deve mai vedersi nel preview */
#wcpw_stage_preview image{
  display:none !important;
}

/* Assi (markup wizard: .wcpw-axis / .wcpw-axis-line / .wcpw-axis-label) */
.wcpw-preview-axes{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
  overflow:visible;
}

.wcpw-axis{
  position:absolute;
}

.wcpw-axis-line{
  position:absolute;
  background:rgba(17,24,39,.18);
}

/* Label pill (no spezzature "mm") */
.wcpw-axis-label{
  position:absolute;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(0,0,0,.06);
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  color:#111827;
  font-weight:900;
  white-space:nowrap;
}

/* Unità mm un po' meno invadente */
.wcpw-axis-unit{
  opacity:.85;
}

/* Asse X (larghezza) */
.wcpw-axis-x{
  left:40px;
  right:34px;
  bottom:10px;
  height:20px;
}

.wcpw-axis-x .wcpw-axis-line{
  left:0;
  right:0;
  top:9px;
  height:1px;
}

/* frecce X */
.wcpw-axis-x::before{
  content:"";
  position:absolute;
  left:0;
  top:6px;
  width:0;
  height:0;
  border-top:4px solid transparent;
  border-bottom:4px solid transparent;
  border-left:6px solid rgba(17,24,39,.22);
  transform: translateX(-1px);
}

.wcpw-axis-x::after{
  content:"";
  position:absolute;
  right:-1px;
  top:6px;
  width:0;
  height:0;
  border-top:4px solid transparent;
  border-bottom:4px solid transparent;
  border-right:6px solid rgba(17,24,39,.22);
}

.wcpw-axis-x .wcpw-axis-label{
  left:50%;
  top:-2px;
  transform:translateX(-50%);
}

/* Asse Y (altezza) */
.wcpw-axis-y{
  top:22px;
  bottom:26px;
  left:14px;
  width:20px;
}

.wcpw-axis-y .wcpw-axis-line{
  top:0;
  bottom:0;
  left:9px;
  width:1px;
}

/* frecce Y */
.wcpw-axis-y::before{
  content:"";
  position:absolute;
  top:-1px;
  left:6px;
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:6px solid rgba(17,24,39,.22);
}

.wcpw-axis-y::after{
  content:"";
  position:absolute;
  bottom:-1px;
  left:6px;
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-bottom:6px solid rgba(17,24,39,.22);
}

.wcpw-axis-y .wcpw-axis-label{
  left:9px;
  top:50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center center;
}

/* Summary */
.wcpw-summary{
  margin-top:12px;
  font-size:14px;
  color:#111827;
}

.wcpw-summary-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.wcpw-summary-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  color:#374151;
  background:#f3f4f6;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

.wcpw-total{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px;
  border-radius:16px;
  background:#f9fafb;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

.wcpw-total-label{
  color:#374151;
  font-weight:900;
  font-size: 13px;
}

.wcpw-total-value{
  color:#111827;
  font-weight:900;
  font-size: 16px;
  letter-spacing: -.01em;
}

/* =========================
   Editor (SVG stage)
   ========================= */
.wcpw-editor{
  border:0;
  border-radius:16px;
  padding:10px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
}

[data-wcpw-stage-wrap="editor"]{
  width:100%;
  height:560px;
  min-height:280px;
  max-height:720px;
  border-radius:16px;
  background:#ffffff;
  overflow:hidden;
  position:relative;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

/* wrapper interno (wizard.php) per creare respiro senza cambiare viewBox */
.wcpw-editor-svg-wrap{
  position:absolute;
  inset:16px;
}

/* SVG editor: viewBox in mm deciso dal JS; qui solo sizing */
#wcpw_stage_editor{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
  touch-action:none;
  pointer-events:auto;
  z-index:2;
}

#wcpw_stage_editor_canvas{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:1;
  will-change:contents;
}

.wcpw-editor-svg-wrap.wcpw-editor-has-compositor #wcpw_clip_group_editor{
  opacity:0;
}

/* Controls */
.wcpw-controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.wcpw-controls label{
  font-weight:900;
  font-size: 13px;
  color:#111827;
  margin:0;
}

/* Zoom + Rotazione: layout stabile, senza cambiare funzionalità */
.wcpw-controls-sliders{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 auto;
  min-width: 260px;
}

.wcpw-control{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 auto;
  min-width: 180px;
}

.wcpw-control--rotate{
  flex:0 0 210px;
  min-width: 180px;
}

.wcpw-control .wcpw-range{
  flex:1 1 auto;
  min-width: 140px;
}

/* Controlli editor: allineamento pulito tra Zoom, Rotazione e Reset */
@media (min-width: 521px){
  .wcpw-controls{
    align-items:flex-end;
    flex-wrap:nowrap;
  }
  .wcpw-controls-sliders{
    min-width:0;
  }
  .wcpw-control{
    min-width:0;
    min-height:48px;
  }
  .wcpw-controls .wcpw-btn{
    min-height:48px;
    line-height:1;
    padding:0 18px;
  }
}

@media (max-width: 520px){
  .wcpw-controls-sliders{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }
  .wcpw-control,
  .wcpw-control--rotate{
    width:100%;
    flex:1 1 auto;
  }
}

/* =========================
   SVG hardening + shape colors
   ========================= */
#wcpw-wrap svg{
  max-width:none !important;
}

/* stroke stabile */
#wcpw_stage_preview path,
#wcpw_stage_editor path{
  vector-effect: non-scaling-stroke;
}

/* preview non interattiva */
#wcpw_stage_preview{
  pointer-events: none !important;
}

/* in editor: drag sullo stage, non sui singoli nodi SVG */
#wcpw_stage_editor #wcpw_shape_fill_editor,
#wcpw_stage_editor #wcpw_shape_stroke_editor,
#wcpw_stage_editor #wcpw_shape_path_editor,
#wcpw_stage_editor image,
#wcpw_stage_editor #wcpw_bg_editor{
  pointer-events: none !important;
}

#wcpw_stage_editor{
  cursor: grab;
}

#wcpw_stage_editor.is-dragging{
  cursor: grabbing;
}

/* STEP-01: Shape fill editor — invisibile ma con geometria (no display:none) */
#wcpw-wrap #wcpw_shape_fill_editor{
  fill: none !important;
  fill-opacity: 0 !important;
  stroke: none !important;
  pointer-events: none !important;
}

/* STEP-01: Shape stroke editor — fascia abbondanza. Stile interamente gestito da JS. */
#wcpw-wrap #wcpw_shape_stroke_editor{
  opacity: 1 !important;
  pointer-events: none !important;
  /* fill, stroke, stroke-width, vector-effect tutti gestiti da JS */
}

/* Preview shape: giallo coerente */
#wcpw-wrap #wcpw_shape_fill_preview{
  display:block !important;
  fill: #FFD200 !important;
  fill-opacity: .28 !important;
  opacity: 1 !important;
  pointer-events:none !important;
}

#wcpw-wrap #wcpw_shape_stroke_preview{
  fill: none !important;
  stroke: rgba(17,24,39,.42) !important;
  stroke-opacity: 1 !important;
  stroke-width: 1px !important;
  opacity: 1 !important;
  vector-effect: non-scaling-stroke !important;
  pointer-events:none !important;
}

/* =========================================================
   STEP-01: Safeline / Cut line / Abbondanza
   - Preview: NASCOSTA (non deve mai comparire)
   - Editor $safe: linea INTERNA tratteggiata (taglio = dimensioni utente)
   - Editor $shapeStroke: linea ESTERNA solida (abbondanza)
   ========================================================= */
#wcpw_safe_preview{
  display: none !important;
}

/* Safeline editor = linea di taglio interna, tratteggiata verde */
#wcpw_safe_editor{
  fill: none !important;
  stroke: rgba(16,185,129,0.85) !important;
  stroke-opacity: 1 !important;
  stroke-dasharray: 5 3 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
  pointer-events: none !important;
}

/* =========================================================
   OBIETTIVO 2 (PDF taglio): eliminare la safeline dal PDF taglio
   - CSS non influisce sul PDF server-side
   ========================================================= */

/* =========================================================
   OBIETTIVO 3 (PDF stampa): crocini nel PDF stampa
   - CSS non influisce sul PDF server-side
   ========================================================= */

/* =========================
   Modals
   ========================= */
.wcpw-modal{
  position:fixed;
  inset:0;
  background:rgba(17,24,39,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding: 18px;
}

.wcpw-modal-inner{
  background:#fff;
  width:640px;
  max-width:92vw;
  border-radius:18px;
  padding:14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}

.wcpw-modal-wide{ width:900px; }

.wcpw-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  gap: 10px;
}

.wcpw-modal-title{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
}

.wcpw-draw-dims{
  font-size:12.5px;
  color:#6b7280;
  font-weight: 800;
}

/* Draw modal base rules consolidated later in the canonical UI refinement section. */

/* =========================
   Responsive
   ========================= */
@media (max-width: 980px){
  .wcpw-config-grid{
    grid-template-columns: 1fr;
    gap:16px;
  }

  [data-wcpw-stage-wrap="editor"]{
    height:520px;
  }

  .wcpw-preview-stage{
    height:220px;
    min-height:220px;
  }

  /* DRAW: su desktop/tablet manteniamo il layout a due colonne.
     Lo stacking panel→stage scatta solo nei breakpoint mobili canonici più in basso. */
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    flex-direction: row;
    align-items: stretch;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    flex: 0 0 340px;
    max-width: 340px;
    min-width: 300px;
    max-height: 100%;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    min-width: 360px;
    min-height: 540px;
    flex: 1 1 auto;
  }
}

@media (max-width: 520px){
  .wcpw-step{
    padding: 12px;
    border-radius: 16px;
  }

  .wcpw-preview-stage{
    height: 200px;
    min-height:200px;
  }

  [data-wcpw-stage-wrap="editor"]{
    height:380px;
    min-height:220px;
    max-height:460px;
  }

  .wcpw-editor-svg-wrap{
    inset:12px;
  }

  /* draw modal un po' più alta su mobile */
  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    max-height: 92vh;
  }

  #wcpw_draw_modal #wcpw_draw_area{
    min-height: 360px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    max-height: 32vh;
  }

  .wcpw-axis-label{
    font-size:11px;
    padding:4px 7px;
  }
}

/* =========================
   Estensioni profilo (cartoncini)
   - duplex upload
   - foro
   ========================= */

.wcpw-upload-duplex-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.wcpw-upload-duplex-row .wcpw-dim-label{
  min-width:64px;
  font-size:13px;
  opacity:.9;
}

.wcpw-hole-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.wcpw-toggle{
  display:flex;
  gap:10px;
  align-items:center;
  user-select:none;
}

.wcpw-hole-fields{
  display:none;
}

.wcpw-hole[data-hole-enabled="1"] .wcpw-hole-fields{
  display:block;
}

.wcpw-unit{
  font-size:13px;
  opacity:.9;
}

/* =========================
   Duplex toggle + Hole marker (UI only)
   ========================= */
.wcpw-side-toggle{
  display:flex;
  gap:8px;
  margin: 0 0 10px 0;
  align-items:center;
  flex-wrap:wrap;
}

.wcpw-side-btn{
  appearance:none;
  border:1px solid #d1d5db;
  background:#f9fafb;
  color:#111827;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}

.wcpw-side-btn:hover{
  background:#f3f4f6;
  border-color:#cbd5e1;
}

.wcpw-side-btn.is-active{
  background:#111827;
  border-color:#111827;
  color:#fff;
}

.wcpw-hole-marker{
  display:none;
  fill:none;
  stroke:#111827;
  stroke-opacity:.75;
  stroke-width:1.4;
  vector-effect: non-scaling-stroke;
  pointer-events:none;
}

.wcpw-hole-marker.is-visible{
  display:block;
}


/* =========================
   UI Restyle 2026
   ========================= */
.wcpw-root{
  --wcpw-bg:#f6f4f1;
  --wcpw-surface:#ffffff;
  --wcpw-surface-soft:#fbfaf8;
  --wcpw-border:#dfd9d2;
  --wcpw-border-strong:#cfc5bb;
  --wcpw-text:#1e293b;
  --wcpw-muted:#64748b;
  --wcpw-accent:#ff5a36;
  --wcpw-accent-dark:#eb4b28;
  --wcpw-accent-soft:#fff1ed;
  --wcpw-focus:0 0 0 3px rgba(255,90,54,.18);
  color:var(--wcpw-text);
  font-family:"Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#wcpw-wrap{
  margin:8px 0 34px;
}

.wcpw-header{
  margin:0 0 12px;
  padding:0;
}

.wcpw-title{
  margin:0 0 8px;
  font-size:clamp(2rem, 2.4vw, 2.9rem);
  line-height:1.02;
  font-weight:800;
  letter-spacing:-.05em;
  color:#1f2937;
  max-width:12ch;
}

.wcpw-subtitle{
  max-width:760px;
  font-size:1.03rem;
  line-height:1.6;
  color:var(--wcpw-muted);
}

.wcpw-muted,
.wcpw-hint{
  font-size:.95rem;
  line-height:1.55;
  color:var(--wcpw-muted);
}

.wcpw-inline-error,
.wcpw-cart-missing small{
  border-radius:0;
}

.wcpw-step{
  background:var(--wcpw-surface);
  border:1px solid var(--wcpw-border);
  border-radius:14px;
  padding:26px;
  margin-bottom:18px;
  box-shadow:none;
}

.wcpw-step-title{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 20px;
  padding-bottom:16px;
  border-bottom:1px solid #ebe5de;
  font-size:1.7rem;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.035em;
  color:#0f172a;
}

.wcpw-step-title::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:999px;
  background:var(--wcpw-accent);
  flex:0 0 auto;
}

.wcpw-label,
.wcpw-row label,
.wcpw-label-inline{
  color:#0f172a;
  font-size:1.08rem;
  font-weight:800;
  margin-bottom:10px;
}

.wcpw-row{ margin:18px 0; }

.wcpw-dim-label,
.wcpw-upload-duplex-row .wcpw-dim-label,
.wcpw-preview-dims,
.wcpw-total-label,
.wcpw-grid th,
.wcpw-unit{
  font-size:.92rem;
  letter-spacing:.02em;
}

.wcpw-custom-col,
.wcpw-preview,
.wcpw-editor,
.wcpw-total,
[data-wcpw-stage-wrap="editor"],
.wcpw-preview-stage{
  border-radius:12px;
  box-shadow:none;
}

.wcpw-custom-col,
.wcpw-preview,
.wcpw-total,
.wcpw-summary-badge,
.wcpw-preview-stage,
[data-wcpw-stage-wrap="editor"]{
  border:1px solid var(--wcpw-border);
}

.wcpw-custom-col,
.wcpw-total,
.wcpw-summary-badge,
.wcpw-preview-stage{
  background:var(--wcpw-surface-soft);
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap input[type="file"],
#wcpw-wrap select,
.wcpw-side-btn,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button{
  min-height:54px;
  border-radius:10px;
  border:1px solid var(--wcpw-border-strong);
  background:#fff;
  color:#0f172a;
  font-family:inherit;
  font-size:1rem;
  font-weight:700;
  box-shadow:none !important;
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap input[type="file"],
#wcpw-wrap select{
  padding:14px 16px;
}

#wcpw-wrap input[type="text"]:focus,
#wcpw-wrap input[type="number"]:focus,
#wcpw-wrap select:focus,
.wcpw-btn:focus,
#wcpw-wrap button:focus,
.wcpw-modal button:focus,
.wcpw-side-btn:focus{
  border-color:var(--wcpw-accent);
  box-shadow:var(--wcpw-focus) !important;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-shape,
.wcpw-side-btn{
  padding:0 18px;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-side-btn,
.wcpw-btn--secondary,
#wcpw-wrap .wcpw-trigger-save-draft{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

#wcpw-wrap input[type="file"]::file-selector-button:hover,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button:hover,
.wcpw-btn:hover,
#wcpw-wrap button:hover,
.wcpw-modal button:hover,
.wcpw-side-btn:hover,
.wcpw-btn--secondary:hover,
#wcpw-wrap .wcpw-trigger-save-draft:hover,
.wcpw-btn--primary:hover,
#wcpw-wrap .wcpw-trigger-add-to-cart:hover{
  background:var(--wcpw-accent-dark);
  border-color:var(--wcpw-accent-dark);
  color:#fff;
}

.wcpw-btn--primary,
#wcpw-wrap .wcpw-trigger-add-to-cart{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

.wcpw-shapes{
  gap:10px;
}

.wcpw-shape{
  border-radius:999px;
  font-weight:900;
}

.wcpw-shape.active{
  background:#c93d20;
  color:#fff;
  border-color:#c93d20;
  box-shadow:0 0 0 3px rgba(255,90,54,.28) !important;
}

.wcpw-hole-grid{
  gap:14px;
}

.wcpw-toggle,
.wcpw-check{
  display:inline-flex;
  align-items:center;
  gap:12px;
  user-select:none;
  font-size:1.05rem;
  font-weight:700;
  color:#0f172a;
}

.wcpw-toggle input[type="checkbox"],
.wcpw-check input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:44px;
  height:26px;
  border-radius:999px;
  background:#d7d2cb;
  border:none;
  position:relative;
  cursor:pointer;
  transition:background .18s ease;
  margin:0;
  flex:0 0 auto;
}

.wcpw-toggle input[type="checkbox"]::before,
.wcpw-check input[type="checkbox"]::before{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  transition:transform .18s ease;
}

.wcpw-toggle input[type="checkbox"]:checked,
.wcpw-check input[type="checkbox"]:checked{
  background:var(--wcpw-accent);
}

.wcpw-toggle input[type="checkbox"]:checked::before,
.wcpw-check input[type="checkbox"]:checked::before{
  transform:translateX(18px);
}

.wcpw-toggle input[type="checkbox"]:focus,
.wcpw-check input[type="checkbox"]:focus{
  outline:none;
  box-shadow:var(--wcpw-focus);
}

.wcpw-inline{
  gap:12px;
}

.wcpw-preview{
  padding:18px;
}

.wcpw-preview-head,
.wcpw-summary-head{
  margin-bottom:14px;
}

.wcpw-preview-title,
.wcpw-summary-head strong{
  font-size:1.32rem;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.03em;
}

.wcpw-summary-badge{
  padding:8px 12px;
  border-radius:999px;
  color:var(--wcpw-accent-dark);
  background:var(--wcpw-accent-soft);
  font-weight:800;
}

.wcpw-total{
  margin-top:16px;
  padding:16px 18px;
}

.wcpw-total-value{
  font-size:1.5rem;
  letter-spacing:-.04em;
}

#wcpw_price_grid{
  border:1px solid var(--wcpw-border);
  border-radius:0;
  box-shadow:none;
  overflow:hidden;
  background:#fff;
}

.wcpw-cta{
  gap:14px;
}

.wcpw-cta .wcpw-btn{
  min-width:220px;
}

.wcpw-controls{
  gap:14px;
}

.wcpw-controls .wcpw-btn{
  min-height:48px;
}

.wcpw-side-toggle{
  gap:10px;
  margin-bottom:14px;
}

.wcpw-side-btn.is-active{
  background:var(--wcpw-accent-dark);
  border-color:var(--wcpw-accent-dark);
  color:#fff;
}

.wcpw-preview-stage{
  background:#faf7f2;
}

[data-wcpw-stage-wrap="editor"]{
  background:#faf7f2;
}


@media (max-width: 980px){
  .wcpw-step{
    padding:22px;
  }

  .wcpw-step-title{
    font-size:1.45rem;
  }

  .wcpw-title{
    max-width:none;
  }
}

@media (max-width: 640px){
  .wcpw-header{
    margin-bottom:18px;
  }

  .wcpw-title{
    font-size:2rem;
  }

  .wcpw-subtitle{
    font-size:.98rem;
  }

  .wcpw-step{
    padding:18px;
    border-radius:12px;
  }

  .wcpw-step-title{
    font-size:1.28rem;
    margin-bottom:16px;
    padding-bottom:12px;
  }

  #wcpw-wrap input[type="text"],
  #wcpw-wrap input[type="number"],
  #wcpw-wrap input[type="file"],
  #wcpw-wrap select,
  .wcpw-shape,
  .wcpw-btn,
  #wcpw-wrap button,
  .wcpw-modal button,
  .wcpw-side-btn{
    min-height:50px;
    font-size:.97rem;
  }

  .wcpw-grid thead th,
  .wcpw-grid tbody td{
    padding:14px 10px;
  }

  .wcpw-grid tbody td{
    font-size:1rem;
  }

  .wcpw-cta .wcpw-btn{
    min-width:0;
    width:100%;
  }
}


/* =========================
   UI Refinement 2026-02
   ========================= */
.wcpw-header,
.wcpw-title,
.wcpw-subtitle{
  max-width:none;
  width:100%;
}

.wcpw-title{
  display:block;
  font-size:clamp(2.35rem, 4.6vw, 4.1rem);
  line-height:1.04;
  letter-spacing:-.055em;
  text-wrap:balance;
  margin-bottom:12px;
}

.wcpw-subtitle{
  max-width:980px;
  font-size:1.08rem;
  line-height:1.7;
}

.wcpw-step-title{
  font-size:1.85rem;
}

.wcpw-label,
.wcpw-row label,
.wcpw-label-inline{
  font-size:1.14rem;
}

.wcpw-dim-label,
.wcpw-upload-duplex-row .wcpw-dim-label{
  font-size:1rem;
  font-weight:700;
  color:#24364d;
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap select{
  min-height:48px;
  border-radius:12px;
  font-size:1rem;
}

.wcpw-shape,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-side-btn{
  min-height:44px;
  border-radius:10px;
  font-size:.96rem;
  font-weight:800;
  padding:0 16px;
}

.wcpw-shapes{
  gap:9px;
}

.wcpw-shape{
  min-width:0;
}

.wcpw-btn--secondary,
#wcpw-wrap .wcpw-trigger-save-draft,
#wcpw-wrap .wcpw-trigger-reset{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

#wcpw-wrap input[type="file"]{
  min-height:0;
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  font-size:.95rem;
  font-weight:600;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button{
  min-height:38px;
  margin-right:12px;
  padding:0 14px;
  border-radius:9px;
  border:1px solid var(--wcpw-border-strong);
  background:#f6f4f1;
  color:#0f172a;
  font-size:.95rem;
  font-weight:800;
  box-shadow:none !important;
}

#wcpw-wrap input[type="file"]::file-selector-button:hover,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button:hover{
  background:#efe9e2;
  border-color:#c9beb2;
  color:#0f172a;
}

.wcpw-custom-box{
  grid-template-columns:minmax(0,1fr) minmax(240px, .9fr);
  gap:14px;
}

.wcpw-custom-col{
  padding:12px 14px;
}

.wcpw-custom-col .wcpw-subtitle{
  margin-bottom:8px;
  font-size:1rem;
  line-height:1.4;
}

#wcpw_open_draw{
  align-self:flex-start;
}

#wcpw_draw_modal{
  padding:24px;
}

#wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
  width:min(1120px, 96vw);
  max-width:min(1120px, 96vw);
  max-height:min(92vh, 980px);
  padding:18px 20px 16px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

#wcpw_draw_modal .wcpw-modal-head{
  margin-bottom:16px;
  flex:0 0 auto;
}

#wcpw_draw_modal .wcpw-modal-title strong{
  font-size:1.5rem;
  line-height:1.1;
  letter-spacing:-.03em;
}

#wcpw_draw_modal .wcpw-draw-dims{
  font-size:.95rem;
}

#wcpw_draw_modal .wcpw-draw-shell{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}

#wcpw_draw_modal .wcpw-draw-body{
  flex:1 1 auto;
  min-height:0;
  display:flex;
}

#wcpw_draw_modal #wcpw_draw_area{
  flex:1 1 auto;
  min-height:0;
  position:relative;
  overflow:hidden;
  display:flex;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb{
  flex:1 1 auto;
  min-height:0;
  display:flex;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(280px, 320px) minmax(0, 1fr);
  gap:24px;
  align-items:stretch;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:12px;
  padding-right:6px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-head{
  margin-bottom:6px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-title{
  font-size:1rem;
  font-weight:700;
  color:#1f2937;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-sub,
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-hint{
  color:#667085;
  font-size:.93rem;
  line-height:1.45;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-hint{
  margin-top:2px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-params{
  display:flex;
  flex-direction:column;
  gap:14px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row,
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checkrow{
  margin:0;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-label{
  display:block;
  margin:0 0 6px;
  color:#344054;
  font-weight:600;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row .wcpw-psb-range{
  width:100%;
  display:block;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-value{
  margin-top:8px;
  display:flex;
  justify-content:flex-start;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select,
#wcpw_draw_modal #wcpw_draw_area [data-psb-num]{
  display:block;
  width:100%;
  min-height:44px;
  padding:10px 42px 10px 12px;
  border:1px solid rgba(17,24,39,.12);
  border-radius:12px;
  background-color:#fff;
  color:#1f2937;
  font-size:.96rem;
  line-height:1.2;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

#wcpw_draw_modal #wcpw_draw_area [data-psb-num]{
  width:92px;
  min-width:92px;
  padding-right:12px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select{
  -webkit-appearance:none;
  appearance:none;
  background-image:linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select:focus,
#wcpw_draw_modal #wcpw_draw_area [data-psb-num]:focus{
  outline:none;
  border-color:rgba(17,24,39,.12);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  color:#344054;
  font-weight:600;
  line-height:1.35;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel input[type="checkbox"]{
  margin:0;
  flex:0 0 auto;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
  min-width:0;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
  display:block;
  width:100%;
  height:100%;
  max-height:690px;
  background:#f8fafc;
  border:1px solid rgba(17,24,39,.08);
  border-radius:16px;
}

#wcpw_draw_modal #wcpw_draw_dims_overlay{
  position:absolute;
  left:12px;
  bottom:12px;
  z-index:5;
  pointer-events:none;
  padding:6px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.9);
  box-shadow:0 1px 2px rgba(16,24,40,.08);
  border:1px solid rgba(17,24,39,.10);
}

#wcpw_draw_modal .wcpw-draw-footer{
  flex:0 0 auto;
  margin-top:12px;
  padding-top:14px;
  border-top:1px solid rgba(17,24,39,.08);
}

#wcpw_draw_modal .wcpw-modal-actions--draw{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:10px;
}

#wcpw_draw_modal .wcpw-modal-actions--draw .wcpw-btn{
  min-height:48px;
  padding:0 18px;
  font-size:.96rem;
}

#wcpw_draw_modal .wcpw-draw-note{
  display:block;
  margin-top:12px;
  color:#667085;
  line-height:1.45;
}

@media (max-width: 980px){
  .wcpw-title{
    font-size:clamp(2.2rem, 7vw, 3.3rem);
  }

  .wcpw-custom-box{
    grid-template-columns:1fr;
  }

  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    width:min(96vw, 920px);
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    grid-template-columns:minmax(260px, 300px) minmax(0, 1fr);
    gap:20px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
    max-height:600px;
  }
}

@media (max-width: 640px){
  .wcpw-title{
    font-size:2.4rem;
  }

  .wcpw-subtitle{
    font-size:1rem;
  }

  .wcpw-step-title{
    font-size:1.5rem;
  }

  .wcpw-shape,
  .wcpw-btn,
  #wcpw-wrap button,
  .wcpw-modal button,
  .wcpw-side-btn{
    min-height:42px;
    font-size:.93rem;
    padding:0 14px;
  }

  #wcpw-wrap input[type="file"]::file-selector-button,
  #wcpw-wrap input[type="file"]::-webkit-file-upload-button{
    min-height:36px;
    margin-right:10px;
  }

  #wcpw_price_grid{
  border:1px solid #eef2f7;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
  }
}

.wcpw-grid{
  width:100%;
  border-collapse:collapse;
}

.wcpw-grid th,
.wcpw-grid td{
  border-bottom:1px solid #eef2f7;
  border-right:1px solid #eef2f7;
  padding:10px;
  text-align:center;
}

.wcpw-grid th{
  background:#f9fafb;
  font-weight:900;
  color:#111827;
  font-size: 13px;
}

.wcpw-grid td{
  cursor:pointer;
  background:#fff;
  font-weight:800;
}

.wcpw-grid td:hover{ background:rgba(255,90,54,.07); }

.wcpw-grid td.active{
  background:rgba(255,90,54,.13);
  outline: 2px solid rgba(255,90,54,.40);
  outline-offset: -2px;
  color:#c93d20;
  font-weight:900;
}

/* =========================
   Editor (SVG stage)
   ========================= */
.wcpw-editor{
  border:0;
  border-radius:16px;
  padding:10px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:
    0 1px 2px rgba(16,24,40,.06),
    0 10px 28px rgba(16,24,40,.06);
}

[data-wcpw-stage-wrap="editor"]{
  width:100%;
  height:560px;
  min-height:280px;
  max-height:720px;
  border-radius:16px;
  background:#ffffff;
  overflow:hidden;
  position:relative;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

/* wrapper interno (wizard.php) per creare respiro senza cambiare viewBox */
.wcpw-editor-svg-wrap{
  position:absolute;
  inset:16px;
}

/* SVG editor: viewBox in mm deciso dal JS; qui solo sizing */
#wcpw_stage_editor{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
  touch-action:none;
  pointer-events:auto;
}

/* Controls */
.wcpw-controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.wcpw-controls label{
  font-weight:900;
  font-size: 13px;
  color:#111827;
  margin:0;
}

/* Zoom + Rotazione: layout stabile, senza cambiare funzionalità */
.wcpw-controls-sliders{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 auto;
  min-width: 260px;
}

.wcpw-control{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 auto;
  min-width: 180px;
}

.wcpw-control--rotate{
  flex:0 0 210px;
  min-width: 180px;
}

.wcpw-control .wcpw-range{
  flex:1 1 auto;
  min-width: 140px;
}

/* Controlli editor: allineamento pulito tra Zoom, Rotazione e Reset */
@media (min-width: 521px){
  .wcpw-controls{
    align-items:flex-end;
    flex-wrap:nowrap;
  }
  .wcpw-controls-sliders{
    min-width:0;
  }
  .wcpw-control{
    min-width:0;
    min-height:48px;
  }
  .wcpw-controls .wcpw-btn{
    min-height:48px;
    line-height:1;
    padding:0 18px;
  }
}

@media (max-width: 520px){
  .wcpw-controls-sliders{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }
  .wcpw-control,
  .wcpw-control--rotate{
    width:100%;
    flex:1 1 auto;
  }
}

/* =========================
   SVG hardening + shape colors
   ========================= */
#wcpw-wrap svg{
  max-width:none !important;
}

/* stroke stabile */
#wcpw_stage_preview path,
#wcpw_stage_editor path{
  vector-effect: non-scaling-stroke;
}

/* preview non interattiva */
#wcpw_stage_preview{
  pointer-events: none !important;
}

/* in editor: drag sullo stage, non sui singoli nodi SVG */
#wcpw_stage_editor #wcpw_shape_fill_editor,
#wcpw_stage_editor #wcpw_shape_stroke_editor,
#wcpw_stage_editor #wcpw_shape_path_editor,
#wcpw_stage_editor image,
#wcpw_stage_editor #wcpw_bg_editor{
  pointer-events: none !important;
}

#wcpw_stage_editor{
  cursor: grab;
}

#wcpw_stage_editor.is-dragging{
  cursor: grabbing;
}

/* STEP-01: Shape fill editor — invisibile ma con geometria (no display:none) */
#wcpw-wrap #wcpw_shape_fill_editor{
  fill: none !important;
  fill-opacity: 0 !important;
  stroke: none !important;
  pointer-events: none !important;
}

/* STEP-01: Shape stroke editor — fascia abbondanza. Stile interamente gestito da JS. */
#wcpw-wrap #wcpw_shape_stroke_editor{
  opacity: 1 !important;
  pointer-events: none !important;
  /* fill, stroke, stroke-width, vector-effect tutti gestiti da JS */
}

/* Preview shape: giallo coerente */
#wcpw-wrap #wcpw_shape_fill_preview{
  display:block !important;
  fill: #FFD200 !important;
  fill-opacity: .28 !important;
  opacity: 1 !important;
  pointer-events:none !important;
}

#wcpw-wrap #wcpw_shape_stroke_preview{
  fill: none !important;
  stroke: rgba(17,24,39,.42) !important;
  stroke-opacity: 1 !important;
  stroke-width: 1px !important;
  opacity: 1 !important;
  vector-effect: non-scaling-stroke !important;
  pointer-events:none !important;
}

/* =========================================================
   STEP-01: Safeline / Cut line / Abbondanza
   - Preview: NASCOSTA (non deve mai comparire)
   - Editor $safe: linea INTERNA tratteggiata (taglio = dimensioni utente)
   - Editor $shapeStroke: linea ESTERNA solida (abbondanza)
   ========================================================= */
#wcpw_safe_preview{
  display: none !important;
}

/* Safeline editor = linea di taglio interna, tratteggiata verde */
#wcpw_safe_editor{
  fill: none !important;
  stroke: rgba(16,185,129,0.85) !important;
  stroke-opacity: 1 !important;
  stroke-dasharray: 5 3 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke;
  pointer-events: none !important;
}

/* =========================================================
   OBIETTIVO 2 (PDF taglio): eliminare la safeline dal PDF taglio
   - CSS non influisce sul PDF server-side
   ========================================================= */

/* =========================================================
   OBIETTIVO 3 (PDF stampa): crocini nel PDF stampa
   - CSS non influisce sul PDF server-side
   ========================================================= */

/* =========================
   Modals
   ========================= */
.wcpw-modal{
  position:fixed;
  inset:0;
  background:rgba(17,24,39,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding: 18px;
}

.wcpw-modal-inner{
  background:#fff;
  width:640px;
  max-width:92vw;
  border-radius:18px;
  padding:14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}

.wcpw-modal-wide{ width:900px; }

.wcpw-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  gap: 10px;
}

.wcpw-modal-title{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
}

.wcpw-draw-dims{
  font-size:12.5px;
  color:#6b7280;
  font-weight: 800;
}

/* Draw modal base rules consolidated later in the canonical UI refinement section. */

/* =========================
   Responsive
   ========================= */
@media (max-width: 980px){
  .wcpw-config-grid{
    grid-template-columns: 1fr;
    gap:16px;
  }

  [data-wcpw-stage-wrap="editor"]{
    height:520px;
  }

  .wcpw-preview-stage{
    height:220px;
    min-height:220px;
  }

  /* DRAW: su desktop/tablet manteniamo il layout a due colonne.
     Lo stacking panel→stage scatta solo nei breakpoint mobili canonici più in basso. */
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    flex-direction: row;
    align-items: stretch;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    flex: 0 0 340px;
    max-width: 340px;
    min-width: 300px;
    max-height: 100%;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    min-width: 360px;
    min-height: 540px;
    flex: 1 1 auto;
  }
}

@media (max-width: 520px){
  .wcpw-step{
    padding: 12px;
    border-radius: 16px;
  }

  .wcpw-preview-stage{
    height: 200px;
    min-height:200px;
  }

  [data-wcpw-stage-wrap="editor"]{
    height:380px;
    min-height:220px;
    max-height:460px;
  }

  .wcpw-editor-svg-wrap{
    inset:12px;
  }

  /* draw modal un po' più alta su mobile */
  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    max-height: 92vh;
  }

  #wcpw_draw_modal #wcpw_draw_area{
    min-height: 360px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    max-height: 32vh;
  }

  .wcpw-axis-label{
    font-size:11px;
    padding:4px 7px;
  }
}

/* =========================
   Estensioni profilo (cartoncini)
   - duplex upload
   - foro
   ========================= */

.wcpw-upload-duplex-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.wcpw-upload-duplex-row .wcpw-dim-label{
  min-width:64px;
  font-size:13px;
  opacity:.9;
}

.wcpw-hole-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.wcpw-toggle{
  display:flex;
  gap:10px;
  align-items:center;
  user-select:none;
}

.wcpw-hole-fields{
  display:none;
}

.wcpw-hole[data-hole-enabled="1"] .wcpw-hole-fields{
  display:block;
}

.wcpw-unit{
  font-size:13px;
  opacity:.9;
}

/* =========================
   Duplex toggle + Hole marker (UI only)
   ========================= */
.wcpw-side-toggle{
  display:flex;
  gap:8px;
  margin: 0 0 10px 0;
  align-items:center;
  flex-wrap:wrap;
}

.wcpw-side-btn{
  appearance:none;
  border:1px solid #d1d5db;
  background:#f9fafb;
  color:#111827;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}

.wcpw-side-btn:hover{
  background:#f3f4f6;
  border-color:#cbd5e1;
}

.wcpw-side-btn.is-active{
  background:#111827;
  border-color:#111827;
  color:#fff;
}

.wcpw-hole-marker{
  display:none;
  fill:none;
  stroke:#111827;
  stroke-opacity:.75;
  stroke-width:1.4;
  vector-effect: non-scaling-stroke;
  pointer-events:none;
}

.wcpw-hole-marker.is-visible{
  display:block;
}


/* =========================
   UI Restyle 2026
   ========================= */
.wcpw-root{
  --wcpw-bg:#f6f4f1;
  --wcpw-surface:#ffffff;
  --wcpw-surface-soft:#fbfaf8;
  --wcpw-border:#dfd9d2;
  --wcpw-border-strong:#cfc5bb;
  --wcpw-text:#1e293b;
  --wcpw-muted:#64748b;
  --wcpw-accent:#ff5a36;
  --wcpw-accent-dark:#eb4b28;
  --wcpw-accent-soft:#fff1ed;
  --wcpw-focus:0 0 0 3px rgba(255,90,54,.18);
  color:var(--wcpw-text);
  font-family:"Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#wcpw-wrap{
  margin:8px 0 34px;
}

.wcpw-header{
  margin:0 0 12px;
  padding:0;
}

.wcpw-title{
  margin:0 0 8px;
  font-size:clamp(2rem, 2.4vw, 2.9rem);
  line-height:1.02;
  font-weight:800;
  letter-spacing:-.05em;
  color:#1f2937;
  max-width:12ch;
}

.wcpw-subtitle{
  max-width:760px;
  font-size:1.03rem;
  line-height:1.6;
  color:var(--wcpw-muted);
}

.wcpw-muted,
.wcpw-hint{
  font-size:.95rem;
  line-height:1.55;
  color:var(--wcpw-muted);
}

.wcpw-inline-error,
.wcpw-cart-missing small{
  border-radius:0;
}

.wcpw-step{
  background:var(--wcpw-surface);
  border:1px solid var(--wcpw-border);
  border-radius:14px;
  padding:26px;
  margin-bottom:18px;
  box-shadow:none;
}

.wcpw-step-title{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 20px;
  padding-bottom:16px;
  border-bottom:1px solid #ebe5de;
  font-size:1.7rem;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.035em;
  color:#0f172a;
}

.wcpw-step-title::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:999px;
  background:var(--wcpw-accent);
  flex:0 0 auto;
}

.wcpw-label,
.wcpw-row label,
.wcpw-label-inline{
  color:#0f172a;
  font-size:1.08rem;
  font-weight:800;
  margin-bottom:10px;
}

.wcpw-row{ margin:18px 0; }

.wcpw-dim-label,
.wcpw-upload-duplex-row .wcpw-dim-label,
.wcpw-preview-dims,
.wcpw-total-label,
.wcpw-grid th,
.wcpw-unit{
  font-size:.92rem;
  letter-spacing:.02em;
}

.wcpw-custom-col,
.wcpw-preview,
.wcpw-editor,
.wcpw-total,
[data-wcpw-stage-wrap="editor"],
.wcpw-preview-stage{
  border-radius:12px;
  box-shadow:none;
}

.wcpw-custom-col,
.wcpw-preview,
.wcpw-total,
.wcpw-summary-badge,
.wcpw-preview-stage,
[data-wcpw-stage-wrap="editor"]{
  border:1px solid var(--wcpw-border);
}

.wcpw-custom-col,
.wcpw-total,
.wcpw-summary-badge,
.wcpw-preview-stage{
  background:var(--wcpw-surface-soft);
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap input[type="file"],
#wcpw-wrap select,
.wcpw-side-btn,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button{
  min-height:54px;
  border-radius:10px;
  border:1px solid var(--wcpw-border-strong);
  background:#fff;
  color:#0f172a;
  font-family:inherit;
  font-size:1rem;
  font-weight:700;
  box-shadow:none !important;
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap input[type="file"],
#wcpw-wrap select{
  padding:14px 16px;
}

#wcpw-wrap input[type="text"]:focus,
#wcpw-wrap input[type="number"]:focus,
#wcpw-wrap select:focus,
.wcpw-btn:focus,
#wcpw-wrap button:focus,
.wcpw-modal button:focus,
.wcpw-side-btn:focus{
  border-color:var(--wcpw-accent);
  box-shadow:var(--wcpw-focus) !important;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-shape,
.wcpw-side-btn{
  padding:0 18px;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-side-btn,
.wcpw-btn--secondary,
#wcpw-wrap .wcpw-trigger-save-draft{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

#wcpw-wrap input[type="file"]::file-selector-button:hover,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button:hover,
.wcpw-btn:hover,
#wcpw-wrap button:hover,
.wcpw-modal button:hover,
.wcpw-side-btn:hover,
.wcpw-btn--secondary:hover,
#wcpw-wrap .wcpw-trigger-save-draft:hover,
.wcpw-btn--primary:hover,
#wcpw-wrap .wcpw-trigger-add-to-cart:hover{
  background:var(--wcpw-accent-dark);
  border-color:var(--wcpw-accent-dark);
  color:#fff;
}

.wcpw-btn--primary,
#wcpw-wrap .wcpw-trigger-add-to-cart{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

.wcpw-shapes{
  gap:10px;
}

.wcpw-shape{
  border-radius:999px;
  font-weight:900;
}

.wcpw-shape.active{
  background:#c93d20;
  color:#fff;
  border-color:#c93d20;
  box-shadow:0 0 0 3px rgba(255,90,54,.28) !important;
}

.wcpw-hole-grid{
  gap:14px;
}

.wcpw-toggle,
.wcpw-check{
  display:inline-flex;
  align-items:center;
  gap:12px;
  user-select:none;
  font-size:1.05rem;
  font-weight:700;
  color:#0f172a;
}

.wcpw-toggle input[type="checkbox"],
.wcpw-check input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:44px;
  height:26px;
  border-radius:999px;
  background:#d7d2cb;
  border:none;
  position:relative;
  cursor:pointer;
  transition:background .18s ease;
  margin:0;
  flex:0 0 auto;
}

.wcpw-toggle input[type="checkbox"]::before,
.wcpw-check input[type="checkbox"]::before{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  transition:transform .18s ease;
}

.wcpw-toggle input[type="checkbox"]:checked,
.wcpw-check input[type="checkbox"]:checked{
  background:var(--wcpw-accent);
}

.wcpw-toggle input[type="checkbox"]:checked::before,
.wcpw-check input[type="checkbox"]:checked::before{
  transform:translateX(18px);
}

.wcpw-toggle input[type="checkbox"]:focus,
.wcpw-check input[type="checkbox"]:focus{
  outline:none;
  box-shadow:var(--wcpw-focus);
}

.wcpw-inline{
  gap:12px;
}

.wcpw-preview{
  padding:18px;
}

.wcpw-preview-head,
.wcpw-summary-head{
  margin-bottom:14px;
}

.wcpw-preview-title,
.wcpw-summary-head strong{
  font-size:1.32rem;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.03em;
}

.wcpw-summary-badge{
  padding:8px 12px;
  border-radius:999px;
  color:var(--wcpw-accent-dark);
  background:var(--wcpw-accent-soft);
  font-weight:800;
}

.wcpw-total{
  margin-top:16px;
  padding:16px 18px;
}

.wcpw-total-value{
  font-size:1.5rem;
  letter-spacing:-.04em;
}

#wcpw_price_grid{
  border:1px solid var(--wcpw-border);
  border-radius:0;
  box-shadow:none;
  overflow:hidden;
  background:#fff;
}

.wcpw-cta{
  gap:14px;
}

.wcpw-cta .wcpw-btn{
  min-width:220px;
}

.wcpw-controls{
  gap:14px;
}

.wcpw-controls .wcpw-btn{
  min-height:48px;
}

.wcpw-side-toggle{
  gap:10px;
  margin-bottom:14px;
}

.wcpw-side-btn.is-active{
  background:var(--wcpw-accent-dark);
  border-color:var(--wcpw-accent-dark);
  color:#fff;
}

.wcpw-preview-stage{
  background:#faf7f2;
}

[data-wcpw-stage-wrap="editor"]{
  background:#faf7f2;
}


@media (max-width: 980px){
  .wcpw-step{
    padding:22px;
  }

  .wcpw-step-title{
    font-size:1.45rem;
  }

  .wcpw-title{
    max-width:none;
  }
}

@media (max-width: 640px){
  .wcpw-header{
    margin-bottom:18px;
  }

  .wcpw-title{
    font-size:2rem;
  }

  .wcpw-subtitle{
    font-size:.98rem;
  }

  .wcpw-step{
    padding:18px;
    border-radius:12px;
  }

  .wcpw-step-title{
    font-size:1.28rem;
    margin-bottom:16px;
    padding-bottom:12px;
  }

  #wcpw-wrap input[type="text"],
  #wcpw-wrap input[type="number"],
  #wcpw-wrap input[type="file"],
  #wcpw-wrap select,
  .wcpw-shape,
  .wcpw-btn,
  #wcpw-wrap button,
  .wcpw-modal button,
  .wcpw-side-btn{
    min-height:50px;
    font-size:.97rem;
  }

  .wcpw-grid thead th,
  .wcpw-grid tbody td{
    padding:14px 10px;
  }

  .wcpw-grid tbody td{
    font-size:1rem;
  }

  .wcpw-cta .wcpw-btn{
    min-width:0;
    width:100%;
  }
}


/* =========================
   UI Refinement 2026-02
   ========================= */
.wcpw-header,
.wcpw-title,
.wcpw-subtitle{
  max-width:none;
  width:100%;
}

.wcpw-title{
  display:block;
  font-size:clamp(2.35rem, 4.6vw, 4.1rem);
  line-height:1.04;
  letter-spacing:-.055em;
  text-wrap:balance;
  margin-bottom:12px;
}

.wcpw-subtitle{
  max-width:980px;
  font-size:1.08rem;
  line-height:1.7;
}

.wcpw-step-title{
  font-size:1.85rem;
}

.wcpw-label,
.wcpw-row label,
.wcpw-label-inline{
  font-size:1.14rem;
}

.wcpw-dim-label,
.wcpw-upload-duplex-row .wcpw-dim-label{
  font-size:1rem;
  font-weight:700;
  color:#24364d;
}

#wcpw-wrap input[type="text"],
#wcpw-wrap input[type="number"],
#wcpw-wrap select{
  min-height:48px;
  border-radius:12px;
  font-size:1rem;
}

.wcpw-shape,
.wcpw-btn,
#wcpw-wrap button,
.wcpw-modal button,
.wcpw-side-btn{
  min-height:44px;
  border-radius:10px;
  font-size:.96rem;
  font-weight:800;
  padding:0 16px;
}

.wcpw-shapes{
  gap:9px;
}

.wcpw-shape{
  min-width:0;
}

.wcpw-btn--secondary,
#wcpw-wrap .wcpw-trigger-save-draft,
#wcpw-wrap .wcpw-trigger-reset{
  background:var(--wcpw-accent);
  border-color:var(--wcpw-accent);
  color:#fff;
}

#wcpw-wrap input[type="file"]{
  min-height:0;
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  font-size:.95rem;
  font-weight:600;
}

#wcpw-wrap input[type="file"]::file-selector-button,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button{
  min-height:38px;
  margin-right:12px;
  padding:0 14px;
  border-radius:9px;
  border:1px solid var(--wcpw-border-strong);
  background:#f6f4f1;
  color:#0f172a;
  font-size:.95rem;
  font-weight:800;
  box-shadow:none !important;
}

#wcpw-wrap input[type="file"]::file-selector-button:hover,
#wcpw-wrap input[type="file"]::-webkit-file-upload-button:hover{
  background:#efe9e2;
  border-color:#c9beb2;
  color:#0f172a;
}

.wcpw-custom-box{
  grid-template-columns:minmax(0,1fr) minmax(240px, .9fr);
  gap:14px;
}

.wcpw-custom-col{
  padding:12px 14px;
}

.wcpw-custom-col .wcpw-subtitle{
  margin-bottom:8px;
  font-size:1rem;
  line-height:1.4;
}

#wcpw_open_draw{
  align-self:flex-start;
}

#wcpw_draw_modal{
  padding:24px;
}

#wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
  width:min(1120px, 96vw);
  max-width:min(1120px, 96vw);
  max-height:min(92vh, 980px);
  padding:18px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}


#wcpw_draw_modal #wcpw_draw_area .wcpw-psb{
  height:100%;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
  display:flex;
  gap:20px;
  min-height:100%;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-head{
  margin-bottom:14px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-title{
  font-size:1rem;
  font-weight:700;
  color:#1f2937;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-sub,
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-hint{
  color:#667085;
  font-size:.93rem;
  line-height:1.45;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row{
  margin-bottom:14px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-rowhead{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:8px;
  margin-bottom:8px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-label{
  display:block;
  margin:0;
  color:#344054;
  font-weight:600;
}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row > .wcpw-psb-label{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  min-height:24px;
}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row > .wcpw-psb-label input[type="checkbox"]{
  margin:0;
  flex:0 0 auto;
}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-row > .wcpw-psb-label span{
  line-height:1.35;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select,
#wcpw_draw_modal #wcpw_draw_area [data-psb-num]{
  display:block;
  width:100%;
  min-height:44px;
  padding:10px 42px 10px 12px;
  border:1px solid rgba(17,24,39,.12);
  border-radius:12px;
  background-color:#fff;
  color:#1f2937;
  font-size:.96rem;
  line-height:1.2;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

#wcpw_draw_modal #wcpw_draw_area [data-psb-num]{
  width:92px;
  min-width:92px;
  padding-right:12px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select{
  -webkit-appearance:none;
  appearance:none;
  background-image:linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-select:focus{
  outline:none;
  border-color:rgba(17,24,39,.12);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

#wcpw_draw_modal #wcpw_draw_area [data-psb-num]:focus{
  outline:none;
  border-color:rgba(255,94,52,.55);
  box-shadow:0 0 0 4px rgba(255,94,52,.14);
}



#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
  flex:1 1 auto;
  display:flex;
  align-items:stretch;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
  display:block;
  width:100%;
  height:100%;
  min-height:inherit;
  background:#f8fafc;
  border:1px solid rgba(17,24,39,.08);
  border-radius:16px;
}

#wcpw_draw_modal .wcpw-modal-head{
  margin-bottom:14px;
}

#wcpw_draw_modal .wcpw-modal-title strong{
  font-size:1.5rem;
  line-height:1.1;
  letter-spacing:-.03em;
}

#wcpw_draw_modal .wcpw-draw-dims{
  font-size:.95rem;
}

#wcpw_draw_modal #wcpw_draw_area{
  flex:1 1 auto;
  min-height:0;
  position:relative;
  overflow:hidden;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
  min-height:100%;
  align-items:flex-start;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
  flex:0 0 340px;
  max-width:340px;
  min-width:300px;
  max-height:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:10px;
  padding-bottom:18px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
  min-width:360px;
  min-height:540px;
}

#wcpw_draw_modal .wcpw-modal-actions--draw{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:10px;
  padding-top:18px;
  margin-top:42px;
  position:sticky;
  bottom:0;
  background:#fff;
  border-top:1px solid rgba(17,24,39,.08);
}

/* Overlay dimensioni sullo stage (in basso a sinistra). */
#wcpw_draw_modal #wcpw_draw_dims_overlay{
  position:absolute;
  left:12px;
  bottom:-44px;
  z-index:5;
  pointer-events:none;
  padding:6px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.9);
  box-shadow:0 1px 2px rgba(16,24,40,.08);
  border:1px solid rgba(17,24,39,.10);
}

#wcpw_draw_modal .wcpw-modal-actions--draw .wcpw-btn{
  min-height:40px;
  padding:0 14px;
  font-size:.92rem;
}

#wcpw_price_grid{
  border:none;
  background:transparent;
  overflow:visible;
}

.wcpw-grid thead th{
  background:#f3efe9;
  font-size:.82rem;
  letter-spacing:.12em;
  padding:16px 14px;
}

.wcpw-grid tbody td{
  padding:20px 14px;
  font-size:1.08rem;
}

.wcpw-grid td.active{
  background:rgba(255,90,54,.13);
  outline: 2px solid rgba(255,90,54,.40);
  outline-offset: -2px;
  color:#c93d20;
  font-weight:900;
}

@media (max-width: 980px){
  .wcpw-title{
    font-size:clamp(2.2rem, 7vw, 3.3rem);
  }

  .wcpw-custom-box{
    grid-template-columns:1fr;
  }

  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    width:min(96vw, 920px);
  }

  #wcpw_draw_modal #wcpw_draw_area{
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    flex:0 0 320px;
    max-width:320px;
    min-width:280px;
    overflow:auto;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    min-width:320px;
    min-height:480px;
    flex:1 1 auto;
  }
}

@media (max-width: 640px){
  .wcpw-title{
    font-size:2.4rem;
  }

  .wcpw-subtitle{
    font-size:1rem;
  }

  .wcpw-step-title{
    font-size:1.5rem;
  }

  .wcpw-shape,
  .wcpw-btn,
  #wcpw-wrap button,
  .wcpw-modal button,
  .wcpw-side-btn{
    min-height:42px;
    font-size:.93rem;
    padding:0 14px;
  }

  #wcpw-wrap input[type="file"]::file-selector-button,
  #wcpw-wrap input[type="file"]::-webkit-file-upload-button{
    min-height:36px;
    margin-right:10px;
  }

  #wcpw_draw_modal{
    padding:10px;
  }

  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    max-height:94vh;
    padding:14px;
  }

  #wcpw_draw_modal #wcpw_draw_area{
    min-height:380px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    flex-direction:column;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    flex:0 0 auto;
    max-width:100%;
    min-width:0;
    max-height:none;
    overflow:visible;
    padding-right:0;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    min-width:0;
    min-height:320px;
  }

  #wcpw_draw_modal #wcpw_draw_dims_overlay{
    left:10px;
    bottom:-42px;
  }

  #wcpw_draw_modal .wcpw-modal-actions--draw{
    justify-content:stretch;
  }

  #wcpw_draw_modal .wcpw-modal-actions--draw .wcpw-btn{
    flex:1 1 calc(50% - 8px);
  }

  #wcpw_draw_modal #wcpw_draw_area [data-psb-num]{
    width:84px;
    min-width:84px;
  }
}

@media (max-width:420px){ .wcpw-modal-presets .wcpw-presets-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; } .wcpw-modal-presets .wcpw-preset-card{ min-height:106px; padding:10px 8px 9px; } .wcpw-modal-presets .wcpw-preset-preview{ width:72px; height:56px; } .wcpw-modal-presets .wcpw-preset-preview svg{ width:48px; height:48px; } .wcpw-modal-presets .wcpw-preset-label{ font-size:12px; } }

.wcpw-modal-presets button.wcpw-preset-card{ background:#ffffff !important; }


/* Hardening duplicato rimosso: resta solo la versione canonica nella sezione background. */

/* ---------------------------------
   Controls hardening (theme/Elementor)
   --------------------------------- */
#wcpw-wrap .wcpw-controls input[type="range"]{
  margin:0;
  max-width:100%;
  box-shadow:none;
}
#wcpw-wrap .wcpw-controls button,
#wcpw-wrap .wcpw-controls .wcpw-btn{
  text-decoration:none;
}
#wcpw-wrap .wcpw-controls .wcpw-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


/* Preview FOUC guard */


/* Background swatches mobile grid (3 + 3 + (Nessuno + Personalizza)) */
@media (max-width: 520px){
  #wcpw-wrap .wcpw-bg-row{
    display:grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap:10px;
    align-items:stretch;
  }

  /* Default swatches: 3 per row */
  #wcpw-wrap .wcpw-bg-row > .wcpw-bg-swatch{
    grid-column: span 2;
    width:auto;
    min-height:44px;
    padding:8px 10px;
    border-radius:14px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
  }

  #wcpw-wrap .wcpw-bg-swatch-dot{
    width:18px;
    height:18px;
    border-radius:999px;
    flex:0 0 18px;
  }

  /* Last row: half + half */
  #wcpw-wrap .wcpw-bg-row > .wcpw-bg-swatch.is-none{
    grid-column: span 3;
    justify-content:flex-start;
    padding-left:12px;
  }

  #wcpw-wrap .wcpw-bg-picker-wrap{
    grid-column: span 3;
    display:flex;
  }
  #wcpw-wrap .wcpw-bg-picker{
    width:100%;
    justify-content:flex-start;
    padding-left:12px;
    min-height:44px;
    line-height:1;
    display:flex;
    align-items:center;
    gap:10px;
  }

  #wcpw-wrap .wcpw-bg-swatch-label,
  #wcpw-wrap .wcpw-bg-picker-label{
    font-size:14px;
    font-weight:900;
    line-height:1;
    white-space:nowrap;
  }
}


/* Draw modal final cleanup: remove inline dimensions, keep stage centered */
#wcpw_draw_modal .wcpw-modal-title{display:flex;align-items:center;gap:0;}
#wcpw_draw_modal .wcpw-draw-dims,
#wcpw_draw_modal #wcpw_draw_dims_overlay{display:none !important;}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{display:flex;align-items:center;justify-content:center;overflow:hidden;}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{margin:0 auto;display:block;max-width:100%;max-height:100%;}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checkrow{margin-top:10px;}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel{justify-content:flex-start;gap:10px;text-align:left;}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel span{display:inline-block;line-height:1.3;}

@media (max-width: 767px){
  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{padding-top:18px;}
  #wcpw_draw_modal .wcpw-modal-head{padding-top:4px;padding-bottom:10px;}
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{justify-content:center;align-items:center;min-height:0;}
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{width:min(100%, 240px);height:auto;max-height:240px;}
}


/* === Draw modal final hardening: remove draw dims, keep stage centered only === */
#wcpw_draw_modal .wcpw-draw-shell,
#wcpw_draw_modal .wcpw-draw-body,
#wcpw_draw_modal #wcpw_draw_area,
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb{
  min-height:0;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
  display:grid;
  grid-template-columns:minmax(250px, 290px) minmax(0, 1fr);
  gap:22px;
  align-items:start;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:stretch;
  gap:14px;
  min-height:0;
  overflow:visible;
  padding-right:0;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-params{
  gap:16px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checkrow{
  display:flex;
  align-items:center;
  margin-top:2px;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width:100%;
  text-align:left;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel span{
  display:block;
  flex:0 1 auto;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:0;
  max-height:560px;
  overflow:hidden;
}

#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  max-height:min(62vh, 560px);
  margin:0 auto;
}

/* Nuke any residual draw dimensions UI regardless of previous layers */
#wcpw_draw_modal .wcpw-draw-dims,
#wcpw_draw_modal #wcpw_draw_dims_overlay,
#wcpw_draw_modal [id*="draw_dims"],
#wcpw_draw_modal [class*="draw-dims"]{
  display:none !important;
}

@media (max-width: 767px){
  #wcpw_draw_modal{
    padding:12px;
  }

  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    width:min(92vw, 360px);
    max-height:92vh;
    padding:14px 12px 12px;
    overflow:auto;
  }

  #wcpw_draw_modal .wcpw-modal-head{
    padding-top:8px;
    padding-bottom:12px;
  }

  #wcpw_draw_modal .wcpw-modal-title strong{
    display:block;
    margin-top:2px;
  }

  #wcpw_draw_modal .wcpw-draw-shell,
  #wcpw_draw_modal .wcpw-draw-body,
  #wcpw_draw_modal #wcpw_draw_area,
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb{
    display:block;
    overflow:visible;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    grid-template-columns:1fr;
    gap:16px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-panel{
    gap:12px;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    width:100%;
    max-height:none;
    min-height:0;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
    width:min(100%, 220px);
    max-width:220px;
    height:auto;
    max-height:none;
    margin:0 auto;
  }

  #wcpw_draw_modal .wcpw-draw-footer{
    margin-top:14px;
  }
}


/* Final mobile alignment fixes for custom shape builder */
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checkrow{
  justify-content:flex-start;
  align-items:flex-start;
}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel{
  width:auto;
  max-width:100%;
  display:inline-flex;
  align-items:flex-start;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:nowrap;
}
#wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checktext{
  display:block;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
}

@media (max-width: 767px){
  #wcpw_draw_modal .wcpw-modal-inner.wcpw-modal-wide{
    width:min(92vw, 380px);
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-grid{
    gap:18px;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-stage{
    width:100%;
    min-height:260px;
    padding:8px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-svg{
    width:100%;
    max-width:none;
    max-height:320px;
    margin:0 auto;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checkrow{
    width:100%;
    margin-top:4px;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel{
    width:100%;
    display:flex;
    align-items:flex-start;
    justify-content:flex-start;
    gap:8px;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checklabel input[type="checkbox"]{
    flex:0 0 auto;
    margin-top:2px;
  }
  #wcpw_draw_modal #wcpw_draw_area .wcpw-psb-checktext{
    flex:1 1 auto;
    min-width:0;
  }
}

/* Material info modal */
.wcpw-material-modal{
  display:grid;
  grid-template-columns:minmax(0, 168px) minmax(0, 1fr);
  gap:22px;
  align-items:start;
}
.wcpw-material-modal__media{
  width:min(100%, 168px);
  aspect-ratio:1 / 1;
  background:#f7f7f7;
  border:1px solid #e4e4e4;
  border-radius:14px;
  overflow:hidden;
}
.wcpw-material-modal__media img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.wcpw-material-modal__body{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding-top:2px;
}
.wcpw-material-modal__title{
  margin:0;
  font-size:20px;
  line-height:1.25;
}
.wcpw-material-modal__text{
  margin:0;
  line-height:1.65;
  color:#344054;
}
.wcpw-material-modal__gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(78px, 92px));
  gap:10px;
  margin-top:2px;
}
.wcpw-material-modal__thumb{
  aspect-ratio:1 / 1;
  background:#f7f7f7;
  border:1px solid #e4e4e4;
  border-radius:10px;
  overflow:hidden;
}
.wcpw-material-modal__thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
#wcpw_modal .wcpw-modal-inner{
  max-width:680px;
}
#wcpw_modal #wcpw_modal_content{
  margin-bottom:18px;
}
#wcpw_modal #wcpw_modal_close{
  margin-top:0;
}
@media (max-width: 640px){
  .wcpw-material-modal{
    grid-template-columns:1fr;
    gap:16px;
  }
  .wcpw-material-modal__media{
    width:min(100%, 180px);
    margin:0 auto;
  }
  .wcpw-material-modal__body{
    gap:12px;
  }
  .wcpw-material-modal__title{
    font-size:18px;
  }
  .wcpw-material-modal__gallery{
    grid-template-columns:repeat(auto-fit, minmax(72px, 84px));
  }
}

/* Pricing table refinement */
#wcpw_price_grid{
  border:1px solid #efe3d7;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04), 0 12px 28px rgba(16,24,40,.05);
}

#wcpw_price_grid .wcpw-quote-builder{
  background:#fff;
}

#wcpw_price_grid .wcpw-grid{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}

#wcpw_price_grid .wcpw-grid--sheet-rules thead th,
#wcpw_price_grid .wcpw-grid--sheet-rules tbody th{
  background:var(--wcpw-accent);
  color:#fff;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  border-right:1px solid rgba(255,255,255,.18);
  border-bottom:1px solid #f0ddd1;
  padding:15px 14px;
}

#wcpw_price_grid .wcpw-grid--sheet-rules thead th:last-child,
#wcpw_price_grid .wcpw-grid--sheet-rules tbody th:last-child{
  border-right:none;
}

#wcpw_price_grid .wcpw-grid--sheet-rules thead th:first-child,
#wcpw_price_grid .wcpw-grid--sheet-rules tbody th{
  width:34%;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody th{
  font-size:1rem;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody td{
  position:relative;
  cursor:pointer;
  background:#fff;
  color:#24364d;
  font-weight:800;
  text-align:center;
  vertical-align:middle;
  padding:16px 14px;
  border-right:1px solid #f1e6db;
  border-bottom:1px solid #f1e6db;
  transition:background .18s ease, box-shadow .18s ease, color .18s ease;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody td:last-child{
  border-right:none;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody tr:last-child td,
#wcpw_price_grid .wcpw-grid--sheet-rules tbody tr:last-child th{
  border-bottom:1px solid #f1e6db;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody td:hover{
  background:#fff6f1;
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody td.active{
  background:#fff1e8;
  color:#c84e21;
  box-shadow:inset 0 0 0 2px rgba(255,94,52,.35);
}

#wcpw_price_grid .wcpw-grid--sheet-rules tbody td.active::after{
  content:'';
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:var(--wcpw-accent);
}

#wcpw_price_grid .wcpw-quote-custom-panel{
  margin-top:14px;
  border:1px solid #f1e6db;
  border-radius:18px;
  background:#fff8f3;
  box-shadow:0 8px 22px rgba(25,39,58,.06);
  overflow:hidden;
}

#wcpw_price_grid .wcpw-quote-custom-panel__inner{
  display:grid;
  grid-template-columns:minmax(220px, 1.3fr) minmax(140px, .8fr) minmax(140px, .8fr) minmax(150px, .85fr);
  align-items:stretch;
  gap:12px;
  padding:14px;
}

#wcpw_price_grid .wcpw-quote-custom-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

#wcpw_price_grid .wcpw-quote-custom-title{
  margin:0;
  font-size:.98rem;
  font-weight:800;
  color:#24364d;
}

#wcpw_price_grid .wcpw-quote-custom-field .wcpw-input{
  width:100%;
  min-width:0;
  height:56px;
}

#wcpw_price_grid .wcpw-quote-custom-delivery{
  min-height:56px;
  height:56px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:2px;
  width:100%;
  box-sizing:border-box;
  overflow:hidden;
  appearance:none;
  -webkit-appearance:none;
  text-align:left;
  line-height:1.2;
  white-space:normal;
  border-radius:14px;
  padding:10px 16px;
}

#wcpw_price_grid .wcpw-quote-custom-delivery::-webkit-scrollbar{
  display:none;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__label,
#wcpw_price_grid .wcpw-quote-custom-delivery__price{
  display:block;
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__label{
  font-size:.92rem;
  font-weight:800;
  line-height:1.2;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__price{
  font-size:1rem;
  font-weight:900;
  line-height:1.2;
}

#wcpw_price_grid .wcpw-quote-custom-delivery.active{
  border-color:rgba(255,94,52,.42);
  background:#fff1e8;
  color:#c84e21;
  box-shadow:inset 0 0 0 2px rgba(255,94,52,.18);
}

#wcpw_price_grid .wcpw-quote-custom-preview{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  min-height:56px;
  height:56px;
  padding:10px 16px;
  border:1px solid #f1e6db;
  border-radius:14px;
  background:#fff;
}

#wcpw_price_grid .wcpw-quote-custom-preview__label{
  font-size:.8rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#7a8696;
}

#wcpw_price_grid .wcpw-quote-custom-preview__price{
  font-size:1.08rem;
  font-weight:900;
  color:#24364d;
  line-height:1.2;
}

@media (max-width: 767px){
  #wcpw_price_grid .wcpw-grid--sheet-rules thead th,
  #wcpw_price_grid .wcpw-grid--sheet-rules tbody th,
  #wcpw_price_grid .wcpw-grid--sheet-rules tbody td{
    padding:12px 10px;
  }

  #wcpw_price_grid .wcpw-grid--sheet-rules thead th:first-child,
  #wcpw_price_grid .wcpw-grid--sheet-rules tbody th{
    width:40%;
  }

  #wcpw_price_grid .wcpw-quote-custom-panel{
    margin-top:12px;
    border-radius:16px;
  }

  #wcpw_price_grid .wcpw-quote-custom-panel__inner{
    grid-template-columns:1fr;
    gap:10px;
    padding:12px;
  }

  #wcpw_price_grid .wcpw-quote-custom-title{
    font-size:.92rem;
  }

  #wcpw_price_grid .wcpw-quote-custom-field .wcpw-input,
  #wcpw_price_grid .wcpw-quote-custom-delivery,
  #wcpw_price_grid .wcpw-quote-custom-preview{
    min-height:48px;
    height:48px;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery,
  #wcpw_price_grid .wcpw-quote-custom-preview{
    align-items:stretch;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery{
    padding:8px 14px;
  }
}

/* Editor controls spacing */
#wcpw-wrap .wcpw-controls{
  display:flex;
  align-items:flex-end;
  gap:18px;
  flex-wrap:wrap;
}

#wcpw-wrap .wcpw-controls-sliders{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(220px, .85fr);
  gap:16px 18px;
  flex:1 1 460px;
  min-width:260px;
}

#wcpw-wrap .wcpw-control{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

#wcpw-wrap .wcpw-control--rotate{
  margin-right:0;
}

#wcpw-wrap .wcpw-control .wcpw-range{
  flex:1 1 auto;
  min-width:0;
}

#wcpw-wrap #wcpw_reset{
  margin-left:0;
  min-width:148px;
  align-self:flex-end;
}

@media (max-width: 767px){
  #wcpw-wrap .wcpw-controls{
    align-items:stretch;
    gap:14px;
  }

  #wcpw-wrap .wcpw-controls-sliders{
    grid-template-columns:1fr;
    gap:12px;
    width:100%;
    min-width:0;
  }

  #wcpw-wrap .wcpw-control{
    width:100%;
  }

  #wcpw-wrap #wcpw_reset{
    width:100%;
    min-width:0;
  }
}


#wcpw_price_grid .wcpw-quote-custom-field .wcpw-input,
#wcpw_price_grid .wcpw-quote-custom-preview,
#wcpw_price_grid .wcpw-quote-custom-delivery{
  box-sizing:border-box;
}

/* Final robust fix: custom delivery buttons and preview alignment */
#wcpw_price_grid .wcpw-quote-custom-panel__inner{
  align-items:center;
}

#wcpw_price_grid .wcpw-quote-custom-field .wcpw-input,
#wcpw_price_grid .wcpw-quote-custom-delivery,
#wcpw_price_grid .wcpw-quote-custom-preview{
  min-height:60px;
}

#wcpw_price_grid .wcpw-quote-custom-field .wcpw-input{
  height:60px;
}

#wcpw_price_grid .wcpw-quote-custom-delivery{
  height:auto;
  min-height:60px;
  padding:10px 16px;
  justify-content:center;
  gap:3px;
  overflow:visible;
  white-space:normal;
  line-height:1.15;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__label,
#wcpw_price_grid .wcpw-quote-custom-delivery__price{
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  word-break:normal;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__label{
  font-size:.92rem;
  line-height:1.15;
}

#wcpw_price_grid .wcpw-quote-custom-delivery__price{
  font-size:1rem;
  line-height:1.15;
}

#wcpw_price_grid .wcpw-quote-custom-preview{
  height:auto;
  min-height:60px;
  justify-content:center;
  padding:10px 16px;
}

#wcpw_price_grid .wcpw-quote-custom-preview__label,
#wcpw_price_grid .wcpw-quote-custom-preview__price{
  line-height:1.15;
}

@media (max-width: 767px){
  #wcpw_price_grid .wcpw-quote-custom-panel__inner{
    align-items:stretch;
    gap:12px;
  }

  #wcpw_price_grid .wcpw-quote-custom-field .wcpw-input,
  #wcpw_price_grid .wcpw-quote-custom-delivery,
  #wcpw_price_grid .wcpw-quote-custom-preview{
    min-height:64px;
  }

  #wcpw_price_grid .wcpw-quote-custom-field .wcpw-input{
    height:64px;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery{
    min-height:64px;
    padding:10px 14px;
    gap:2px;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery__label{
    font-size:.9rem;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery__price{
    font-size:1rem;
  }

  #wcpw_price_grid .wcpw-quote-custom-preview{
    min-height:64px;
    padding:10px 14px;
  }
}


/* Final mobile spacing fix: custom panel compact but readable */
@media (max-width: 767px){
  #wcpw_price_grid .wcpw-quote-custom-panel__inner{
    gap:8px;
    padding:12px;
  }

  #wcpw_price_grid .wcpw-quote-custom-field{
    gap:6px;
  }

  #wcpw_price_grid .wcpw-quote-custom-field .wcpw-input{
    height:56px;
    min-height:56px;
    margin:0;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery,
  #wcpw_price_grid .wcpw-quote-custom-preview{
    min-height:56px;
    height:auto;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery{
    padding:9px 14px;
    gap:1px;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery__label{
    line-height:1.1;
  }

  #wcpw_price_grid .wcpw-quote-custom-delivery__price{
    line-height:1.1;
  }

  #wcpw_price_grid .wcpw-quote-custom-preview{
    padding:9px 14px;
  }
}


/* WCPW single-product template */
body.wcpw-product-template .site-content-contain,
body.wcpw-product-template .site-content,
body.wcpw-product-template #content,
body.wcpw-product-template .content-area,
body.wcpw-product-template #primary,
body.wcpw-product-template #secondary{
  width:100% !important;
  max-width:none !important;
  float:none !important;
  margin-left:0 !important;
  margin-right:0 !important;
  padding-left:0 !important;
  padding-right:0 !important;
  clear:both !important;
}
body.wcpw-product-template #secondary,
body.wcpw-product-template .widget-area,
body.wcpw-product-template aside{
  display:none !important;
}
body.wcpw-product-template .wcpw-product-template-main{
  display:block;
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
/* Kill theme top spacing on product template page */
body.wcpw-product-template .site-content-contain,
body.wcpw-product-template .site-content,
body.wcpw-product-template #content,
body.wcpw-product-template .content-area,
body.wcpw-product-template #primary,
body.wcpw-product-template main,
body.wcpw-product-template .entry-content,
body.wcpw-product-template .page-content,
body.wcpw-product-template article{
  padding-top:0 !important;
  margin-top:0 !important;
}
body.wcpw-product-template .wcpw-product-template-shell{
  width:min(1140px, calc(100vw - 32px));
  max-width:1140px;
  margin:0 auto;
  padding:0 0 40px;
  box-sizing:border-box;
}
body.wcpw-product-template .wcpw-mount--product-template,
body.wcpw-product-template .wcpw-mount--product-template #wcpw-wrap{
  width:100%;
  max-width:none;
}
@media (max-width: 767px){
  body.wcpw-product-template .wcpw-product-template-shell{
    width:min(1140px, calc(100vw - 12px));
  }
}


.wcpw-step-shipping-highlight{
  color:var(--wcpw-accent, #ff5a36);
}

/* Step 4: Preventivo — pallino + titolo in riga, "Spedizione gratuita" sotto */
.wcpw-step-title--quote .wcpw-step-title__inner{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wcpw-step-title--quote .wcpw-step-title__sub{
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
}
