/* ============================================
   BuyBuyKart — Custom Designer Tool (designer.css)
   ============================================ */
:root {
  --bg: #f0ede8;
  --surface: #ffffff;
  --surface2: #f7f5f2;
  --ink: #1c1917;
  --ink2: #44403c;
  --muted: #a8a29e;
  --border: #e7e5e4;
  --border2: #d6d3d1;
  --accent: #e85d26;
  --accent2: #f97316;
  --green: #16a34a;
  --red: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.15);
  --toolbar: 248px;
  --panel: 324px;
  --topbar: 60px;
  --bottombar: 56px;
  --radius: 10px;
  --radius-sm: 6px;
}

html, body.designer-mode {
  height: 100vh;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  margin: 0;
  padding: 0;
}
body.designer-mode *, body.designer-mode *::before, body.designer-mode *::after {
  box-sizing: border-box;
}

/* -- LOADER -- */
#loader { position: fixed; inset: 0; background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: opacity .5s .1s; }
#loader.out { opacity: 0; pointer-events: none; }
.ld-logo { font-size: 2.2rem; font-weight: 700; color: #fff; letter-spacing: -.01em; margin-bottom: 6px; display:flex; align-items:center; gap:8px;}
.ld-logo span { color: var(--accent); }
.ld-tag { font-size: .7rem; color: rgba(255,255,255,.4); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 32px; }
.ld-track { width: 200px; height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.ld-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0; animation: ldFill 1.8s ease forwards; }
@keyframes ldFill { 0% { width: 0; } 50% { width: 60%; } 100% { width: 100%; } }
.ld-msg { margin-top: 14px; font-size: .72rem; color: rgba(255,255,255,.35); letter-spacing: 1px; }

/* -- TOPBAR -- */
#topbar {
  position: fixed; inset: 0 auto auto 0; height: var(--topbar);
  width: 100%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.tb-brand { display: flex; align-items: center; gap: 10px; }
.tb-logo { font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: -.01em; display:flex; align-items:center; gap:6px; text-decoration:none;}
.tb-logo span { color: var(--accent); }
.tb-divider { width: 1px; height: 18px; background: rgba(255,255,255,.15); }
.tb-name input { background: none; border: none; border-bottom: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.9); font-family: 'Outfit', sans-serif; font-size: .92rem; font-weight: 500; padding: 2px 6px; width: 180px; outline: none; transition: border-color .2s; }
.tb-name input:focus { border-bottom-color: var(--accent); }
.tb-actions { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content:center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--radius-sm); font-family: 'Outfit', sans-serif; font-size: .85rem; font-weight: 600; cursor: pointer; border: none; transition: all .15s; white-space: nowrap; }
.btn-ghost { background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.12); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent2); }
.btn-accent:disabled { opacity: .4; cursor: not-allowed; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.1); }
.btn-green:disabled { opacity: .4; cursor: not-allowed; }
.badge { background: rgba(255,255,255,.15); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: .65rem; font-weight: 700; }
.badge.active { background: var(--accent); }

/* -- LEFT TOOLBAR -- */
#toolbar {
  position: fixed; left: 0; top: var(--topbar); bottom: 0;
  width: var(--toolbar); background: var(--ink);
  display: flex; flex-direction: column;
  padding: 20px 14px 16px; gap: 0; z-index: 150;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
}
#toolbar::-webkit-scrollbar { width: 0; }
.tool-welcome { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.5); letter-spacing: .3px; margin-bottom: 16px; line-height: 1.4; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 8px; border-radius: 10px; cursor: pointer; border: 1.5px solid rgba(255,255,255,.04); color: rgba(255,255,255,.6); font-size: .65rem; font-weight: 700; letter-spacing: .3px; text-align: center; transition: all .15s; font-family: 'Outfit', sans-serif; line-height: 1.3; }
.tool-tile:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.tool-tile.active { background: rgba(232,93,38,.2); border-color: var(--accent); color: var(--accent); }
.tile-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }
.tool-sep { display: none; }

/* -- SLIDE PANEL -- */
#panel {
  position: fixed; left: var(--toolbar); top: var(--topbar); bottom: 0;
  width: var(--panel); background: var(--surface);
  border-right: 1px solid var(--border); z-index: 140;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(-1 * var(--panel)));
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow);
}
#panel.open { transform: translateX(0); }
.ph { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--surface2); }
.ph-title { font-size: .72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink2); }
.ph-close { background: none; border: none; cursor: pointer; color: var(--muted); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all .15s; font-size: .9rem; }
.ph-close:hover { background: var(--border); color: var(--ink); }
.pb { flex: 1; overflow-y: auto; padding: 14px 16px; padding-bottom: 80px; }
.pb::-webkit-scrollbar { width: 4px; }
.pb::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* Panel Controls */
.s { margin-bottom: 18px; }
.sl { font-size: .62rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.sl::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ta { width: 100%; background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: 'Outfit', sans-serif; font-size: .95rem; color: var(--ink); resize: none; height: 76px; outline: none; transition: border-color .2s; line-height: 1.4; }
.ta:focus { border-color: var(--accent); }
.add-btn { width: 100%; margin-top: 8px; padding: 11px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; border: none; font-family: 'Outfit', sans-serif; font-size: .8rem; font-weight: 700; cursor: pointer; transition: all .15s; letter-spacing: .3px; }
.add-btn:hover { background: var(--ink2); }
.qty-opt { padding: 12px; border: 2px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer; transition: all .15s; font-family: 'Outfit', sans-serif; text-align:center;}
.qty-opt:hover, .qty-opt.on { border-color: var(--accent); background: #fff5f0; }

/* Font and Colors */
.filter-group-label { font-size: .62rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.rc-sw { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all .15s; flex-shrink: 0; position: relative; }
.rc-sw:hover { transform: scale(1.15); }
.rc-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,93,38,.3); }
.fc { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 6px 4px 4px; cursor: pointer; text-align: center; transition: all .15s; font-size: .58rem; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fc:hover, .fc.on { border-color: var(--accent); background: #fff5f0; color: var(--ink); }
.fc .fp { font-size: 1.1rem; margin-bottom: 1px; line-height: 1; color: var(--ink);}
.font-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); color: var(--ink); font-family: 'Outfit', sans-serif; font-size: .78rem; outline: none; }
.font-search:focus { border-color: var(--accent); }
.row { display: flex; align-items: center; gap: 8px; }
.row input[type=range] { flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px; }
.rn { font-size: .78rem; color: var(--muted); min-width: 30px; text-align: right; font-weight: 600; }

/* Upload Dropzone override to match new theme */
.upload-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; background: var(--surface2); transition: all 0.2s; }
.upload-dropzone:hover, .upload-dropzone.drag-over { background: #F4F7FB; border-color: var(--accent); }

/* Clip-art grid override */
.clipart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clipart-btn { aspect-ratio: 1; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 14px; color: var(--ink); transition: all 0.2s; }
.clipart-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff5f0; }
.clipart-btn svg { width: 100%; height: 100%; }

/* Layer Row override */
.layer-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: .8rem; transition: all 0.2s; background: var(--surface); font-family: 'Outfit', sans-serif;}
.layer-row:hover, .layer-row.active { border-color: var(--accent); background: #fff5f0; }

/* Template Themes */
.template-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.template-theme-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: all 0.2s; background: var(--surface); }
.template-theme-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.template-theme-swatch { height: 44px; }
.template-theme-name { font-size: .75rem; font-weight: 600; padding: 6px 8px; text-align:center; font-family:'Outfit', sans-serif;}

/* Product Switch */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: all 0.2s; background: var(--surface); text-align:center;}
.product-card:hover, .product-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background:#fff5f0;}

/* Main workspace positioning */
.designer-workspace { position: fixed; top: var(--topbar); left: var(--toolbar); right: 0; bottom: 0; display: flex; overflow: hidden; z-index:100; transition: left .22s cubic-bezier(.4,0,.2,1); }
body.panel-open .designer-workspace { left: calc(var(--toolbar) + var(--panel)); }
/* =========================================================
   CANVAS AREA (Realistic Workspace)
========================================================= */
.designer-header {
  height: 60px;
  background: var(--ink);
  color: #fff;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 50;
  position: relative;
}

.dh-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dh-logo {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dh-logo .dot {
  width: 10px;
  height: 10px;
  background: var(--coral);
  border-radius: 50%;
}

.dh-logo span.coral {
  color: var(--coral);
}

.dh-logo:hover {
  text-decoration: none;
}

.dh-title-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  width: 200px;
}

.dh-title-input:hover {
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.dh-title-input:focus {
  outline: none;
  border-bottom-color: var(--coral);
  background: rgba(255, 255, 255, 0.1);
}

.dh-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dh-icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 400;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0.8;
}

.dh-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.dh-btn-coral {
  background: var(--coral);
  color: #fff;
  border: none;
  padding: 8px 24px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  margin-left: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dh-btn-coral:hover {
  background: #E5573C;
}

/* =========================================================
   SIDEBARS (Vistaprint Style)
========================================================= */
.designer-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 64px);
}

/* --- Primary Sidebar (Dark/Original Plugin Style) --- */
.ds-primary {
  width: 90px;
  background: #2D2D2D;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 90px;
  flex-shrink: 0;
  z-index: 45;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}

.ds-primary::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.ds-tool {
  width: 100%;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.ds-tool:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ds-tool.active {
  color: var(--coral);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--coral);
}

.ds-tool-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.ds-tool-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* --- Secondary Sidebar (Light Panel) --- */
.ds-secondary {
  width: 320px;
  background: #fff;
  border-right: 1px solid var(--stitch);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 40;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.02);
}

.ds-panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--stitch);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-panel-header h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  margin: 0;
}

.ds-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--ink-40);
  cursor: pointer;
}

.ds-close:hover {
  color: var(--ink);
}

.ds-panel-content {
  padding: 20px 20px 90px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Text Panel specific */
.ds-textarea {
  width: 100%;
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 16px;
}

.ds-textarea:focus {
  outline: none;
  border-color: var(--coral);
}

.ds-btn-full {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
}

.ds-btn-full:hover {
  background: #000;
}

.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.font-btn {
  border: 1px solid var(--stitch);
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.font-btn:hover {
  border-color: var(--coral);
}

.font-btn.active {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
}

.f-preview {
  font-size: 20px;
  margin-bottom: 4px;
}

.f-name {
  font-size: 11px;
  color: var(--ink-70);
}

/* Color Circles */
.color-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.color-circle:hover,
.color-circle.active {
  transform: scale(1.15);
  border-color: var(--ink);
}

/* Upload Panel */
.upload-dropzone {
  border: 2px dashed var(--stitch);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--paper-soft);
  transition: all 0.2s;
}

.upload-dropzone:hover {
  background: #F4F7FB;
  border-color: var(--coral);
}

.upload-icon {
  font-size: 32px;
  color: var(--ink-40);
  margin-bottom: 12px;
}

.upload-dropzone.drag-over {
  background: #F4F7FB;
  border-color: var(--coral);
}

/* Panel helper text */
.panel-desc {
  color: var(--ink-70);
  font-size: 14px;
  margin-bottom: 16px;
}

.panel-subhead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-40);
  margin-bottom: 12px;
}

/* Bold / Italic toggle */
.style-btn-row {
  display: flex;
  gap: 6px;
  margin: 0 0 24px;
  flex-wrap: wrap;
  align-items: center;
}

.ds-style-btn {
  width: 44px;
  height: 40px;
  border: 1px solid var(--stitch);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.ds-style-btn:hover {
  border-color: var(--coral);
}

.ds-style-btn.active {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
}

/* Clip-art grid */
.clipart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.clipart-btn {
  aspect-ratio: 1;
  border: 1px solid var(--stitch);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--ink);
  transition: all 0.2s;
}

.clipart-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
}

.clipart-btn svg {
  width: 100%;
  height: 100%;
}

/* Change-product list */
.product-switch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-card {
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.product-card:hover,
.product-card.active {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.ds-btn-outline {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--stitch);
  text-align: left;
}

.ds-btn-outline:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* =========================================================
   CANVAS AREA (Realistic Workspace)
========================================================= */
.designer-canvas-area {
  flex: 1;
  background: #f4f5f7;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image: radial-gradient(#d1d1d1 1px, transparent 1px);
  background-size: 20px 20px;
}

.canvas-container {
  position: relative;
  width: 500px;
  height: 600px;
  /* Basic centering setup, size will adapt based on product */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The base product image (e.g. Blank T-shirt) */
.product-base-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  /* Let clicks pass through to canvas if needed */
  user-select: none;
}

/* The printable safe area */
/* Coordinates will vary per product, but we do a generic center box for now */
.print-area {
  position: absolute;
  top: 30%;
  left: 30%;
  width: 40%;
  height: 40%;
  pointer-events: none;
}

/* Base Print Area (Bleed) - Blue Dashed */
.print-area::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(66, 133, 244, 0.6);
  pointer-events: none;
  z-index: 10;
}

/* Safety Margin - Green Dashed */
.print-area::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0, 0, 0, 0.15);
  font-weight: 600;
  font-size: 14px;
}

/* ---------------------------------
   Vistaprint Style Preview Mode 
--------------------------------- */
.print-area.preview-mode::before,
.print-area.preview-mode::after {
  display: none !important;
}

.designer-workspace.preview-mode .ds-primary,
.designer-workspace.preview-mode .ds-secondary {
  display: none !important;
}

.designer-workspace.preview-mode .designer-canvas-area {
  background: transparent !important;
}

.designer-workspace.preview-mode #canvasContainer {
  transform: scale(1.15);
  transition: transform 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}

/* =========================================
   PRINT GUIDES — Safety line (inner, green) sits
   inside the Bleed box (outer, blue, via .print-area::before)
   ========================================= */
.ds-guide-safety {
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(52, 168, 83, 0.65);
  pointer-events: none;
  z-index: 11;
}

.print-area.preview-mode .ds-guide-safety {
  display: none !important;
}

.ds-dim-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--stitch);
  color: var(--ink-70);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 30;
}

.designer-workspace.preview-mode .ds-dim-label {
  display: none;
}

/* Bleed / safety overflow warning on a design element */
.design-element.out-of-bounds {
  outline: 1.5px dashed #E53935 !important;
}

/* =========================================
   OUT OF STOCK OVERLAY
   ========================================= */
.ds-oos-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: rgba(244, 245, 247, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.ds-oos-card {
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--stitch);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
}

.ds-oos-emoji {
  font-size: 42px;
  margin-bottom: 12px;
}

.ds-oos-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.ds-oos-card p {
  color: var(--ink-70);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}

/* =========================================
   COLOR SWATCHES WITH NAME LABELS
   ========================================= */
.color-options.named {
  gap: 16px 14px;
}

.color-swatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 56px;
}

.color-swatch-wrap .color-circle {
  margin: 0;
}

.color-swatch-wrap .swatch-name {
  font-size: 10.5px;
  color: var(--ink-70);
  text-align: center;
  line-height: 1.2;
}

/* =========================================
   NAMES & NUMBERS PANEL
   ========================================= */
.nn-summary {
  background: var(--paper-soft);
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* =========================================
   TEMPLATE THEME CARDS (Visiting Cards)
   ========================================= */
.template-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.template-theme-card {
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.template-theme-card:hover,
.template-theme-card.active {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.template-theme-swatch {
  height: 44px;
}

.template-theme-name {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
}

/* =========================================
   LAYERS PANEL
   ========================================= */
.layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.layer-row:hover,
.layer-row.active {
  border-color: var(--coral);
  background: var(--coral-light);
}

.layer-row .layer-icon {
  width: 22px;
  text-align: center;
}

.layer-row .layer-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-row .layer-del {
  color: var(--ink-40);
  font-size: 13px;
}

.layer-row .layer-del:hover {
  color: #E53935;
}

/* =========================================
   MUG 3D-STYLE ROTATE PREVIEW HINT
   ========================================= */
.ds-rotate-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 90;
  pointer-events: none;
}

/* Design Elements (Text/Images placed by user) */
.design-element {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: move;
  z-index: 20;
  user-select: none;
  white-space: pre-wrap;
  text-align: center;
  pointer-events: auto;
  /* Fixes inheritance from print-area */
  padding: 4px;
}

/* Visual feedback on hover */
.design-element:hover {
  outline: 1px dashed rgba(255, 255, 255, 0.4);
  /* Contrast in dark mode */
}

/* Selection highlight */
.design-element.selected {
  outline: 1.5px dashed var(--coral);
}

/* Base handle style (Lumise 4 corners) */
.el-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 1.5px solid var(--coral);
  color: var(--ink);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  z-index: 25;
}

.design-element.selected .el-handle {
  display: flex;
}

/* TL: Delete */
.element-delete {
  top: -11px;
  left: -11px;
  cursor: pointer;
  color: #E53935;
}

/* TR: Rotate */
.element-rotate {
  top: -11px;
  right: -11px;
  cursor: grab;
}

/* BL: Duplicate */
.element-duplicate {
  bottom: -11px;
  left: -11px;
  cursor: pointer;
}

/* BR: Resize */
.element-resize {
  bottom: -11px;
  right: -11px;
  cursor: nwse-resize;
}

/* Image / clipart elements */
.design-element img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.design-element[data-type="clipart"] {
  width: 72px;
}

.design-element[data-type="clipart"] svg {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Rotation support */
.design-element {
  --rot: 0deg;
  transform: translate(-50%, -50%) rotate(var(--rot));
}

/* =========================================
   RIGHT VIEWS BAR
   ========================================= */
.ds-views {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
}

.view-btn {
  width: 50px;
  height: 60px;
  background: #fff;
  border: 1px solid var(--stitch);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.view-btn:hover {
  border-color: var(--coral);
}

.view-btn.active {
  border-color: var(--coral);
  color: var(--coral);
}

.view-btn img {
  width: 24px;
  height: 24px;
  opacity: 0.5;
  margin-bottom: 4px;
}

.view-btn.active img {
  opacity: 1;
}

.view-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* =========================================
   BOTTOM BAR ACTION
   ========================================= */
.designer-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: #fff;
  border-top: 1px solid var(--stitch);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 60;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

.db-product-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-product-thumb {
  width: 40px;
  height: 40px;
  background: var(--paper-soft);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.db-product-name {
  font-weight: 700;
  font-size: 15px;
}

.db-product-price {
  color: var(--ink-70);
  font-size: 14px;
}

.db-change-btn {
  background: none;
  border: 1px solid var(--stitch);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.db-change-btn:hover {
  border-color: var(--ink);
}

.db-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-price-total {
  font-size: 22px;
  font-weight: 800;
}

.db-order-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 0 32px;
  height: 44px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s;
}

.db-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* =========================================
   TOAST NOTIFICATION
   ========================================= */
.ds-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}

.ds-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------
   Vistaprint Style Preview Mode 
--------------------------------- */
.print-area.preview-mode::before,
.print-area.preview-mode::after {
  display: none !important;
}

.designer-workspace.preview-mode .ds-primary,
.designer-workspace.preview-mode .ds-secondary {
  display: none !important;
}

.designer-workspace.preview-mode .designer-canvas-area {
  background: transparent !important;
}

.designer-workspace.preview-mode #canvasContainer {
  transform: scale(1.15);
  transition: transform 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}

/* =========================================
   INLINE TEXT EDITING
   ========================================= */
.design-element.inline-editing {
  outline: 2px solid var(--coral) !important;
  background: rgba(255, 255, 255, 0.08);
  cursor: text !important;
  z-index: 30 !important;
  min-width: 40px;
  min-height: 20px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(229, 87, 60, 0.15);
}

.design-element.inline-editing:focus {
  outline: 2px solid var(--coral) !important;
}

.design-element.inline-editing .el-handle {
  display: none !important;
}

/* Text element double-click hint cursor */
.design-element[data-type="text"]:hover {
  outline: 1px dashed rgba(229, 87, 60, 0.4);
  cursor: move;
}

.design-element[data-type="text"]:hover::after {
  content: '✏️';
  position: absolute;
  top: -20px;
  right: -8px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  animation: fadeInHint 0.3s ease forwards;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide hint when element is selected (handles already visible) */
.design-element.selected[data-type="text"]:hover::after {
  display: none;
}

/* =========================================
   ALIGNMENT BUTTONS — SVG icon centering
   ========================================= */
.ds-style-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-style-btn svg {
  display: block;
}

/* =========================================
   PANEL HINT (Tip text at bottom of panel)
   ========================================= */
.panel-hint {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFFDE7 100%);
  border: 1px solid #FFE082;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: #5D4037;
  margin-top: 20px;
  line-height: 1.5;
}

.panel-hint strong {
  color: #E65100;
}

/* =========================================
   TEMPLATE DEFAULT ELEMENTS ENTRANCE
   ========================================= */
.design-element {
  animation: templateFadeIn 0.35s ease-out;
}

@keyframes templateFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Ensure proper display for multi-line text elements */
.design-element[data-type="text"] {
  white-space: pre-wrap;
  word-break: break-word;
}