/* ═══════════════════════════════════════════════════════════════
   SWC Product Designer — CSS v0.5.0
   ═══════════════════════════════════════════════════════════════ */
:root {
  --primary: #2543df;
  --primary-dark: #1a33b8;
  --accent: #e63946;
  --bg-app: #d9d9d9;
  --bg-sidebar: #1a1a2e;
  --bg-panel: #ffffff;
  --bg-stage: #e8e8e8;
  --border: #e0e0e0;
  --text: #151515;
  --text-muted: #666;
  --radius: 8px;
  --sidebar-w: 184px;
  --panel-w: 300px;
  --views-w: 100px;
  --topbar-h: 52px;
  --bottom-h: 56px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body.swcpd-editor-body {
  height: 100%;
  background: var(--bg-app);
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── APP GRID ────────────────────────────────────────────────── */
.swcpd-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--panel-w) 1fr var(--views-w);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "top   top   top   top"
    "tools panel stage views";
  position: relative;
  overflow: hidden;
}

.swcpd-app:not(.panel-open) {
  grid-template-columns: var(--sidebar-w) 0 1fr var(--views-w);
}
.swcpd-app:not(.panel-open) .swcpd-panel-wrap {
  padding: 0; overflow: hidden; box-shadow: none; width: 0;
}
.swcpd-app.drawer-open {
  grid-template-columns: var(--sidebar-w) 0 1fr var(--views-w);
}
.swcpd-app.drawer-open .swcpd-panel-wrap {
  padding: 0; overflow: hidden; width: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────────── */
.swcpd-topbar {
  grid-area: top;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  z-index: 3;
  height: var(--topbar-h);
  min-width: 0;
}
.swcpd-brand {
  font-weight: 900;
  font-size: 14px;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: 1px;
  flex-shrink: 0;
}
/* Back link replacing breadcrumb */
.swcpd-breadcrumb-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  flex-shrink: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  transition: background .15s, color .15s;
}
.swcpd-breadcrumb-link:hover { background: #f5f5f5; color: var(--primary); }
/* Product info strip in topbar */
.swcpd-top-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
#swcpd-design-summary {
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.swcpd-fullcolor-badge {
  font-weight: 700;
  color: #b8621b;
}
.swcpd-inline-link {
  /* BUGFIX: this is a real <button>, and the active WordPress theme's
     global button styles (loaded via wp_head on this same page) were
     bleeding through — turning what should be a small plain text link
     into a big bordered pill. `all: unset` wipes every inherited/theme
     default in one shot before we re-apply only what we actually want. */
  all: unset;
  display: inline;
  cursor: pointer;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
}
.swcpd-inline-link:hover { color: #1a2fb0; }
.swcpd-inline-link-onpill {
  margin-left: 4px !important;
  padding: 3px 8px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--primary) !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  vertical-align: middle;
}
.swcpd-inline-link-onpill:hover { background:var(--primary-dark) !important; color:#fff !important; }
#swcpd-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.swcpd-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Top action buttons */
.swcpd-primary, .swcpd-secondary {
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--primary);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.swcpd-primary { background: var(--primary); color: #fff; }
.swcpd-primary:hover { background: var(--primary-dark); }
.swcpd-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.swcpd-secondary { background: #fff; color: var(--primary); }
.swcpd-secondary:hover { background: #f0f3ff; }
.swcpd-primary.wide { width: 100%; margin-top: 14px; font-size: 15px; padding: 12px; }
.swcpd-next-button {
  min-width: 126px;
  padding: 10px 22px !important;
  border: 2px solid var(--primary-dark) !important;
  background: var(--primary) !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(37, 67, 223, 0.28);
}
.swcpd-next-button:hover,
.swcpd-next-button:focus-visible {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 67, 223, 0.36);
}
.swcpd-next-button.is-disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

/* ── SIDEBAR TOOLS ───────────────────────────────────────────── */
.swcpd-sidebar {
  grid-area: tools;
  background: var(--bg-sidebar);
  color: #fff;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  overflow: hidden;
}
.swcpd-tool {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #25263d;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: left;
  width: 100%;
  /* Prevent text overlap */
  overflow: visible;
  line-height: 1.3;
  word-break: normal;
}
.swcpd-tool:hover { background: #30324f; color: #fff; border-color: rgba(255,255,255,0.28); transform: translateY(-1px); }
.swcpd-tool.active {
  border-left-color: var(--primary);
  border-color: rgba(89, 111, 255, 0.75);
  background: rgba(37, 67, 223, 0.32);
  color: #fff;
}
.swcpd-tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}
.swcpd-tool-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.swcpd-tool-copy strong { color: #fff; font-size: 13px; line-height: 1.2; }
.swcpd-tool-copy small { color: #c5c9da; font-size: 10px; font-weight: 500; line-height: 1.25; }
.swcpd-mobile-only-tool { display:none; }

/* ── PANEL ───────────────────────────────────────────────────── */
.swcpd-panel-wrap {
  grid-area: panel;
  background: var(--bg-panel);
  border-radius: 0 0 var(--radius) 0;
  margin: 0;
  padding: 16px;
  overflow: auto;
  z-index: 2;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  width: var(--panel-w);
  transition: width 0.2s;
}
.swcpd-panel { display: none; }
.swcpd-panel.active { display: block; }
.swcpd-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
}
.swcpd-panel h4 { margin: 18px 0 8px; font-size: 13px; color: #444; text-transform: uppercase; letter-spacing: 1px; }
.swcpd-panel label { display: block; font-size: 12px; font-weight: 700; margin: 10px 0 0; color: #333; }
.swcpd-panel input, .swcpd-panel select {
  box-sizing: border-box;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
}
.swcpd-panel input:focus, .swcpd-panel select:focus {
  outline: none;
  border-color: var(--primary);
}
.swcpd-panel button,
.swcpd-upload-box {
  width: 100%;
  border: 1px solid #ddd;
  background: #f7f7f7;
  color: #111;
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  box-sizing: border-box;
  transition: background 0.15s;
  font-family: var(--font);
  white-space: normal!important;
}
.swcpd-panel button:hover { background: var(--primary); }
.swcpd-upload-box {
  display: block;
  border-style: dashed;
  border-color: var(--primary);
  padding: 20px 12px;
  color: var(--primary);
  font-size: 13px;
  background: #f6f8ff;
}
.swcpd-upload-box:hover { background: #eef1ff; }
.swcpd-upload-box input { display: none; }
.swcpd-help { margin: 8px 0 14px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
.swcpd-row { display: flex; gap: 6px; }
.swcpd-row button { flex: 1; }

/* Recent uploads */
.swcpd-upload-history { display: flex; gap: 8px; flex-wrap: wrap; }
.swcpd-upload-history-item { position: relative; width: 64px; height: 64px; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; background: #fafafa; }
.swcpd-upload-history-item img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; display: block; }
.swcpd-upload-history-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff; font-size: 11px; cursor: pointer; }
.swcpd-upload-history-remove:hover { background: #c0392b; }

/* Icon recolor control (Add Art panel) */
.swcpd-art-row input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; }

/* Art search & grid */
.swcpd-search { margin-bottom: 10px !important; border: 1.5px solid var(--primary) !important; font-size: 14px; }
.swcpd-art-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 380px; overflow-y: auto; padding-right: 2px; }
.swcpd-art-tile {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #f4f4f4 !important;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.swcpd-art-tile:hover { background: var(--primary) !important; }
.swcpd-art-icon { display: flex; width: 52px; height: 52px; align-items: center; justify-content: center; }
.swcpd-art-icon svg { width: 50px; height: 50px; fill: #111; stroke: #111; }
.swcpd-art-icon img { width: 32px; height: 32px; object-fit: contain; }
.swcpd-art-tile span:not(.swcpd-art-icon) { font-size: 11px; font-weight: 700; }
.swcpd-art-tile small { font-size: 9px; color: #777; }

/* Category tiles — limited height, internal scroll (client requirement) */
.swcpd-art-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 400px; overflow-y: auto; padding-right: 2px; }
.swcpd-art-cat-tile {
  min-height: 90px;
  display: flex!important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: #f4f4f4 !important; border-radius: 7px; cursor: pointer; transition: background 0.15s;
}
.swcpd-art-cat-tile:hover { background: #002aff !important; }
.swcpd-art-cat-tile span:last-child { font-size: 11px; font-weight: 700; text-align: center; padding: 0 4px; }
.swcpd-art-back { background: none !important; border: none !important; color: var(--primary); font-weight: 700; text-align: left !important; padding: 0 0 8px !important; width: auto !important; }

/* Edit Art panel */
.swcpd-art-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swcpd-art-color-swatch { width: 34px !important; height: 30px !important; padding: 0 !important; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; margin: 0 !important; }
.swcpd-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.swcpd-toggle-row label { margin: 0; font-weight: 600; font-size: 12px; flex: 1; }
.swcpd-toggle-row label small { display: block; font-weight: 400; color: var(--text-muted); font-size: 10px; }
.swcpd-toggle-row input[type="checkbox"] { width: auto !important; margin: 0 !important; }
.swcpd-art-change-link { text-align: right; margin: 4px 0 12px; }
.swcpd-art-change-link a { color: var(--primary); font-weight: 700; font-size: 12px; text-decoration: none; }
.swcpd-lock-btn { width: 32px !important; flex: none !important; padding: 6px !important; opacity: 0.4; }
.swcpd-lock-btn.active { opacity: 1; background: #eef1ff !important; border-color: var(--primary) !important; }
.swcpd-primary-btn { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.swcpd-primary-btn:hover { opacity: 0.9; }

/* Product list */
.swcpd-product-list { display: flex; flex-direction: column; gap: 6px; }
.swcpd-product-card {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; border: 1px solid var(--border);
  border-radius: 7px; padding: 8px; color: #111; background: #fff;
  transition: border-color 0.15s;
}
.swcpd-product-card:hover { border-color: var(--primary); }
.swcpd-product-card img { width: 42px; height: 42px; object-fit: contain; background: #f1f1f1; border-radius: 5px; }
.swcpd-product-card span { font-size: 11px; font-weight: 700; }

/* Product meta panel */
/* Method tabs are now fully inline-styled in JS for tonal theming */
.swcpd-meta-item {
  font-size: 13px; line-height: 1.5;
  padding: 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid #eee;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.swcpd-meta-item:last-child { border-bottom: 0; }
.swcpd-meta-item strong {
  display: block; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
  font-weight: 800;
}
.swcpd-meta-val { font-size: 13px; color: #222; font-weight: 600; }
.swcpd-meta-help { display:block; color:var(--text-muted); font-size:11px; line-height:1.45; margin-bottom:9px; }
.swcpd-imprint-list { display:grid; gap:8px; }
.swcpd-imprint-location {
  appearance:none; width:100%; padding:0; overflow:hidden; text-align:left; cursor:pointer;
  border:1px solid #cbd5e1; border-radius:10px; background:#fff; color:var(--text);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.swcpd-imprint-location:hover { border-color:var(--primary); box-shadow:0 5px 16px rgba(15,23,42,.10); }
.swcpd-imprint-location.is-selected { border-color:var(--primary); background:#f8faff; box-shadow:0 0 0 2px rgba(37,67,223,.14); }
.swcpd-imprint-location-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; padding:11px 12px; background:#edf3fb; }
.swcpd-imprint-title { display:flex; align-items:flex-start; gap:7px; min-width:0; }
.swcpd-imprint-title i { width:13px; height:13px; margin-top:1px; flex:0 0 auto; border:2px solid #64748b; border-radius:50%; background:#fff; box-shadow:inset 0 0 0 3px #fff; }
.swcpd-imprint-location.is-selected .swcpd-imprint-title i { border-color:var(--primary); background:var(--primary); }
.swcpd-imprint-location-head strong { display:block; margin:0; color:#172554; font-size:11px; line-height:1.35; letter-spacing:.15px; text-transform:uppercase; }
.swcpd-imprint-location-head em { flex:0 0 auto; padding:3px 6px; border-radius:4px; background:#172554; color:#fff; font-size:8px; line-height:1.2; font-style:normal; font-weight:800; text-transform:uppercase; }
.swcpd-imprint-size-grid { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px; padding:12px; }
.swcpd-imprint-size-box { display:grid; grid-template-columns:1fr auto; align-items:baseline; padding:8px 9px; border:1px solid #d7e0ee; border-radius:7px; background:#fff; }
.swcpd-imprint-size-box small { grid-column:1/-1; color:#64748b; font-size:8px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; }
.swcpd-imprint-size-box b { color:#172554; font-size:18px; line-height:1.1; }
.swcpd-imprint-size-box u { color:#64748b; font-size:9px; font-weight:700; text-decoration:none; }
.swcpd-imprint-size-times { color:#94a3b8; font-size:14px; font-weight:800; }
.swcpd-imprint-unavailable { display:block; margin:12px; padding:9px; border-radius:6px; background:#fff7ed; color:#9a3412; font-size:10px; font-weight:700; text-align:center; }
.swcpd-imprint-methods { display:block; padding:0 12px 11px; color:#334155; font-size:10px; line-height:1.4; }
.swcpd-imprint-methods > small { display:block; margin-bottom:5px; color:#64748b; font-size:8px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; }
.swcpd-imprint-methods > span { display:flex; flex-wrap:wrap; gap:4px; }
.swcpd-imprint-methods i { padding:3px 6px; border-radius:999px; background:#e2e8f0; color:#334155; font-size:9px; font-style:normal; font-weight:700; }
.swcpd-imprint-card-foot { display:flex; justify-content:space-between; gap:8px; padding:8px 12px; border-top:1px solid #e2e8f0; color:#64748b; font-size:9px; }
.swcpd-imprint-card-foot strong { display:inline; margin:0; color:var(--primary); font-size:9px; letter-spacing:0; text-transform:none; }
.swcpd-color-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.swcpd-color-chip {
  width: 26px; height: 26px;
  border-radius: 50%;
  /* Border adapts via JS inline style — see colorCssFromName */
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.18);
  cursor: default;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
  position: relative;
}
.swcpd-color-chip:hover {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.28);
}
/* Tooltip on hover via title attribute is enough — no pseudo needed */
.swcpd-sizes-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.swcpd-size-pill {
  background: #f0f0f0; border: 1px solid #ddd;
  border-radius: 4px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; color: #333;
}

/* ── CANVAS STAGE ────────────────────────────────────────────── */
.swcpd-stage-wrap {
  grid-area: stage;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  padding: 18px;
  background: var(--bg-stage);
}
.canvas-container { background: #ddd; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.canvas-container,
.canvas-container canvas { max-width: 100%; max-height: 100%; }

/* ── VIEWS PANEL ─────────────────────────────────────────────── */
.swcpd-views {
  grid-area: views;
  background: #f5f5f5;
  border-left: 1px solid var(--border);
  padding: 10px 6px;
  overflow-y: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.swcpd-view-title {
  font-weight: 800;
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #444;
  text-align: center;
}
.swcpd-views-close { display:none; }
.swcpd-change-color-count {
  margin-top:10px !important; background:var(--primary) !important;
  border-color:var(--primary) !important; color:#fff !important;
}
.swcpd-change-color-count:hover { background:var(--primary-dark) !important; }
.swcpd-view-btn {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 5px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}
.swcpd-view-btn:hover { border-color: #aab; }
.swcpd-view-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,67,223,0.2); }
.swcpd-view-btn img { width: 62px; height: 62px; object-fit: contain; display: block; margin: 0 auto 3px; }
.swcpd-view-preview { position:relative; display:block; width:62px; height:62px; margin:0 auto 3px; overflow:hidden; }
.swcpd-view-preview img { margin:0; }
.swcpd-view-preview .swcpd-view-product-layer { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.swcpd-view-preview .swcpd-view-captured-preview { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.swcpd-view-preview .swcpd-view-art-layer { position:absolute; max-width:none; object-fit:contain; }
.swcpd-view-preview .swcpd-view-text-layer,
.swcpd-view-preview .swcpd-view-object-layer { position:absolute; display:flex; align-items:center; justify-content:center; overflow:hidden; white-space:nowrap; font-size:7px; line-height:1; }
.swcpd-view-btn span { font-size: 10px; font-weight: 700; display: block; color: #333; }

/* No-image placeholder for views */
.swcpd-view-placeholder {
  width: 62px; height: 62px;
  background: #e8e8e8;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 3px;
  font-size: 9px;
  color: #999;
  cursor: pointer;
  border: 1px dashed #bbb;
  text-align: center;
  padding: 4px;
}

/* .swcpd-add-products is now in the topbar actions */
.swcpd-add-products {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: var(--font);
}
.swcpd-add-products:hover { background: #f0f3ff; }

/* ── DRAWER ──────────────────────────────────────────────────── */
.swcpd-drawer {
  position: absolute;
  top: calc(var(--topbar-h) + 10px);
  right: 20px;
  width: min(700px, 45vw);
  height: calc(100vh - var(--topbar-h) - 24px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 10;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.swcpd-drawer.open { transform: translateX(0); }
.swcpd-drawer-head {
  height: 42px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.swcpd-drawer-head button {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  color: #555;
  padding: 0 4px;
  transition: color 0.15s;
}
.swcpd-drawer-head button:hover { color: #111; }
.swcpd-drawer-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.swcpd-drawer-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* ── POSTAL STEP ─────────────────────────────────────────────── */
.swcpd-postal { max-width: 300px; margin: 0 auto; text-align: left; }
.swcpd-postal h2 { text-align: center; font-size: 22px; margin-bottom: 14px; }
.swcpd-postal label { font-weight: 700; display: block; font-size: 13px; }
.swcpd-postal input {
  width: 100%; padding: 12px; box-sizing: border-box;
  border: 1.5px solid #ccc; border-radius: 5px;
  text-align: center; margin-top: 6px; font-size: 16px;
}
.swcpd-postal input:focus { outline: none; border-color: var(--primary); }
#swcpd-outside {
  border: 0; background: transparent; color: var(--primary);
  margin: 10px 0 4px; cursor: pointer; font-size: 13px; text-decoration: underline; display: block;
}
.swcpd-postal p { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* ── MISSING DESIGN ──────────────────────────────────────────── */
.swcpd-missing-design { max-width: 580px; margin: 20px auto; text-align: center; padding: 10px 20px; }
.swcpd-missing-design-icon {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-size: 25px;
  background: linear-gradient(135deg,var(--primary),#6d5dfc);
  box-shadow: 0 10px 28px rgba(37,67,223,.25);
}
.swcpd-missing-design h2 { font-size: 24px; margin: 0 0 16px; }
.swcpd-missing-design p { font-size: 15px; line-height: 1.5; margin: 8px 0; }
.swcpd-missing-design .swcpd-primary { margin-top: 14px; min-width: 150px; }

/* ═══════════════════════════════════════════════════════════════
   STEP 1 — Quantity + Color
   ═══════════════════════════════════════════════════════════════ */
.swcpd-qty-drawer { padding-bottom: 10px; }
.swcpd-qty-drawer h2 { margin: 0 0 2px; font-size: 20px; font-weight: 900; }
.swcpd-sub { color: #888; font-size: 12px; margin: 0 0 12px; }

/* Two-column layout */
.swcpd-step1-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.swcpd-step1-design-info {
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid #e4e7f3;
  border-radius: 10px;
  background: #fafbff;
}
.swcpd-step1-overview {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,.8fr);
  gap:12px; align-items:stretch; margin-bottom:14px;
}
.swcpd-step1-delivery {
  margin-bottom:0; padding:12px; border:1px solid #dce3ff;
  border-radius:10px; background:#f8f9ff;
}
.swcpd-step1-delivery h3,
.swcpd-decoration-title {
  margin:0 0 9px !important; color:#222 !important; font-size:13px !important;
  font-weight:800 !important; letter-spacing:.5px !important; text-transform:uppercase !important;
}
.swcpd-step1-delivery > p:first-of-type { display:none; }
.swcpd-step1-delivery > p:first-child {
  color:#41485a !important; font-weight:800 !important; letter-spacing:.7px !important;
}
.swcpd-step1-design-info .swcpd-step2-pills { margin: 0; }
.swcpd-step1-design-info .swcpd-supplier-row { margin: 8px 0 0; }

/* Color swatches */
.swcpd-color-section { margin-bottom: 12px; }
.swcpd-color-label-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px; font-size: 13px; font-weight: 700;
}
.swcpd-color-name { color: var(--primary); font-weight: 800; }
.swcpd-swatch-grid { display: flex; flex-wrap: wrap; gap: 5px; }

/* Color swatches — use colored dots, NOT product images */
.swcpd-color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  position: relative;
}
.swcpd-color-swatch:hover { transform: scale(1.2); border-color: #888; }
.swcpd-color-swatch.swcpd-swatch-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  transform: scale(1.15);
}

/* Order line cards */
.swcpd-lines {
  /* Vertical scroll once there are many color/size lines instead of the
     drawer growing endlessly off-screen. */
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}
.swcpd-line-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.swcpd-line-card.swcpd-line-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,67,223,0.18);
  background: #f5f7ff;
}
.swcpd-line-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.swcpd-line-thumb {
  width: 56px; height: 56px; object-fit: contain;
  background: #f0f0f0; border-radius: 6px; flex-shrink: 0;
  border: 1px solid var(--border);
}
.swcpd-line-info { flex: 1; }
.swcpd-line-info strong { font-size: 13px; display: block; margin-bottom: 3px; }
.swcpd-line-color {
  font-size: 12px; color: #555;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.swcpd-line-active-tag {
  color: var(--primary); font-weight: 700; font-size: 10px;
}
.swcpd-remove-line {
  border: 0; background: transparent; color: #c00;
  cursor: pointer; font-size: 16px; padding: 0 4px; margin-left: auto;
}
.swcpd-adult-label {
  font-size: 10px; font-weight: 700; color: #888;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}

/* SIZE GRID — all inputs same height */
.swcpd-size-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.swcpd-size-col {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 52px;
}
.swcpd-size-label { font-size: 11px; font-weight: 800; color: #333; text-align: center; line-height: 1.2; }
.swcpd-upcharge { font-size: 9px; color: #e67e22; display: block; text-align: center; }
.swcpd-size-qty {
  /* All size inputs same box */
  width: 52px !important;
  height: 44px !important;
  text-align: center;
  padding: 4px 2px !important;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  display: block;
  line-height: 1;
  box-sizing: border-box !important;
}
.swcpd-size-qty:focus { outline: none; border-color: var(--primary); }

.swcpd-min-note { font-size: 10px; color: #aaa; margin-top: 6px; }
.swcpd-add-color-btn {
  border: 1.5px dashed var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  margin-top: 2px;
  transition: background 0.15s;
  font-family: var(--font);
}
.swcpd-add-color-btn:hover { background: #f0f3ff; }

/* Totals sidebar — Step 1 */
.swcpd-step1-right { position: sticky; top: 0; }
.swcpd-qty-totals {
  background: #f8f9ff;
  border: 1px solid #dce3ff;
  border-radius: 10px;
  padding: 14px;
}
.swcpd-totals-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; font-size: 12px;
  border-bottom: 1px solid #eef0ff; color: #333;
}
.swcpd-totals-row:last-child { border-bottom: 0; }
.swcpd-totals-unit {
  font-weight: 700; font-size: 13px;
  padding-top: 8px; border-top: 2px solid #c8d0ff !important;
}
.swcpd-totals-grand {
  font-weight: 900; font-size: 14px; color: #1a2fd4;
  padding-top: 8px; border-top: 2px solid #c8d0ff !important;
}

/* Save More box — single column, compact */
.swcpd-save-more {
  background: #fffbf0;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.swcpd-save-more strong { display: block; margin-bottom: 2px; font-size: 12px; }
.swcpd-save-more p { margin: 0; color: #666; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   STEP 2 — Order Options
   ═══════════════════════════════════════════════════════════════ */
.swcpd-step2 { padding-bottom: 10px; }
.swcpd-summary-heading { font-size: 18px; margin: 4px 0 10px; font-weight: 800; }
.swcpd-step2-hero {
  text-align: center; padding: 14px 0 10px;
  border-bottom: 1px solid #eee; margin-bottom: 12px;
}
.swcpd-step2-price { font-size: 32px; font-weight: 900; color: #111; }
.swcpd-step2-price span { font-size: 16px; font-weight: 400; color: #555; }
.swcpd-step2-total { font-size: 14px; color: #555; margin-top: 3px; }

/* Pills row */
.swcpd-step2-pills { display: flex; flex-wrap: wrap; align-items:center; gap: 7px; margin: 10px 0; }
.swcpd-step2-pills span {
  display:inline-flex; align-items:center; min-height:28px;
  background: #f0f2f7; border:1px solid #e1e5ee; border-radius: 20px;
  padding: 4px 10px; font-size: 11px; font-weight:600; line-height:1.2; color: #303442;
}
.swcpd-badge-icon { width:14px; height:14px; flex:0 0 14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.swcpd-method-pill .swcpd-badge-icon { stroke:#fff; }
.swcpd-step2-pills .swcpd-quantity-badge {
  flex:1 0 100%; display:flex; align-items:center; justify-content:space-between;
  gap:10px; min-height:48px; padding:7px 9px; border-radius:10px;
  background:#fff; border-color:#dbe1f4; box-shadow:0 1px 3px rgba(20,38,110,.06);
}
.swcpd-step2-pills .swcpd-quantity-total {
  display:flex; align-items:center; gap:7px; flex:0 0 auto;
  min-height:0; padding:0; border:0; border-radius:0; background:transparent;
}
.swcpd-quantity-total .swcpd-badge-icon { width:18px; height:18px; flex-basis:18px; color:var(--primary); }
.swcpd-step2-pills .swcpd-quantity-total > span {
  display:flex; flex-direction:column; align-items:flex-start; min-height:0;
  padding:0; border:0; border-radius:0; background:transparent; line-height:1.05;
}
.swcpd-quantity-total b { font-size:15px; color:#171b2b; }
.swcpd-quantity-total small { margin-top:2px; font-size:9px; font-weight:600; color:#6d7486; }
.swcpd-step2-pills .swcpd-size-qty-chips {
  display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px;
  min-height:0; padding:0; border:0; border-radius:0; background:transparent;
}
.swcpd-step2-pills .swcpd-size-qty-chip {
  display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:35px; min-height:32px; padding:3px 6px; border:1px solid #d7def6;
  border-radius:7px; background:#f2f5ff; color:#172a8d; line-height:1;
}
.swcpd-size-qty-chip small { font-size:8px; font-weight:700; color:#68718a; }
.swcpd-size-qty-chip b { margin-top:3px; font-size:12px; color:var(--primary-dark); }
.swcpd-size-qty-empty { color:#7b8190; font-size:10px; font-weight:600; }
.swcpd-method-pill { background: var(--primary) !important; color: #fff !important; }

/* Delivery box — two columns */
.swcpd-delivery-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  background: #fcfcfc;
}
.swcpd-free-badge {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
  text-transform: uppercase;
}
.swcpd-delivery-box h4 { font-size: 13px; margin: 4px 0; }
.swcpd-delivery-box p { margin: 3px 0; font-size: 11px; color: #555; }

/* Delivery selector */
.swcpd-delivery-left { }
.swcpd-delivery-right strong { font-size: 12px; font-weight: 700; display: block; margin-bottom: 6px; }

/* Rush options as radio-like buttons */
.swcpd-rush-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 5px;
  font-size: 11px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.swcpd-rush-option:hover { border-color: var(--primary); background: #f6f8ff; }
.swcpd-rush-option.active {
  border-color: var(--primary);
  background: #f0f3ff;
  font-weight: 700;
}
.swcpd-rush-option input[type=radio] { margin: 0; cursor: pointer; }
.swcpd-rush-price { margin-left: auto; font-weight: 700; color: var(--primary); font-size: 11px; }

/* Price breakdown box */
.swcpd-breakdown-box {
  background: #f8f9ff;
  border: 1px solid #dce3ff;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
}
.swcpd-bd-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: 12px;
  border-bottom: 1px solid #eef0ff; color: #333;
}
.swcpd-bd-row:last-child { border-bottom: 0; }
.swcpd-bd-total { font-weight: 700; font-size: 13px; padding-top: 8px; border-top: 2px solid #c8d0ff !important; }
.swcpd-bd-grand { font-weight: 900; font-size: 14px; color: #1a2fd4; padding-top: 8px; border-top: 2px solid #c8d0ff !important; }

/* Order section */
.swcpd-order-section { margin: 14px 0; }
.swcpd-order-section-title {
  font-size: 11px; font-weight: 700; color: #555;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.swcpd-order-item {
  display: grid; grid-template-columns: minmax(74px,auto) 1fr auto;
  gap: 10px; align-items: start;
  background: #f7f7f7; border-radius: 7px; padding: 10px; margin-bottom: 6px;
}
.swcpd-order-view-previews { display:flex; flex-wrap:wrap; gap:6px; align-items:flex-start; }
.swcpd-order-view-preview { width:68px; text-align:center; color:#555; font-size:9px; }
.swcpd-order-view-canvas {
  position:relative; width:64px; height:64px; overflow:hidden;
  background:#fff; border:1px solid var(--border); border-radius:6px;
}
.swcpd-order-view-canvas img { border:0; border-radius:0; background:transparent; }
.swcpd-order-view-canvas .swcpd-preview-base { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.swcpd-order-view-canvas .swcpd-preview-layer { position:absolute; object-fit:contain; max-width:none; }
.swcpd-order-view-canvas .swcpd-preview-text,
.swcpd-order-view-canvas .swcpd-preview-placeholder {
  position:absolute; display:flex; align-items:center; justify-content:center;
  overflow:hidden; font-size:7px; line-height:1; white-space:nowrap;
}
.swcpd-order-view-preview small { display:block; margin-top:2px; font-size:9px; line-height:1.1; }
.swcpd-order-item img {
  width: 56px; height: 56px; object-fit: contain;
  background: #fff; border-radius: 5px; border: 1px solid var(--border);
}
.swcpd-order-item-info strong { font-size: 12px; display: block; margin-bottom: 2px; }
.swcpd-order-item-info p { margin: 2px 0; font-size: 11px; color: #555; }
.swcpd-size-str { color: #777; }
.swcpd-order-item-price { font-size: 13px; font-weight: 700; color: #111; white-space: nowrap; }

/* Step 2 footer */
.swcpd-step2-footer { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.swcpd-back-link {
  border: 0; background: transparent; color: var(--primary);
  cursor: pointer; font-size: 12px; text-decoration: underline;
  padding: 0; flex: 0 0 auto; margin-right: auto;
  font-family: var(--font);
}
.swcpd-call-quote {
  background: #fff3cd; border: 1px solid #ffc107;
  border-radius: 6px; padding: 10px 14px;
  font-size: 12px; color: #664d03; margin: 8px 0;
}

/* ── SAVED DESIGNS ───────────────────────────────────────────── */
.swcpd-saved-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.swcpd-saved-item {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  display: flex; align-items: center; gap: 10px; background: #fafafa;
  transition: border-color 0.15s;
}
.swcpd-saved-item:hover { border-color: #aab; }
.swcpd-saved-thumb {
  width: 52px; height: 52px; background: #eee; border-radius: 5px;
  flex-shrink: 0; border: 1px solid var(--border);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.swcpd-saved-thumb canvas { max-width: 100%; max-height: 100%; }
.swcpd-saved-info { flex: 1; }
.swcpd-saved-info strong { font-size: 12px; display: block; margin-bottom: 2px; }
.swcpd-saved-info span { font-size: 10px; color: var(--text-muted); }
.swcpd-saved-actions { display: flex; gap: 5px; }
.swcpd-saved-actions button {
  border: 1px solid var(--border); background: #fff;
  border-radius: 5px; padding: 4px 8px; cursor: pointer;
  font-size: 11px; font-weight: 700; transition: background 0.15s;
  font-family: var(--font);
}
.swcpd-saved-actions .del-btn { color: var(--accent); border-color: var(--accent); }
.swcpd-saved-actions .del-btn:hover { background: #fff0f0; }
.swcpd-saved-actions .load-btn { color: var(--primary); border-color: var(--primary); }
.swcpd-saved-actions .load-btn:hover { background: #f0f3ff; }

/* Login prompt */
.swcpd-login-prompt {
  text-align: center; padding: 20px;
  border: 1.5px dashed var(--border); border-radius: 10px;
  background: #fafafa; margin: 10px 0;
}
.swcpd-login-prompt p { font-size: 13px; color: #555; margin-bottom: 12px; line-height: 1.5; }

/* ── CART EDIT BUTTON ────────────────────────────────────────── */
.swcpd-edit-cart-btn {
  border: 1.5px solid var(--primary);
  background: #fff;
  color: var(--primary);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: var(--font);
}
.swcpd-edit-cart-btn:hover { background: #f0f3ff; }

/* ── MISC UTILITIES ──────────────────────────────────────────── */
.swcpd-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.swcpd-pills span { background: #f0f0f0; border-radius: 20px; padding: 3px 10px; font-size: 11px; }
.swcpd-mini-swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #ddd; display: inline-block; }
.swcpd-rainbow { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red) !important; }
.swcpd-notes { font-size: 10px; color: #777; line-height: 1.6; padding: 5px 0; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .swcpd-app:not(.panel-open),
  .swcpd-app.drawer-open { grid-template-columns:1fr; }
  .swcpd-app:not(.panel-open) .swcpd-panel-wrap,
  .swcpd-app.drawer-open .swcpd-panel-wrap { width:100% !important; overflow:visible; }
  .swcpd-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "top" "stage" "tools";
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .swcpd-topbar {
    position:sticky; top:0; z-index:30; flex-wrap:nowrap; height:64px;
    padding:6px 8px; gap:4px; box-shadow:0 2px 10px rgba(0,0,0,.08);
  }
  .swcpd-brand, .swcpd-breadcrumb-link, .swcpd-top-info { display:none; }
  .swcpd-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:100%; gap:5px; margin:0; }
  .swcpd-actions .swcpd-secondary,
  .swcpd-actions .swcpd-next-button {
    min-width:0; width:100%; height:48px; padding:5px 3px !important;
    font-size:11px !important; line-height:1.15; white-space:normal;
  }
  .swcpd-sidebar {
    position:sticky; bottom:0; z-index:35; flex-direction:row; flex-wrap:nowrap;
    gap:0; padding:5px 4px calc(5px + env(safe-area-inset-bottom));
    overflow-x:auto; scrollbar-width:none; background:var(--primary); border-top:0;
    scroll-snap-type:x proximity;
  }
  .swcpd-sidebar::-webkit-scrollbar, .swcpd-panel::-webkit-scrollbar { display:none; }
  .swcpd-tool {
    flex:1 0 88px; min-height:54px; padding:5px 7px; border:0; border-radius:7px;
    background:transparent; scroll-snap-align:start; flex-direction:column; gap:2px;
  }
  .swcpd-tool:hover, .swcpd-tool.active { background:rgba(255,255,255,.18); }
  .swcpd-tool-icon { width:auto; height:auto; background:transparent; color:#fff; }
  .swcpd-tool-copy strong { color:#fff; font-size:11px; }
  .swcpd-tool-copy small { display:none; }
  .swcpd-mobile-only-tool { display:flex; }
  .swcpd-panel-wrap {
    display:block; position:fixed; left:0; right:0; bottom:0; z-index:40;
    width:100% !important; max-height:min(72dvh,650px); margin:0; padding:0;
    border-radius:16px 16px 0 0; overflow:visible; box-shadow:0 -12px 40px rgba(0,0,0,.22);
    transform:translateY(calc(100% + 30px)); opacity:0; pointer-events:none;
    transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .18s ease;
  }
  .swcpd-app.panel-open .swcpd-panel-wrap { transform:translateY(0); opacity:1; pointer-events:auto; }
  .swcpd-panel {
    position:relative; max-height:min(72dvh,650px); overflow:auto; padding:18px 16px calc(18px + env(safe-area-inset-bottom));
    scrollbar-width:none; background:#fff; border-radius:16px 16px 0 0;
  }
  .swcpd-mobile-sheet-close {
    position:absolute; top:10px; right:12px; z-index:3; width:36px !important; height:36px;
    margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important;
    font-size:27px !important; font-weight:400 !important;
  }
  .swcpd-stage-wrap { min-height:0; padding:6px; overflow:hidden; }
  .canvas-container {
    width:min(700px, calc(100vw - 12px), calc(100dvh - 140px)) !important;
    height:min(700px, calc(100vw - 12px), calc(100dvh - 140px)) !important;
    aspect-ratio:1 / 1; flex:none;
  }
  .canvas-container canvas { width: 100% !important; height: 100% !important; }
  .swcpd-views {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:45;
    max-height:min(55dvh,430px); padding:18px 12px calc(18px + env(safe-area-inset-bottom));
    border:0; border-radius:16px 16px 0 0; background:#fff; box-shadow:0 -12px 40px rgba(0,0,0,.24);
    flex-direction:column; overflow:hidden; transform:translateY(calc(100% + 25px));
    opacity:0; pointer-events:none; transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .18s ease;
  }
  .swcpd-views.mobile-open { transform:translateY(0); opacity:1; pointer-events:auto; }
  .swcpd-views-close {
    display:grid; place-items:center; position:absolute; top:9px; right:12px;
    width:36px; height:36px; padding:0; border:0; border-radius:50%;
    background:#f1f2f6; color:#222; font-size:25px; line-height:1; cursor:pointer;
  }
  .swcpd-view-title { writing-mode:horizontal-tb; margin:0 0 12px; font-size:13px; }
  #swcpd-view-buttons { display:flex; gap:10px; overflow-x:auto; scrollbar-width:none; }
  #swcpd-view-buttons::-webkit-scrollbar { display:none; }
  .swcpd-view-btn-wrap { flex:0 0 104px; }
  .swcpd-view-btn { width: 90px; display: inline-block; margin-right: 6px; }
  .swcpd-drawer {
    position: fixed; width: calc(100vw - 16px);
    height: calc(100dvh - 72px); top: 68px; right: 8px;
    border-radius:12px 12px 0 0;
    transform:translateY(calc(100% + 20px));
    transition:transform .24s cubic-bezier(.2,.8,.2,1);
  }
  .swcpd-drawer.open { transform:translateY(0); }
  .swcpd-drawer-body.swcpd-step-forward { animation:swcpd-step-forward .2s ease both; }
  .swcpd-drawer-body.swcpd-step-back { animation:swcpd-step-back .2s ease both; }
  .swcpd-step1-top { grid-template-columns: 1fr; }
  .swcpd-delivery-box { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .swcpd-drawer { width:100vw; height:calc(100dvh - 64px); top:64px; right:0; border-radius:12px 12px 0 0; }
  .swcpd-tool { flex-basis:78px; }
  .swcpd-stage-wrap { padding:6px; }
  .canvas-container {
    width:min(calc(100vw - 12px), calc(100dvh - 132px)) !important;
    height:min(calc(100vw - 12px), calc(100dvh - 132px)) !important;
  }
  .swcpd-drawer-body { padding: 16px 14px; }
  .swcpd-step1-right { position: static; }
  .swcpd-drawer-footer { padding: 10px 0 0; flex-direction: column-reverse; align-items: stretch; }
  .swcpd-drawer-footer button { width: 100%; }
  .swcpd-size-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .swcpd-size-col, .swcpd-size-qty { width: 100% !important; min-width: 0; }
  .swcpd-order-item { grid-template-columns: minmax(58px,auto) 1fr; }
  .swcpd-order-view-preview { width:54px; }
  .swcpd-order-view-canvas { width:52px; height:52px; }
  .swcpd-order-item-price { grid-column: 2; }
}

@keyframes swcpd-step-forward {
  from { opacity:0; transform:translateX(22px); }
  to { opacity:1; transform:translateX(0); }
}
@keyframes swcpd-step-back {
  from { opacity:0; transform:translateX(-22px); }
  to { opacity:1; transform:translateX(0); }
}

/* ── CART BAR (after add to cart) ────────────────────────────── */
.swcpd-cart-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0fff4;
  border: 1px solid #a8e6ba;
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── SUPPLIER + DECORATION RULES (sage-woo-connect integration) ─ */
.swcpd-supplier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.swcpd-supplier-badge {
  font-size: 11px;
  font-weight: 700;
  background: #eeedfe;
  color: #3c3489;
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: .3px;
}
.swcpd-rule-pill {
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}
.swcpd-rule-on  { background: #d4edda; color: #155724; }
.swcpd-rule-off { background: #f8f9fa; color: #888;    border: 1px solid #ddd; }
.swcpd-markup-note {
  font-size: 10px;
  color: #888;
  font-style: normal;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   PRINT COLOR OVERRIDE — 1/2/3-color spot print instead of auto Full Color
   ═══════════════════════════════════════════════════════════════ */
.swcpd-color-override .swcpd-help { font-size: 12px; color: #666; margin: 0 0 14px; line-height: 1.5; }
.swcpd-override-count-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.swcpd-override-count-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  color: #333;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.swcpd-override-count-btn:hover { border-color: var(--primary); }
.swcpd-override-count-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.swcpd-override-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.swcpd-override-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.swcpd-override-row label { font-size: 13px; font-weight: 700; }
.swcpd-override-color { width: 48px; height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   DECORATION METHOD PICKER (Quantity step) — customer's own explicit
   choice of Screen Print / Embroidery / DTF, replacing the old
   auto-pick-by-quantity behavior.
   ═══════════════════════════════════════════════════════════════ */
.swcpd-decoration-method-section { margin-top: 16px; }
.swcpd-order-imprint-section { margin-top:12px; }
.swcpd-order-imprint-title-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.swcpd-order-imprint-title-row .swcpd-decoration-title { margin:0 !important; }
.swcpd-order-imprint-title-row > small { padding:2px 7px; border:1px solid #d8dee8; border-radius:999px; background:#f8fafc; color:#475569; font-size:9px; font-weight:700; }
.swcpd-order-imprint-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.swcpd-app button.swcpd-order-imprint-card {
  appearance:none !important; display:block !important; width:100% !important; min-width:0 !important;
  min-height:0 !important; margin:0 !important; padding:0 !important; overflow:hidden !important;
  border:1px solid #cbd5e1 !important; border-radius:7px !important; outline:0 !important;
  background:#fff !important; background-image:none !important; color:#0f172a !important;
  box-shadow:none !important; text-align:left !important; text-transform:none !important; cursor:pointer !important;
  transform:none !important; transition:border-color .15s,box-shadow .15s !important;
}
.swcpd-app button.swcpd-order-imprint-card::before,
.swcpd-app button.swcpd-order-imprint-card::after { display:none !important; content:none !important; }
.swcpd-app button.swcpd-order-imprint-card:hover { border-color:#2543df !important; background:#fff !important; box-shadow:0 0 0 1px #2543df !important; transform:none !important; }
.swcpd-app button.swcpd-order-imprint-card.active { border-color:#2543df !important; background:#fff !important; box-shadow:0 0 0 1px #2543df !important; }
.swcpd-order-imprint-head { display:flex !important; align-items:center; gap:6px; min-height:0; padding:7px 8px 2px; background:transparent !important; background-image:none !important; }
.swcpd-order-imprint-radio { flex:0 0 auto; width:13px; height:13px; border:2px solid #64748b; border-radius:50%; background:#fff !important; box-shadow:inset 0 0 0 3px #fff; }
.swcpd-order-imprint-card.active .swcpd-order-imprint-radio { border-color:#2543df; background:#2543df !important; }
.swcpd-order-imprint-head strong { min-width:0; flex:1; margin:0 !important; color:#0f172a !important; font-size:9px; line-height:1.25; letter-spacing:0; text-transform:uppercase; }
.swcpd-order-imprint-head em { flex:none; padding:2px 5px; border-radius:4px; background:#172554 !important; color:#fff !important; font-size:7px; line-height:1.2; font-style:normal; font-weight:800; text-transform:uppercase; }
.swcpd-order-imprint-info { display:flex !important; align-items:center; min-height:0; padding:2px 8px 7px; background:transparent !important; }
.swcpd-order-imprint-dimensions { display:flex; align-items:center; gap:6px; color:#334155 !important; font-size:9px; line-height:1.2; }
.swcpd-order-imprint-dimensions b { color:#334155 !important; font-size:9px; font-weight:700; }
.swcpd-order-imprint-dimensions i { color:#94a3b8 !important; font-style:normal; }
.swcpd-order-imprint-missing { color:#b45309 !important; font-size:9px; font-weight:700; }
.swcpd-method-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.swcpd-method-pill-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  color: #333;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.swcpd-method-pill-btn:hover { border-color: var(--primary); }
.swcpd-method-pill-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.swcpd-embroidery-inputs {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; background: #fafafa; margin-top: 4px;
}
.swcpd-embroidery-inputs label {
  font-size: 12px; font-weight: 700; color: #333;
  display: flex; flex-direction: column; gap: 4px;
}
.swcpd-embroidery-inputs label small { font-weight: 400; color: #888; }
.swcpd-embroidery-inputs input[type="number"] {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; font-size: 13px; width: 140px;
}
.swcpd-embroidery-inputs .swcpd-checkbox-label {
  flex-direction: row; align-items: center; gap: 8px;
}
.swcpd-embroidery-inputs .swcpd-checkbox-label input[type="checkbox"] { width: auto; }

@media (max-width:700px) {
  .swcpd-order-imprint-list { grid-template-columns:1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   VIEW PANEL — per-view image picker (v0.7.0)
   ═══════════════════════════════════════════════════════════════ */

/* Wrapper so the change-image btn can be positioned relative to the view btn */
.swcpd-view-btn-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 6px;
}
.swcpd-view-btn-wrap .swcpd-view-btn {
  width: 100%;
  margin-bottom: 0; /* wrapper handles spacing */
}

/* Design-present dot indicator on the view thumbnail */
.swcpd-view-design-dot {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin: 2px auto 0;
  box-shadow: 0 0 0 2px #fff;
}

/* Change-image overlay button — shown on hover of the wrap */
.swcpd-view-change-img-btn {
  position: absolute;
  bottom: 6px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(37,67,223,0.90);
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.swcpd-view-btn-wrap:hover .swcpd-view-change-img-btn {
  opacity: 1;
  transform: scale(1);
}
.swcpd-view-change-img-btn:hover {
  background: var(--primary-dark);
}

/* Temporarily remove a view from this design/order without deleting its
   configured supplier or admin image. */
.swcpd-view-hide-btn {
  position: absolute;
  top: 4px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: rgba(35,35,40,.82);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.swcpd-view-hide-btn:hover { background: #c62828; }
.swcpd-hidden-views {
  width: 100%;
  padding: 8px;
  border: 1px dashed #cfd3dc;
  border-radius: 6px;
  font-size: 10px;
  color: #777;
  line-height: 1.8;
}
.swcpd-hidden-views button {
  border: 1px solid #ccd2e2;
  background: #fff;
  color: var(--primary);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 10px;
  cursor: pointer;
}

/* ── Gallery image grid inside the picker drawer ─────────────────── */
.swcpd-view-img-picker {
  padding: 4px 0;
}
.swcpd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.swcpd-gallery-thumb {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: #f8f8f8;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.swcpd-gallery-thumb:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,67,223,0.18);
  transform: scale(1.03);
  z-index: 2;
}
.swcpd-gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,67,223,0.28);
  background: #eef1ff;
}
.swcpd-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 5px;
}
.swcpd-gallery-check {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}

/* ============================================================
   NEW QUANTITY GRID — PCNA-style compact color×size matrix
   (only active on products where useNewGrid = true in JS)
   ============================================================ */

/* ── Section heading ──────────────────────────────────────── */
.swcpd-grid-heading {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin: 0 0 12px;
}

/* ── Grid container ───────────────────────────────────────── */
.swcpd-qty-grid {
  width: 100%;
  overflow: auto;          /* UN solo scroll para header+body juntos */
  max-height: 400px;
  border: 1px solid #e2e5ed;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* ── Header row (size labels) ─────────────────────────────── */
.swcpd-grid-header {
  display: flex;
  align-items: center;
  background: #f5f7fb;
  border-bottom: 1px solid #e2e5ed;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.swcpd-grid-header .swcpd-grid-color-col {
  min-width: 90px;
  flex: 0 0 90px;
  padding: 8px 6px;
}
.swcpd-grid-size-head {
  flex: 1 1 72px;
  min-width: 60px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  padding: 8px 4px;
  border-left: 1px solid #e2e5ed;
}

/* ── Color rows ───────────────────────────────────────────── */
.swcpd-grid-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #eef0f5;
  transition: background 0.1s;
}
.swcpd-grid-row:last-child {
  border-bottom: none;
}
.swcpd-grid-row:hover {
  background: #fafbff;
}

/* Color name column */
.swcpd-grid-color-col {
  min-width: 90px;
  flex: 0 0 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
}
.swcpd-grid-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.swcpd-grid-color-name {
  font-size: 11px;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 80px;
}

/* ── Cell (input + stock) ─────────────────────────────────── */
.swcpd-grid-cell {
  flex: 1 1 72px;
  min-width: 60px;
  border-left: 1px solid #eef0f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 4px;
}
.swcpd-grid-qty {
  width: 100%;
  max-width: 56px;
  height: 34px;
  border: 1px solid #cdd2de;
  border-radius: 5px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  background: #fff;
  padding: 0 4px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
.swcpd-grid-qty::-webkit-outer-spin-button,
.swcpd-grid-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.swcpd-grid-qty:focus {
  outline: none;
  border-color: #2543df;
  box-shadow: 0 0 0 3px rgba(37,67,223,0.12);
}
.swcpd-grid-qty::placeholder { color: #b0b6c6; font-weight: 400; }

/* Stock number below input */
.swcpd-grid-stock {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  line-height: 1;
  min-height: 14px;
  text-align: center;
}
.swcpd-grid-stock--na {
  min-height: 14px;
}

/* ── Sureship note ────────────────────────────────────────── */
.swcpd-sureship-note {
  font-size: 12px;
  color: #555;
  margin: 6px 0 14px;
  line-height: 1.4;
}
.swcpd-sureship-note a {
  color: #2543df;
}

/* ── Wide screen — grid takes more space ──────────────────── */
.swcpd-qty-drawer--grid .swcpd-step1-left {
  flex: 1 1 auto;
  min-width: 0;
}

/* Scrollable grid body for many colors */
.swcpd-grid-body {
  /* Sin scroll propio — el .swcpd-qty-grid lo maneja con un solo scrollbar */
}

/* ── Grid qty input: sin stock → readonly + aspecto deshabilitado ─── */
.swcpd-grid-qty--nostock {
  background: #f5f5f5 !important;
  color: #aaa !important;
  cursor: not-allowed !important;
  border-color: #e0e0e0 !important;
  pointer-events: none;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   Toast notifications (replaces the never-defined swcpdAlert calls)
   ═══════════════════════════════════════════════════════════════ */
#swcpd-toast-host {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}

.swcpd-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .22s ease, transform .22s ease;
}
.swcpd-toast--show { opacity: 1; transform: translateY(0); }
.swcpd-toast--warning { background: #7a4a00; border: 1px solid #e67e22; }
.swcpd-toast--error   { background: #5a1414; border: 1px solid var(--accent); }
.swcpd-toast--info    { background: #14324a; border: 1px solid #2543df; }
.swcpd-toast-icon { font-size: 15px; line-height: 1; }
.swcpd-toast-msg  { line-height: 1.35; }

/* ═══════════════════════════════════════════════════════════════
   Minimum-quantity guard — red border on the specific input(s) that
   have a value + a small inline message (both hidden until the
   customer has actually typed something).
   ═══════════════════════════════════════════════════════════════ */
.swcpd-qty-invalid {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.18) !important;
  background: #fff5f5 !important;
}

.swcpd-min-warning {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fdecea;
  color: #a5241c;
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  width: fit-content;
}
.swcpd-min-warning::before { content: '⚠️'; font-size: 10px; }

/* ── Card-mode minimum-qty warning states (SanMar) ─────────────────────── */

/* Whole line card gets an orange-red border when it has entries but total
   is below the product minimum. Overrides the active (blue) border. */
.swcpd-line-card--warn {
  border-color: var(--accent, #e63946) !important;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.13) !important;
  background: #fffafa !important;
}
/* Don't double-border with the active state — warn takes priority */
.swcpd-line-card--warn.swcpd-line-active {
  border-color: var(--accent, #e63946) !important;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.18) !important;
}

/* Min-note at the bottom of each card turns red and shows live countdown */
.swcpd-min-note--warn {
  color: #a5241c !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}

/* ═══════════════════════════════════════════════════════════════
   THEME / ELEMENTOR ISOLATION
   Keep global theme button, form and typography rules from leaking into
   the standalone designer UI.
   ═══════════════════════════════════════════════════════════════ */
body.swcpd-editor-body .swcpd-app {
  --primary:#2543df !important;
  --primary-dark:#1a33b8 !important;
  --accent:#d9363e !important;
  --border:#e0e3ea !important;
  --text:#151515 !important;
  --text-muted:#666 !important;
  isolation:isolate !important;
  font-family:var(--font) !important;
  font-size:14px !important;
  line-height:1.5 !important;
  color:var(--text) !important;
}
body.swcpd-editor-body .swcpd-app [hidden] { display:none !important; }
body.swcpd-editor-body .swcpd-app .swcpd-action-icon {
  color:currentColor !important; font-size:14px !important; font-weight:800 !important;
  line-height:1 !important; margin-right:3px !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-delete-artwork {
  margin-top:10px !important; background:#fff !important; color:#b4232d !important;
  border:1px solid #d8a3a7 !important; font-size:12px !important; font-weight:700 !important;
}
body.swcpd-editor-body .swcpd-app #swcpd-panel-editart > .swcpd-row:first-of-type {
  display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:5px !important;
}
body.swcpd-editor-body .swcpd-app #swcpd-panel-editart > .swcpd-row:first-of-type button {
  width:auto !important; min-width:0 !important; margin:0 !important; padding:8px 3px !important;
  font-size:10px !important; font-weight:700 !important; white-space:nowrap !important; overflow:hidden !important;
}
@media (min-width:1025px) {
  body.swcpd-editor-body .swcpd-app .swcpd-views-close {
    display:none !important;
  }
  body.swcpd-editor-body .swcpd-app #swcpd-art-done { display:none !important; }
}
@media (max-width:640px) {
  .swcpd-step2-pills .swcpd-quantity-badge { align-items:flex-start; flex-direction:column; }
  .swcpd-size-qty-chips { justify-content:flex-start; }
}
@media (hover:hover) and (pointer:fine) {
  body.swcpd-editor-body .swcpd-app #swcpd-art-done { display:none !important; }
}
body.swcpd-editor-body .swcpd-app .swcpd-review-button {
  background:#fff !important; color:var(--primary) !important;
  border:1.5px solid var(--primary) !important; box-shadow:none !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-review-button:hover {
  background:#eef1ff !important; color:var(--primary-dark) !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-add-color-btn,
body.swcpd-editor-body .swcpd-app .swcpd-method-pill-btn,
body.swcpd-editor-body .swcpd-app .swcpd-color-swatch {
  border-color:#cfd3dc !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-add-color-btn { color:var(--primary) !important; }
body.swcpd-editor-body .swcpd-app .swcpd-method-pill-btn:hover,
body.swcpd-editor-body .swcpd-app .swcpd-color-swatch:hover { border-color:var(--primary) !important; }
body.swcpd-editor-body .swcpd-app .swcpd-method-pill-btn.active,
body.swcpd-editor-body .swcpd-app .swcpd-color-swatch.swcpd-swatch-active {
  border-color:var(--primary) !important; background-color:var(--primary);
}

@media (max-width:1024px) {
  body.swcpd-editor-body .swcpd-app { padding-bottom:64px !important; }
  body.swcpd-editor-body .swcpd-app .swcpd-sidebar {
    position:fixed !important; left:0 !important; right:0 !important; bottom:0 !important;
    width:100% !important; min-height:60px !important; z-index:60 !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-panel-wrap,
  body.swcpd-editor-body .swcpd-app .swcpd-views { bottom:60px !important; }
  body.swcpd-editor-body .swcpd-app .swcpd-tool {
    border:0 !important; color:#fff !important; font-size:11px !important; font-weight:700 !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-tool:hover,
  body.swcpd-editor-body .swcpd-app .swcpd-tool.active {
    border:0 !important; background:rgba(255,255,255,.16) !important; color:#fff !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-tool-icon {
    color:#fff !important; font-size:18px !important; font-weight:800 !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-tool-copy strong {
    color:#fff !important; font-size:10px !important; font-weight:700 !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-drawer-body { padding-bottom:76px !important; }
  body.swcpd-editor-body .swcpd-app .swcpd-size-grid {
    display:grid !important; grid-template-columns:repeat(5,minmax(48px,1fr)) !important; gap:6px !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-size-col { min-width:0 !important; width:100% !important; }
  body.swcpd-editor-body .swcpd-app .swcpd-size-qty {
    width:100% !important; height:38px !important; min-width:0 !important;
    padding:3px !important; font-size:13px !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-drawer-footer {
    border-top:0 !important; padding-top:10px !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-step1-overview { grid-template-columns:1fr !important; }
}

/* Views is a mobile/tablet toolbar action only. Width is the sole condition. */
@media (max-width:1024px) {
  body.swcpd-editor-body .swcpd-app #swcpd-mobile-views-tool { display:flex !important; }
}
@media (min-width:1025px) {
  body.swcpd-editor-body .swcpd-app #swcpd-mobile-views-tool { display:none !important; }
}
body.swcpd-editor-body .swcpd-app,
body.swcpd-editor-body .swcpd-app * {
  box-sizing:border-box !important;
}
body.swcpd-editor-body .swcpd-app h1,
body.swcpd-editor-body .swcpd-app h2,
body.swcpd-editor-body .swcpd-app h3,
body.swcpd-editor-body .swcpd-app h4,
body.swcpd-editor-body .swcpd-app h5,
body.swcpd-editor-body .swcpd-app h6,
body.swcpd-editor-body .swcpd-app p,
body.swcpd-editor-body .swcpd-app label {
  font-family:var(--font) !important;
  text-transform:none !important;
  text-decoration:none !important;
  letter-spacing:normal;
  text-shadow:none !important;
}
body.swcpd-editor-body .swcpd-app button,
body.swcpd-editor-body .swcpd-app input,
body.swcpd-editor-body .swcpd-app select,
body.swcpd-editor-body .swcpd-app textarea {
  font-family:var(--font) !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  text-shadow:none !important;
  filter:none !important;
}
body.swcpd-editor-body .swcpd-app button {
  appearance:none !important;
  -webkit-appearance:none !important;
  text-decoration:none !important;
  box-shadow:none;
  outline:0 !important;
}
body.swcpd-editor-body .swcpd-app button::before,
body.swcpd-editor-body .swcpd-app button::after { content:none !important; display:none !important; }
body.swcpd-editor-body .swcpd-app button:focus-visible,
body.swcpd-editor-body .swcpd-app input:focus-visible,
body.swcpd-editor-body .swcpd-app select:focus-visible,
body.swcpd-editor-body .swcpd-app textarea:focus-visible {
  outline:2px solid rgba(37,67,223,.35) !important;
  outline-offset:2px !important;
}
body.swcpd-editor-body .swcpd-app input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not(.swcpd-qty-invalid):not(.swcpd-grid-qty--nostock),
body.swcpd-editor-body .swcpd-app select,
body.swcpd-editor-body .swcpd-app textarea {
  background:#fff !important;
  color:#151515 !important;
  border-color:#cfd3dc !important;
  border-style:solid !important;
  box-shadow:none !important;
}
body.swcpd-editor-body .swcpd-app input:focus,
body.swcpd-editor-body .swcpd-app select:focus,
body.swcpd-editor-body .swcpd-app textarea:focus { border-color:var(--primary) !important; }
body.swcpd-editor-body .swcpd-app .swcpd-tool {
  margin:0 !important;
  font-size:12px !important;
  border-top-color:rgba(255,255,255,.12) !important;
  border-right-color:rgba(255,255,255,.12) !important;
  border-bottom-color:rgba(255,255,255,.12) !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-view-btn,
body.swcpd-editor-body .swcpd-app .swcpd-gallery-thumb {
  border-color:var(--border) !important;
  background:#fff !important;
  color:#333 !important;
  box-shadow:none !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-view-btn.active,
body.swcpd-editor-body .swcpd-app .swcpd-gallery-thumb.active {
  border-color:var(--primary) !important;
  box-shadow:0 0 0 2px rgba(37,67,223,.2) !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-primary,
body.swcpd-editor-body .swcpd-app .swcpd-next-button,
body.swcpd-editor-body .swcpd-app .swcpd-change-color-count {
  border-color:var(--primary-dark) !important;
  background:var(--primary) !important;
  color:#fff !important;
}
body.swcpd-editor-body .swcpd-app .swcpd-secondary {
  border-color:var(--primary) !important;
  background:#fff !important;
  color:var(--primary) !important;
}
@media (min-width:1025px) {
  body.swcpd-editor-body .swcpd-app .swcpd-art-categories {
    max-height:70vh !important;
  }
  body.swcpd-editor-body .swcpd-app .swcpd-change-color-count,
  body.swcpd-editor-body .swcpd-app .swcpd-mobile-edit-action {
    display:none !important;
  }
}
body.swcpd-editor-body .swcpd-app .swcpd-drawer,
body.swcpd-editor-body .swcpd-app .swcpd-panel-wrap,
body.swcpd-editor-body .swcpd-app .swcpd-panel,
body.swcpd-editor-body .swcpd-app .swcpd-views {
  color:var(--text) !important;
  border-color:var(--border) !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   PRINT AREA EDITOR — admin only
   ══════════════════════════════════════════════════════════════════════════════ */

/* Admin button in topbar */
#swcpd-edit-print-areas {
  background: #c8203a !important;
  border-color: #c8203a !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
}
#swcpd-edit-print-areas:hover { background: #a81830 !important; }

/* Full-screen editor overlay */
#swcpd-pa-overlay {
  display: none;
  position: fixed;
  /* Stay above the WordPress admin bar (z-index: 99999) */
  top: var(--wp-admin--admin-bar--height, 32px);
  right: 0; bottom: 0; left: 0;
  z-index: 100001;
  background: #111827;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#swcpd-pa-overlay.swcpd-pa-active { display: flex; }

/* Header bar */
#swcpd-pa-header {
  background: #1f2937;
  border-bottom: 2px solid #c8203a;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 50px;
  flex-shrink: 0;
  overflow-x: auto;
}
#swcpd-pa-header .pa-title {
  font-size: 12px; font-weight: 700; color: #f87171;
  text-transform: uppercase; letter-spacing: .8px;
  margin-right: 6px; white-space: nowrap;
}
#swcpd-pa-header .pa-sep {
  width: 1px; height: 24px; background: #374151; flex-shrink: 0; margin: 0 4px;
}
#swcpd-pa-header .pa-save-status {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  margin-left: 4px; white-space: nowrap;
}
#swcpd-pa-header .pa-save-status.ok   { background:#064e3b; color:#6ee7b7; }
#swcpd-pa-header .pa-save-status.err  { background:#7f1d1d; color:#fca5a5; }
#swcpd-pa-header .pa-save-status.saving{ background:#78350f; color:#fcd34d; }

/* Tool buttons */
.pa-btn {
  height: 32px; padding: 0 11px; border-radius: 5px;
  border: 1px solid #374151; background: #111827; color: #9ca3af;
  cursor: pointer; font-size: 11px; font-weight: 600; white-space: nowrap;
  transition: all .12s; flex-shrink: 0;
}
.pa-btn:hover { background: #374151; color: #f3f4f6; }
.pa-btn.pa-active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.pa-btn.pa-danger { border-color: #7f1d1d; color: #f87171; }
.pa-btn.pa-danger:hover { background: #7f1d1d; color: #fff; }
.pa-btn.pa-primary { background: #15803d; border-color: #15803d; color: #fff; font-size: 12px; }
.pa-btn.pa-primary:hover { background: #166534; }
.pa-btn.pa-exit { background: #374151; border-color: #4b5563; color: #e5e7eb; }
.pa-btn.pa-exit:hover { background: #4b5563; }

/* Editor body — 3-column layout */
#swcpd-pa-body {
  flex: 1; display: flex; overflow: hidden;
}

/* Left: views list */
#swcpd-pa-views {
  width: 90px; background: #1f2937; border-right: 1px solid #374151;
  flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto;
}
#swcpd-pa-views-title {
  font-size: 9px; color: #6b7280; text-transform: uppercase; letter-spacing: .6px;
  padding: 8px 6px 6px; border-bottom: 1px solid #374151; text-align: center;
}
.pa-view-btn {
  padding: 9px 4px; text-align: center; font-size: 10px; font-weight: 600;
  cursor: pointer; color: #6b7280; border: none; background: none;
  width: 100%; border-bottom: 1px solid #374151; transition: all .12s;
  position: relative;
}
.pa-view-btn:hover { background: #374151; color: #d1d5db; }
.pa-view-btn.pa-active { background: #1d4ed8; color: #fff; }
.pa-view-btn .pa-vc {
  display: inline-block; background: #f59e0b; color: #1f2937;
  border-radius: 8px; padding: 0 5px; font-size: 9px; margin-top: 2px;
  font-weight: 800;
}

/* Center: canvas */
#swcpd-pa-stage canvas {
  border: 2px solid #c8203a !important;
  box-shadow: 0 0 30px rgba(200,32,58,.3);
}
/* Canvas wrapper: prevent flex from shrinking it below its natural size */
#swcpd-pa-stage .canvas-container {
  flex-shrink: 0 !important;
}
  line-height: 1.6;
}
#swcpd-pa-props-inner { display: none; }
.pa-prop-row { margin-bottom: 12px; }
.pa-prop-row label {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: #9ca3af;
  margin-bottom: 4px;
}
.pa-prop-row input[type=text],
.pa-prop-row select {
  width: 100%; background: #111827; border: 1px solid #374151;
  color: #e5e7eb; padding: 6px 8px; border-radius: 4px;
  font-size: 12px; box-sizing: border-box; font-family: inherit;
}
.pa-prop-row input[type=text]:focus,
.pa-prop-row select:focus {
  outline: none; border-color: #1d4ed8;
}
.pa-shape-type-badge {
  display: inline-block; font-size: 10px; background: #374151;
  color: #9ca3af; padding: 2px 8px; border-radius: 3px;
  margin-bottom: 10px;
}

/* ── Admin Floating Action Button ────────────────────────────────────────── */
#swcpd-admin-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 8999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #c8203a;
  color: #fff;
  border-radius: 30px;
  padding: 10px 18px 10px 14px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(200,32,58,.55);
  font-size: 13px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  user-select: none;
  transition: transform .15s, box-shadow .15s, background .15s;
  border: 2px solid rgba(255,255,255,.25);
  letter-spacing: .3px;
}
#swcpd-admin-fab:hover {
  background: #a81830;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(200,32,58,.7);
}
#swcpd-admin-fab:active { transform: translateY(0); }
#swcpd-admin-fab-icon { font-size: 18px; line-height: 1; }
#swcpd-admin-fab-label { white-space: nowrap; }
/* Hide FAB while editor is open */
.swcpd-pa-active ~ #swcpd-admin-fab,
body:has(#swcpd-pa-overlay.swcpd-pa-active) #swcpd-admin-fab { display: none; }

/* Also hide the topbar edit-print-areas button on narrow screens where it might overflow */
@media (max-width: 900px) {
  #swcpd-edit-print-areas { display: none !important; }
}

/* ── View image picker ───────────────────────────────────────────────────── */
.swcpd-vp-upload-row{display:flex;align-items:center;gap:10px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--border,#e5e7eb)}
.swcpd-vp-upload-lbl{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:6px;border:1.5px solid var(--primary,#2543df);color:var(--primary,#2543df);background:#fff;font-size:12px;font-weight:700;cursor:pointer;transition:background .12s;user-select:none}
.swcpd-vp-upload-lbl:hover{background:#f0f3ff}
.swcpd-vp-thumb-wrap{position:relative;display:inline-block}
.swcpd-vp-del{position:absolute;top:2px;right:2px;width:20px;height:20px;padding:0;border-radius:50%;border:none;background:rgba(220,38,38,.85);color:#fff;font-size:9px;line-height:20px;text-align:center;cursor:pointer;display:none;z-index:2}
.swcpd-vp-thumb-wrap:hover .swcpd-vp-del{display:block}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT AREA EDITOR
═══════════════════════════════════════════════════════════════════════════ */
#swcpd-admin-fab {
  position:fixed;bottom:24px;left:24px;z-index:8999;
  display:flex;align-items:center;gap:8px;
  background:#c8203a;color:#fff;border-radius:30px;padding:10px 18px;
  cursor:pointer;box-shadow:0 4px 20px rgba(200,32,58,.5);
  font-size:13px;font-weight:700;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  user-select:none;transition:transform .15s,box-shadow .15s;
}
#swcpd-admin-fab:hover{transform:translateY(-2px);box-shadow:0 8px 28px rgba(200,32,58,.65);}
body:has(#swcpd-pa-overlay.pa-open) #swcpd-admin-fab{display:none;}

#swcpd-pa-overlay {
  display:none;position:fixed;
  top:var(--wp-admin--admin-bar--height,32px);right:0;bottom:0;left:0;
  z-index:100001;background:#0f172a;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  color:#e2e8f0;flex-direction:column;overflow:hidden;
}
#swcpd-pa-overlay.pa-open{display:flex;}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
#swcpd-pa-bar {
  height:48px;flex-shrink:0;
  display:flex;align-items:center;gap:4px;padding:0 10px;
  background:#1e293b;border-bottom:1px solid #334155;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
}
#swcpd-pa-bar::-webkit-scrollbar{display:none;}
.pa-btn {
  display:inline-flex;align-items:center;gap:4px;
  padding:5px 10px;border-radius:6px;border:1px solid #334155;
  background:#1e293b;color:#94a3b8;font-size:12px;font-weight:600;
  cursor:pointer;white-space:nowrap;flex-shrink:0;
  transition:background .1s,color .1s,border-color .1s;
}
.pa-btn:hover{background:#334155;color:#f1f5f9;border-color:#475569;}
.pa-btn.pa-active{background:#1d4ed8;border-color:#3b82f6;color:#fff;}
.pa-btn-exit{background:#7f1d1d;border-color:#ef4444;color:#fca5a5;font-weight:700;}
.pa-btn-exit:hover{background:#991b1b;border-color:#f87171;color:#fff;}
.pa-btn-save{background:#166534;border-color:#16a34a;color:#bbf7d0;}
.pa-btn-save:hover{background:#15803d;}
.pa-btn-del{color:#f87171;border-color:#7f1d1d;}
.pa-btn-del:hover{background:#7f1d1d;color:#fff;border-color:#ef4444;}
/* Label readonly */
.pa-prop input[type=text][readonly] {
  background:#0f172a;color:#60a5fa;cursor:default;
  border-color:#1e3a8a;opacity:1;
}
.pa-del-shape{width:100%;margin-top:10px;justify-content:center;padding:7px;}
.pa-sep{width:1px;height:22px;background:#334155;margin:0 4px;flex-shrink:0;}
.pa-lbl{font-size:10px;color:#475569;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;padding:0 2px;flex-shrink:0;}
.pa-spacer{flex:1;}
.pa-save-st{font-size:11px;font-weight:600;padding:3px 8px;border-radius:4px;white-space:nowrap;}
.pa-save-st.saving{color:#64748b;}.pa-save-st.ok{color:#4ade80;}.pa-save-st.err{color:#f87171;}

/* ── Body ────────────────────────────────────────────────────────────────── */
#swcpd-pa-body{flex:1;display:flex;min-height:0;overflow:hidden;}

/* ── Left: views ─────────────────────────────────────────────────────────── */
#swcpd-pa-views {
  width:120px;flex-shrink:0;background:#1e293b;
  border-right:1px solid #334155;
  display:flex;flex-direction:column;overflow-y:auto;padding:0 0 6px;gap:0;
}
/* Gallery grid (all product images) */
#swcpd-pa-gallery-grid {
  padding:6px;display:grid;grid-template-columns:1fr 1fr;gap:4px;
  border-bottom:1px solid #334155;
}
.pa-gallery-img {
  width:100%;aspect-ratio:1;object-fit:contain;border-radius:4px;
  border:2px solid #334155;cursor:pointer;background:#0f172a;
  transition:border-color .15s;
}
.pa-gallery-img:hover { border-color:#3b82f6; }
/* Gallery toggle button in panel header */
.pa-gallery-btn {
  background:transparent;border:1px solid #334155;border-radius:4px;
  color:#64748b;font-size:11px;padding:2px 5px;cursor:pointer;line-height:1;
  transition:background .1s,color .1s;
}
.pa-gallery-btn:hover,.pa-gallery-btn.active { background:#1e3a8a;color:#93c5fd;border-color:#3b82f6; }
/* Upload tiny button at the bottom of views panel */
.pa-views-upload { padding:6px 8px;border-top:1px solid #334155;margin-top:auto; }
.pa-views-upload-btn {
  width:100%;padding:5px;font-size:11px;background:#0f172a;
  border:1px dashed #334155;border-radius:5px;color:#64748b;cursor:pointer;
}
.pa-views-upload-btn:hover { border-color:#3b82f6;color:#93c5fd; }
/* View buttons with thumbnail */
.pa-vbtn {
  display:flex;flex-direction:column;align-items:center;
  padding:6px 4px 5px;border-radius:0;border:0;border-bottom:1px solid #1e293b;
  background:#1e293b;color:#94a3b8;font-size:10px;font-weight:600;
  cursor:pointer;text-align:center;transition:background .1s,color .1s;gap:4px;
}
.pa-vbtn:hover{background:#334155;color:#e2e8f0;}
.pa-vbtn.pa-active{background:#1d4ed8;color:#fff;}
.pa-vbtn-img {
  width:72px;height:72px;object-fit:contain;border-radius:4px;
  background:#0f172a;border:1px solid #334155;flex-shrink:0;
}
.pa-vbtn.pa-active .pa-vbtn-img { border-color:#3b82f6; }
.pa-vbtn-label { font-size:10px;font-weight:600;line-height:1.2; }
.pa-vc{font-size:9px;font-weight:700;background:#dc2626;color:#fff;padding:1px 4px;border-radius:8px;display:none;}

/* ── Center: canvas stage ────────────────────────────────────────────────── */
#swcpd-pa-stage {
  flex:1;min-width:0;min-height:0;
  display:flex;align-items:center;justify-content:center;
  background:#0f172a;overflow:hidden;position:relative;
}
#swcpd-pa-stage .canvas-container{box-shadow:0 4px 40px rgba(0,0,0,.8);}
#swcpd-pa-poly-hint {
  position:absolute;bottom:12px;left:50%;transform:translateX(-50%);
  background:rgba(29,78,216,.92);color:#dbeafe;
  font-size:11px;padding:5px 14px;border-radius:20px;
  pointer-events:none;white-space:nowrap;display:none;
}

/* ── Right panel: always visible ─────────────────────────────────────────── */
#swcpd-pa-right {
  width:280px;flex-shrink:0;background:#1e293b;
  border-left:1px solid #334155;
  display:flex;flex-direction:column;overflow-y:auto;padding:0;
}
#swcpd-pa-right::-webkit-scrollbar{width:3px;}
#swcpd-pa-right::-webkit-scrollbar-thumb{background:#334155;border-radius:2px;}

.pa-panel-hd {
  font-size:10px;font-weight:700;color:#64748b;
  text-transform:uppercase;letter-spacing:.07em;
  padding:10px 12px 6px;border-bottom:1px solid #1e293b;
  display:flex;align-items:center;justify-content:space-between;
  flex-shrink:0;
}
.pa-panel-hint{font-size:9px;color:#475569;text-transform:none;letter-spacing:0;font-weight:400;}

/* Location list */
#swcpd-pa-locs-list{padding:6px 8px;display:flex;flex-direction:column;gap:4px;}
.pa-no-locs{color:#475569;font-size:11px;padding:8px 4px;text-align:center;}

.pa-loc-item {
  display:flex;align-items:flex-start;gap:8px;
  padding:7px 10px;border-radius:6px;border:1px solid #334155;
  background:#0f172a;cursor:pointer;
  transition:background .1s,border-color .1s;
  text-align:left;width:100%;box-sizing:border-box;
}
.pa-loc-item:hover{background:#1e3a8a22;border-color:#3b82f6;}
.pa-loc-item.pa-loc-active{background:#1e3a8a;border-color:#3b82f6;}
.pa-loc-item.pa-loc-used{border-color:#16a34a33;}
.pa-loc-dot {
  width:10px;height:10px;border-radius:50%;flex-shrink:0;margin-top:2px;
  border:2px solid #475569;background:transparent;
}
.pa-loc-item.pa-loc-active .pa-loc-dot{background:#60a5fa;border-color:#60a5fa;}
.pa-loc-item.pa-loc-used .pa-loc-dot{background:#4ade80;border-color:#4ade80;}
.pa-loc-name{
  font-size:11px;font-weight:600;color:#cbd5e1;line-height:1.35;
  word-break:break-word;flex:1;
}
.pa-loc-item.pa-loc-active .pa-loc-name{color:#fff;}
.pa-loc-item.pa-loc-used .pa-loc-name{color:#86efac;}
.pa-loc-count{flex-shrink:0;font-size:9px;font-weight:700;color:#fff;background:#dc2626;padding:1px 5px;border-radius:8px;display:none;margin-left:auto;margin-top:1px;}

/* Shape section */
#swcpd-pa-shape-section{padding:0 8px 12px;border-top:1px solid #334155;}
#swcpd-pa-props-body{padding:8px 4px 0;}
.pa-shape-badge{display:inline-block;background:#1e3a8a;color:#93c5fd;font-size:9px;font-weight:700;padding:2px 7px;border-radius:8px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;}
.pa-prop{margin-bottom:10px;}
.pa-prop label{display:block;font-size:10px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px;}
.pa-prop input[type=text],.pa-prop select{width:100%;padding:6px 8px;border-radius:5px;border:1px solid #334155;background:#0f172a;color:#e2e8f0;font-size:12px;box-sizing:border-box;}
.pa-prop input:focus,.pa-prop select:focus{outline:none;border-color:#3b82f6;}
.pa-linked-loc{font-size:12px;color:#94a3b8;padding:6px 8px;background:#0f172a;border-radius:5px;border:1px solid #334155;min-height:30px;display:flex;align-items:center;}
.pa-linked-loc.has-loc{color:#60a5fa;border-color:#1d4ed8;}

@media (max-width:768px){
  #swcpd-pa-views{width:76px;}
  #swcpd-pa-right{width:160px;}
  .pa-loc-name{font-size:10px;}
}

/* ══════════════════════════════════════════════════════════════════════════
   PA EDITOR — VIEW PANEL REDESIGN (mirrors main designer's VIEWS panel)
   ══════════════════════════════════════════════════════════════════════════ */

/* Override old panel sizing */
#swcpd-pa-views {
  width:124px !important;overflow-y:hidden !important;padding:0 !important;gap:0 !important;
  flex-direction:column !important;
}

/* Views list (scrollable area with the thumbnails) */
#swcpd-pa-views-list {
  flex:1;overflow-y:auto;overflow-x:hidden;
  padding:6px 6px 4px;display:flex;flex-direction:column;gap:6px;
}
#swcpd-pa-views-list::-webkit-scrollbar{width:3px;}
#swcpd-pa-views-list::-webkit-scrollbar-thumb{background:#334155;border-radius:2px;}

/* Wrapper (relative-positioned, same as .swcpd-view-btn-wrap) */
.pa-vbtn-wrap {
  position:relative;width:100%;flex-shrink:0;
}

/* Main view button — mirrors swcpd-view-btn adapted for dark theme */
.pa-vbtn {
  width:100%;background:#0f172a;
  border:1.5px solid #334155;border-radius:7px;
  padding:5px 5px 4px;cursor:pointer;
  text-align:center;
  transition:border-color .15s,box-shadow .15s;
  display:block;
}
.pa-vbtn:hover { border-color:#475569; }
.pa-vbtn.pa-active {
  border-color:#3b82f6;
  box-shadow:0 0 0 2px rgba(59,130,246,.3);
}

/* Thumbnail preview — mirrors .swcpd-view-preview */
.pa-view-preview {
  position:relative;display:block;
  width:88px;height:88px;
  margin:0 auto 3px;overflow:hidden;border-radius:4px;
  background:#1e293b;
}
.pa-view-preview img {
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:contain;margin:0;
}
/* Label under thumbnail */
.pa-vbtn .pa-vbtn-label {
  font-size:10px;font-weight:700;display:block;
  color:#94a3b8;line-height:1.2;
}
.pa-vbtn.pa-active .pa-vbtn-label { color:#93c5fd; }

/* Count badge (areas defined for this view) */
.pa-vbtn .pa-vc {
  font-size:9px;font-weight:700;background:#dc2626;color:#fff;
  padding:1px 4px;border-radius:8px;display:none;
  margin-top:2px;
}

/* Placeholder when no image yet */
.pa-view-placeholder {
  width:88px;height:88px;background:#0f172a;border-radius:4px;
  border:1px dashed #475569;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  margin:0 auto 3px;font-size:9px;color:#64748b;text-align:center;padding:4px;
  box-sizing:border-box;
}

/* 🔍 overlay button — mirrors .swcpd-view-change-img-btn */
.pa-view-search-btn {
  position:absolute;bottom:6px;right:2px;
  width:22px;height:22px;border-radius:50%;
  background:rgba(59,130,246,.9);border:1.5px solid #fff;
  color:#fff;font-size:11px;line-height:1;cursor:pointer;padding:0;
  display:flex;align-items:center;justify-content:center;
  opacity:0;transform:scale(.85);
  transition:opacity .15s,transform .15s;
  z-index:5;box-shadow:0 2px 6px rgba(0,0,0,.5);
}
.pa-vbtn-wrap:hover .pa-view-search-btn { opacity:1;transform:scale(1); }
.pa-view-search-btn:hover { background:#1d4ed8; }

/* Floating image picker popover */
.pa-view-img-picker {
  position:fixed;z-index:100002;
  background:#1e293b;border:1px solid #334155;border-radius:10px;
  box-shadow:0 8px 32px rgba(0,0,0,.7);
  padding:10px;width:230px;
  max-height:340px;overflow-y:auto;
}
.pa-view-img-picker-hd {
  font-size:10px;font-weight:700;color:#64748b;
  text-transform:uppercase;letter-spacing:.06em;
  margin-bottom:8px;display:flex;align-items:center;justify-content:space-between;
}
.pa-view-img-picker-close {
  background:transparent;border:0;color:#94a3b8;font-size:14px;
  cursor:pointer;padding:0 2px;line-height:1;
}
.pa-view-img-picker-close:hover{color:#fff;}
.pa-view-img-picker-grid {
  display:grid;grid-template-columns:repeat(3,1fr);gap:5px;
  margin-bottom:8px;
}
.pa-picker-thumb {
  aspect-ratio:1;object-fit:contain;border-radius:5px;
  border:2px solid #334155;cursor:pointer;background:#0f172a;
  transition:border-color .12s;width:100%;
}
.pa-picker-thumb:hover { border-color:#3b82f6; }
.pa-picker-upload-row { padding-top:8px;border-top:1px solid #334155; }
.pa-picker-upload-btn {
  width:100%;padding:6px;font-size:11px;background:#0f172a;
  border:1px dashed #334155;border-radius:5px;color:#64748b;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:5px;
}
.pa-picker-upload-btn:hover{border-color:#3b82f6;color:#93c5fd;}

/* Upload-all button at bottom of views panel */
.pa-views-upload { padding:5px 6px 7px;border-top:1px solid #334155;flex-shrink:0; }
.pa-views-upload-btn {
  width:100%;padding:5px 4px;font-size:10px;background:#0f172a;
  border:1px dashed #334155;border-radius:5px;color:#64748b;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:4px;
}
.pa-views-upload-btn:hover{border-color:#3b82f6;color:#93c5fd;}

/* Responsive */
@media (max-width:768px){
  #swcpd-pa-views{width:100px !important;}
  .pa-view-preview{width:70px !important;height:70px !important;}
  .pa-view-placeholder{width:70px !important;height:70px !important;}
}

/* Active (currently selected) image in the picker */
.pa-picker-thumb-active {
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 2px rgba(59,130,246,.4);
}

/* ── Zoom controls ─────────────────────────────────────────────────────────
   Floating pill in the bottom-right corner of the canvas stage.
   Stays compact so it never competes with the main designer UI.
   ───────────────────────────────────────────────────────────────────────── */
.swcpd-zoom-controls {
  position: absolute;
  bottom: 28px;
  left: 14px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.13), 0 1px 3px rgba(0, 0, 0, 0.08);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  transition: box-shadow 0.15s;
}
.swcpd-zoom-controls:hover {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.17), 0 1px 4px rgba(0, 0, 0, 0.10);
}
/* When zoomed in, give the pill a subtle accent tint */
.swcpd-zoom-controls.swcpd-zoom-zoomed {
  background: rgba(248, 249, 255, 0.96);
  border-color: rgba(37, 67, 223, 0.22);
}

/* +  /  − buttons */
.swcpd-zoom-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 300;
  line-height: 1;
  color: #2a2a2a;
  cursor: pointer;
  transition: background 0.11s, transform 0.09s, color 0.11s;
  flex-shrink: 0;
}
.swcpd-zoom-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.07);
  color: #111;
}
.swcpd-zoom-btn:active:not(:disabled) {
  background: rgba(0, 0, 0, 0.13);
  transform: scale(0.90);
}
.swcpd-zoom-btn:disabled {
  color: #ccc;
  cursor: default;
}

/* Percentage readout / reset tap target */
.swcpd-zoom-level {
  all: unset;
  font-size: 11px;
  font-weight: 700;
  color: #444;
  letter-spacing: -0.01em;
  min-width: 36px;
  text-align: center;
  cursor: pointer;
  border-radius: 999px;
  padding: 4px 3px;
  transition: background 0.11s, color 0.11s;
  flex-shrink: 0;
}
.swcpd-zoom-level:hover {
  background: rgba(37, 67, 223, 0.08);
  color: var(--primary, #2543df);
}
.swcpd-zoom-level:active {
  background: rgba(37, 67, 223, 0.14);
}
/* Accent the label when zoomed */
.swcpd-zoom-zoomed .swcpd-zoom-level {
  color: var(--primary, #2543df);
}

/* Mobile: hide zoom pill entirely — pinch-to-zoom is available on touch */
@media (max-width: 1024px) {
  .swcpd-zoom-controls {
    display: none;
  }
}

/* ── Decoration method visual effects ──────────────────────────────────────
   The .canvas-container gets a CSS filter applied via JS when the customer
   picks a decoration method like Embroidery or Laser.
   Smooth transition makes the effect feel intentional, not jarring.
   ───────────────────────────────────────────────────────────────────────── */
.canvas-container {
  transition: filter 0.40s ease;
}

/* Badge shown inside the stage when an effect is active */
.swcpd-deco-preview-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.11);
  font-size: 11px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  pointer-events: none;          /* never blocks canvas interaction */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.swcpd-deco-preview-badge.visible {
  opacity: 1;
}
.swcpd-deco-preview-badge-icon {
  font-size: 13px;
  line-height: 1;
}

/* Method-specific badge accent colors */
.swcpd-deco-preview-badge[data-method="embroidery"] {
  border-color: rgba(180, 120, 60, 0.30);
  background: rgba(255, 252, 245, 0.95);
  color: #7a4a10;
}
.swcpd-deco-preview-badge[data-method="laser"] {
  border-color: rgba(80, 80, 80, 0.25);
  background: rgba(248, 248, 248, 0.96);
  color: #444;
}
.swcpd-deco-preview-badge[data-method="deboss"] {
  border-color: rgba(100, 100, 140, 0.25);
  background: rgba(248, 248, 252, 0.96);
  color: #445;
}

/* ── PAE multi-method checkboxes ────────────────────────────────────────────
   Replaces the single-select <select> — each method gets its own checkbox
   so the admin can associate one area with several methods at once.
   ───────────────────────────────────────────────────────────────────────── */
.pa-method-checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}
.pa-method-check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: .03em;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background .12s;
  user-select: none;
  -webkit-user-select: none;
  text-transform: uppercase;
}
.pa-method-check-row:hover {
  background: rgba(255,255,255,.10);
}
.pa-method-check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}
.pa-method-check-row span {
  line-height: 1.3;
  flex: 1;
}

/* ── PAE Method Filter ──────────────────────────────────────────────────────
   Method filter select at the top of the Print Area Editor location list.
   ───────────────────────────────────────────────────────────────────────── */
.pa-method-filter-wrap {
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
}
.pa-method-filter-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.pa-method-filter-sel {
  width: 100%;
  padding: 5px 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  outline: none;
}
.pa-method-filter-sel:focus {
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 2px rgba(59,130,246,.2);
}
.pa-method-filter-sel option {
  background: #1e293b;
  color: #e2e8f0;
}

/* ══════════════════════════════════════════════════════════════════════════
   3D VIEWER — button + modal
   Botón flotante en la esquina inferior derecha del stage.
   Modal de pantalla completa con canvas Three.js.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Vista 3D button ──────────────────────────────────────────────────── */
.swcpd-3d-view-btn {
  position: absolute;
  bottom: 28px;
  right: 14px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(37, 67, 223, 0.90);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  box-shadow: 0 2px 10px rgba(37, 67, 223, 0.32);
  transition: background 0.14s, box-shadow 0.14s, transform 0.09s;
}
.swcpd-3d-view-btn:hover {
  background: rgba(20, 50, 196, 0.97);
  box-shadow: 0 3px 14px rgba(37, 67, 223, 0.45);
}
.swcpd-3d-view-btn:active {
  transform: scale(0.94);
}
@media (max-width: 1024px) {
  .swcpd-3d-view-btn {
    bottom: 12px;
    right: 10px;
    padding: 6px 10px;
    font-size: 10px;
  }
  .swcpd-3d-view-btn span { display: none; }
}
@media (max-width: 700px) {
  .swcpd-3d-view-btn {
    bottom: 8px;
    right: 8px;
    padding: 7px 9px;
  }
}

/* ── 3D Modal overlay ─────────────────────────────────────────────────── */
.swcpd-3d-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.swcpd-3d-modal.active {
  display: flex;
}
.swcpd-3d-modal-inner {
  background: #111128;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  max-height: 94vh;
  box-shadow: 0 28px 64px rgba(0,0,0,0.65);
}
.swcpd-3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #0d0d22;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.swcpd-3d-title {
  font-size: 12px;
  font-weight: 700;
  color: #c8c8e8;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 40px);
}
.swcpd-3d-close {
  all: unset;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.swcpd-3d-close:hover {
  background: rgba(255,255,255,0.11);
  color: #eee;
}
.swcpd-3d-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 520px;
  background: #0c0c1e;
  overflow: hidden;
}
#swcpd-3d-canvas {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
.swcpd-3d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0c1e;
  z-index: 2;
}
.swcpd-3d-loading-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.swcpd-3d-spin {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(100,100,200,0.25);
  border-top-color: #7070dd;
  border-radius: 50%;
  animation: swcpd3dSpin 0.8s linear infinite;
}
@keyframes swcpd3dSpin { to { transform: rotate(360deg); } }
.swcpd-3d-loading-msg {
  font-size: 13px;
  font-weight: 600;
  color: #8888cc;
  letter-spacing: 0.04em;
}
.swcpd-3d-loading-sub {
  font-size: 11px;
  color: #555580;
  letter-spacing: 0.03em;
}
.swcpd-3d-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  background: #0d0d22;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}
.swcpd-3d-hint-item {
  font-size: 10px;
  color: #55558a;
  letter-spacing: 0.03em;
}
.swcpd-3d-hint-dot {
  font-size: 10px;
  color: #333360;
}
.swcpd-3d-img-badge {
  font-size: 10px;
  color: #4a4a7a;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #2a2a50;
  border-radius: 999px;
  display: none;
}
.swcpd-3d-img-badge:not(:empty) {
  display: inline-block;
}
@media (max-width: 700px) {
  .swcpd-3d-modal {
    padding: 0;
  }
  .swcpd-3d-modal-inner {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100dvh;
  }
  .swcpd-3d-canvas-wrap {
    height: auto;
    flex: 1 1 auto;
  }
}
