/* PrintAí Editor — Mobile-first, clean, accessible */
:root {
  --acc: #E84C1E;
  --acc-l: #FF6B40;
  --acc-bg: rgba(232,76,30,.09);
  --acc-border: rgba(232,76,30,.28);
  --bg:  #111;
  --bg2: #1A1A1A;
  --bg3: #222;
  --bg4: #2A2A2A;
  --bg5: #333;
  --border: rgba(255,255,255,.08);
  --border2: rgba(255,255,255,.14);
  --text: #F0EDE8;
  --text2: #A8A4A0;
  --text3: #666;
  --r: 10px; --r-sm: 6px; --r-lg: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --topbar: 52px;
  --bottombar: 72px;
  --sidebar: 72px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select { font-family: var(--font); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 99px; }

/* ── LOADING ── */
#pai-loading {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 9999; transition: opacity .3s;
}
#pai-loading.out { opacity: 0; pointer-events: none; }
.pai-load-logo { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.pai-load-logo em { font-style: normal; color: var(--acc); }
.pai-load-bar { width: 120px; height: 3px; background: var(--bg4); border-radius: 99px; overflow: hidden; }
.pai-load-fill { height: 100%; background: var(--acc); animation: ldAnim 1.1s ease-in-out infinite; }
@keyframes ldAnim { 0%{width:0;margin-left:0} 50%{width:50%;margin-left:20%} 100%{width:0;margin-left:100%} }
.pai-load-txt { font-size: 12px; color: var(--text3); }

/* ── LAYOUT ── */
#pai-app { height: 100dvh; display: flex; flex-direction: column; }

/* ── TOPBAR ── */
#pai-topbar {
  height: var(--topbar); flex-shrink: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px; gap: 8px; z-index: 50;
}
.pai-back {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: all .15s; flex-shrink: 0;
}
.pai-back:hover, .pai-back:active { background: var(--bg3); color: var(--text); }
.pai-back svg { width: 20px; height: 20px; }
.pai-prod-info { flex: 1; min-width: 0; }
.pai-prod-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pai-prod-sub { font-size: 11px; color: var(--text2); }
.pai-topbar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pai-tbtn {
  height: 34px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; transition: all .15s;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  color: var(--text2); border: 1px solid var(--border);
}
.pai-tbtn:hover { background: var(--bg3); color: var(--text); }
.pai-tbtn.acc { background: var(--acc); color: #fff; border-color: transparent; font-weight: 600; }
.pai-tbtn.acc:hover { background: var(--acc-l); }
.pai-tbtn svg { width: 14px; height: 14px; flex-shrink: 0; }
/* hide labels on mobile */
.pai-tbtn-label { display: none; }
@media (min-width: 480px) { .pai-tbtn-label { display: inline; } }

/* ── MAIN ── */
#pai-main { flex: 1; display: flex; overflow: hidden; position: relative; }

/* ── CANVAS ZONE ── */
#pai-canvas-zone {
  flex: 1; overflow: hidden; position: relative;
  background: #1A1A1A;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 20px 20px;
  display: flex; align-items: center; justify-content: center;
}
#pai-canvas-wrap {
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.07);
  transition: transform .2s;
}
#pai-canvas { display: block; }
/* Mockup overlay sits above canvas */
#pai-mockup-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 10;
}
#pai-mockup-layer img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
/* Guides */
.pai-guide { position: absolute; pointer-events: none; }
#g-bleed { border: 1px dashed rgba(255,60,60,.5); }
#g-safe  { border: 1px dashed rgba(60,180,255,.4); }

/* ── TOOLBAR (bottom of canvas area on mobile) ── */
#pai-toolbar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--bg2); border-top: 1px solid var(--border);
  display: flex; align-items: center; height: 48px;
  padding: 0 8px; gap: 2px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#pai-toolbar::-webkit-scrollbar { display: none; }
.ptbtn {
  flex-shrink: 0; height: 36px; padding: 0 8px;
  border-radius: var(--r-sm); font-size: 11.5px; font-weight: 500;
  color: var(--text2); transition: all .12s;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1px solid transparent;
}
.ptbtn:hover, .ptbtn:active { background: var(--bg3); color: var(--text); }
.ptbtn.on { background: var(--acc-bg); color: var(--acc); border-color: var(--acc-border); }
.ptbtn svg { width: 14px; height: 14px; flex-shrink: 0; }
.ptbtn-color { display: flex; align-items: center; gap: 5px; }
.ptbtn-dot { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255,255,255,.2); flex-shrink: 0; }
.pt-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; margin: 0 2px; }
.pt-fsize { width: 38px; height: 28px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); text-align: center; font-size: 11px; outline: none; padding: 0 3px; }
.pt-fsize:focus { border-color: var(--acc-border); }

/* idle toolbar msg */
#tb-idle { font-size: 11.5px; color: var(--text3); display: flex; align-items: center; gap: 5px; padding: 0 8px; }
#tb-idle svg { width: 13px; height: 13px; }
#tb-text, #tb-shape, #tb-img { display: none; align-items: center; gap: 2px; }

/* ── RIGHT SIDEBAR (desktop) ── */
#pai-sidebar {
  width: 0; overflow: hidden; transition: width .2s;
  background: var(--bg2); border-left: 1px solid var(--border);
  flex-shrink: 0; display: flex; flex-direction: column;
}
#pai-sidebar.open { width: 260px; }
@media (min-width: 768px) { #pai-sidebar { width: 260px; } }

/* ── BOTTOM SHEET (mobile slide-up panel) ── */
#pai-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--bg2); border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--border2);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 75dvh; display: flex; flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
}
#pai-sheet.open { transform: translateY(0); }
.pai-sheet-handle {
  width: 36px; height: 4px; border-radius: 99px;
  background: var(--bg5); margin: 10px auto 4px;
  flex-shrink: 0; cursor: pointer;
}
.pai-sheet-title {
  padding: 6px 16px 12px; font-size: 14px; font-weight: 600;
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
}
.pai-sheet-close {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 14px;
}
.pai-sheet-body { overflow-y: auto; flex: 1; padding: 0 16px 24px; }
@media (min-width: 768px) {
  #pai-sheet { display: none; }
}
/* Overlay for sheet */
#pai-sheet-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 99; backdrop-filter: blur(2px);
}
#pai-sheet-overlay.open { display: block; }

/* ── STEP WIZARD (mobile first-time UX) ── */
#pai-wizard {
  position: fixed; inset: 0; background: var(--bg); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 20px;
}
#pai-wizard.hidden { display: none; }
.pai-wiz-icon { font-size: 52px; }
.pai-wiz-title { font-size: 22px; font-weight: 700; }
.pai-wiz-sub { font-size: 14px; color: var(--text2); line-height: 1.6; max-width: 300px; }
.pai-wiz-steps { display: flex; gap: 6px; }
.pai-wiz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg5); }
.pai-wiz-dot.on { background: var(--acc); }
.pai-wiz-btn {
  background: var(--acc); color: #fff; border-radius: var(--r);
  padding: 14px 32px; font-size: 15px; font-weight: 600; width: 100%; max-width: 280px;
  transition: all .15s;
}
.pai-wiz-btn:active { transform: scale(.97); }
.pai-wiz-skip { font-size: 13px; color: var(--text3); }

/* ── SIDE TABS (mockup faces) ── */
#pai-faces {
  display: flex; gap: 8px; padding: 10px;
  overflow-x: auto; flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
#pai-faces::-webkit-scrollbar { display: none; }
.pai-face {
  flex-shrink: 0; border-radius: var(--r-sm);
  border: 2px solid var(--border); background: var(--bg3);
  width: 56px; height: 56px; overflow: hidden; cursor: pointer;
  transition: all .15s; position: relative; display: flex;
  align-items: center; justify-content: center;
}
.pai-face:hover, .pai-face:active { border-color: var(--border2); }
.pai-face.active { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.pai-face img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pai-face-empty { font-size: 10px; color: var(--text3); text-align: center; padding: 4px; }
.pai-face-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6); font-size: 8px; color: #fff;
  text-align: center; padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── SIDEBAR CONTENT ── */
.pai-sb-section { border-bottom: 1px solid var(--border); padding: 12px; }
.pai-sb-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: 8px; }
/* Color grid */
.pai-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pai-sw {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
}
.pai-sw:hover { transform: scale(1.15); }
.pai-sw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.pai-hex-row { display: flex; gap: 6px; }
.pai-hex-pick { width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer; padding: 0; background: none; }
.pai-hex-pick::-webkit-color-swatch-wrapper { padding: 0; border-radius: var(--r-sm); }
.pai-hex-pick::-webkit-color-swatch { border: none; border-radius: var(--r-sm); }
.pai-hex-inp {
  flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 8px; color: var(--text); font-size: 12px; font-family: monospace; outline: none;
}
.pai-hex-inp:focus { border-color: var(--acc-border); }
/* Font list */
.pai-font-search {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px; color: var(--text);
  font-size: 12px; outline: none; margin-bottom: 8px;
}
.pai-font-search:focus { border-color: var(--acc-border); }
.pai-font-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: var(--r-sm); cursor: pointer; transition: background .1s;
}
.pai-font-item:hover, .pai-font-item:active { background: var(--bg3); }
.pai-font-prev { font-size: 20px; min-width: 48px; color: var(--text); }
.pai-font-name { font-size: 12px; color: var(--text2); }
/* Shape grid */
.pai-shape-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pai-shape-item {
  aspect-ratio: 1; border-radius: var(--r-sm); background: var(--bg3);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.pai-shape-item:hover, .pai-shape-item:active { border-color: var(--acc-border); background: var(--acc-bg); }
.pai-shape-item svg { width: 20px; height: 20px; fill: var(--text2); }
.pai-shape-item:hover svg, .pai-shape-item:active svg { fill: var(--acc); }
/* Upload zone */
.pai-dropzone {
  border: 2px dashed var(--border); border-radius: var(--r);
  padding: 20px 12px; text-align: center; cursor: pointer; transition: all .2s;
  margin-bottom: 10px;
}
.pai-dropzone:hover, .pai-dropzone.drag { border-color: var(--acc); background: var(--acc-bg); }
.pai-dropzone svg { width: 24px; height: 24px; stroke: var(--text3); margin-bottom: 6px; display: block; margin-left: auto; margin-right: auto; }
.pai-dropzone:hover svg { stroke: var(--acc); }
.pai-dropzone p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.pai-dropzone span { color: var(--acc); }
/* AI tools */
.pai-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pai-ai-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 8px; cursor: pointer; transition: all .15s; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.pai-ai-btn:hover, .pai-ai-btn:active { border-color: var(--acc-border); background: var(--acc-bg); }
.pai-ai-icon { font-size: 22px; }
.pai-ai-label { font-size: 11px; font-weight: 500; color: var(--text); }
.pai-ai-sub { font-size: 10px; color: var(--text3); }
/* Layers */
.pai-layer {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px;
  border-radius: var(--r-sm); cursor: pointer; transition: background .1s;
  border: 1px solid transparent; margin-bottom: 3px;
}
.pai-layer:hover { background: var(--bg3); }
.pai-layer.on { background: var(--acc-bg); border-color: var(--acc-border); }
.pai-layer-th {
  width: 26px; height: 26px; border-radius: 4px; background: var(--bg4);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text3); flex-shrink: 0;
}
.pai-layer-info { flex: 1; min-width: 0; }
.pai-layer-n { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pai-layer-t { font-size: 10px; color: var(--text3); }
.pai-layer-vis { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: .5; }
.pai-layer-vis:hover { opacity: 1; }
.pai-layer-vis svg { width: 13px; height: 13px; stroke: var(--text2); }
/* Text styles quick add */
.pai-txts { display: grid; gap: 6px; margin-bottom: 8px; }
.pai-txts-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px 12px; cursor: pointer; text-align: left; transition: all .15s;
}
.pai-txts-btn:hover, .pai-txts-btn:active { border-color: var(--acc-border); background: var(--acc-bg); }
/* Imgs thumbnails */
.pai-imgs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pai-img-thumb {
  aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: all .15s; background: var(--bg3);
}
.pai-img-thumb:hover, .pai-img-thumb:active { border-color: var(--acc-border); }
.pai-img-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── MODALS ── */
.pai-modal-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
  z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.pai-modal-ov.open { opacity: 1; pointer-events: all; }
@media (min-width: 480px) { .pai-modal-ov { align-items: center; } }
.pai-modal {
  background: var(--bg2); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px; width: 100%; max-width: 440px; position: relative;
  transform: translateY(30px); transition: transform .25s;
  border: 1px solid var(--border2);
}
.pai-modal-ov.open .pai-modal { transform: translateY(0); }
@media (min-width: 480px) { .pai-modal { border-radius: var(--r-lg); } }
.pai-modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.pai-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 14px;
}
/* Export options */
.pai-exp-opts { display: grid; gap: 8px; }
.pai-exp-opt {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 12px;
}
.pai-exp-opt:hover, .pai-exp-opt:active { border-color: var(--acc-border); background: var(--acc-bg); }
.pai-exp-opt svg { width: 22px; height: 22px; stroke: var(--acc); flex-shrink: 0; }
.pai-exp-opt h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.pai-exp-opt p { font-size: 11px; color: var(--text2); }

/* ── CART CONFIRM ── */
#pai-cart-confirm {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 400;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; padding: 24px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#pai-cart-confirm.open { opacity: 1; pointer-events: all; }
.pai-cart-icon { font-size: 52px; }
.pai-cart-title { font-size: 20px; font-weight: 700; }
.pai-cart-sub { font-size: 14px; color: var(--text2); }
.pai-cart-preview { width: 120px; height: 120px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border2); background: var(--bg3); }
.pai-cart-preview img { width: 100%; height: 100%; object-fit: contain; }
.pai-cart-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }
.pai-btn-big {
  padding: 14px; border-radius: var(--r); font-size: 15px; font-weight: 700;
  transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pai-btn-big:active { transform: scale(.97); }
.pai-btn-big.acc { background: var(--acc); color: #fff; }
.pai-btn-big.acc:hover { background: var(--acc-l); }
.pai-btn-big.ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }

/* ── TOASTS ── */
#pai-toasts { position: fixed; top: calc(var(--topbar) + 8px); left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.pai-toast {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r);
  padding: 10px 14px; font-size: 13px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  animation: toastIn .2s ease-out;
}
.pai-toast.success { border-left: 3px solid #4ade80; }
.pai-toast.error   { border-left: 3px solid #f87171; }
.pai-toast.info    { border-left: 3px solid var(--acc); }
@keyframes toastIn { from{ opacity:0; transform:translateY(-8px) } to{ opacity:1; transform:translateY(0) } }

/* ── AI PROCESSING ── */
.pai-processing {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; display: none;
}
.pai-processing.show { display: flex; }
.pai-proc-spinner {
  width: 40px; height: 40px; border: 3px solid var(--bg4);
  border-top-color: var(--acc); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pai-proc-txt { font-size: 14px; color: var(--text2); }

/* ── PROPS PANEL ── */
.pai-prop-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pai-prop-label { font-size: 11px; color: var(--text2); min-width: 36px; }
.pai-prop-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 7px; color: var(--text);
  font-size: 12px; outline: none;
}
.pai-prop-input:focus { border-color: var(--acc-border); }
.pai-prop-input.mini { max-width: 54px; text-align: center; }
.pai-range {
  -webkit-appearance: none; width: 100%; height: 3px;
  background: var(--bg5); border-radius: 99px; outline: none; cursor: pointer;
}
.pai-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--acc); border: 2px solid var(--bg2);
}
/* Align buttons */
.pai-aligns { display: flex; gap: 3px; }
.pai-aln {
  flex: 1; height: 28px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all .12s;
}
.pai-aln:hover, .pai-aln:active { border-color: var(--acc-border); background: var(--acc-bg); }
.pai-aln svg { width: 12px; height: 12px; stroke: var(--text2); }
.pai-aln:hover svg { stroke: var(--acc); }
/* Toggle */
.pai-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.pai-tgl-label { font-size: 12px; color: var(--text2); }
.pai-tgl { position: relative; width: 30px; height: 17px; }
.pai-tgl input { opacity: 0; width: 0; height: 0; }
.pai-tgl-track { position: absolute; inset: 0; background: var(--bg5); border-radius: 99px; cursor: pointer; transition: background .2s; }
.pai-tgl input:checked + .pai-tgl-track { background: var(--acc); }
.pai-tgl-track::after { content:''; position:absolute; top:2px; left:2px; width:13px; height:13px; border-radius:50%; background:#fff; transition:transform .2s; }
.pai-tgl input:checked + .pai-tgl-track::after { transform: translateX(13px); }

/* ── CONTEXT MENU ── */
.pai-ctx {
  position: fixed; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 4px; min-width: 150px; z-index: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); display: none;
}
.pai-ctx.open { display: block; }
.pai-ctx-item {
  padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .1s;
}
.pai-ctx-item:hover { background: var(--bg3); color: var(--text); }
.pai-ctx-item.del:hover { background: rgba(220,50,50,.12); color: #f87171; }
.pai-ctx-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.pai-ctx-sc { margin-left: auto; font-size: 10px; color: var(--text3); font-family: monospace; }
.pai-ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── EMPTY ── */
.pai-empty { text-align: center; padding: 20px 12px; }
.pai-empty svg { width: 32px; height: 32px; stroke: var(--text3); display: block; margin: 0 auto 8px; }
.pai-empty p { font-size: 12px; color: var(--text3); line-height: 1.5; }

/* ── STATUS BAR ── */
#pai-status {
  height: 20px; background: var(--bg); border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 10px; gap: 12px;
  font-size: 10px; color: var(--text3); flex-shrink: 0;
}
@media (max-width: 768px) { #pai-status { display: none; } }

/* ── MISC UTILS ── */
.gap-6 { gap: 6px; }
.mt-8 { margin-top: 8px; }
.w-full { width: 100%; }
.btn-full {
  width: 100%; padding: 11px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.btn-full:active { transform: scale(.98); }
.btn-acc { background: var(--acc); color: #fff; border: none; }
.btn-acc:hover { background: var(--acc-l); }
.btn-ghost { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg4); color: var(--text); }
.btn-danger { background: rgba(220,50,50,.1); color: #f87171; border: 1px solid rgba(220,50,50,.2); }

/* ── PRODUCT BUTTON on shop ── */
.printai-cta-wrap { margin: 14px 0; }
.printai-cta-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--printai-accent, #E84C1E); color: #fff;
  border-radius: 8px; padding: 13px 22px; font-size: 15px; font-weight: 700;
  text-decoration: none; transition: opacity .15s; font-family: inherit;
  border: none; cursor: pointer; width: 100%; justify-content: center;
}
.printai-cta-btn:hover { opacity: .88; }
.printai-cta-sub { font-size: 12px; color: #888; margin: 5px 0 0; text-align: center; }

/* ── MOBILE FAB (Adicionar ao carrinho fixed) ── */
#pai-fab {
  position: fixed; bottom: 58px; right: 12px; z-index: 40;
  background: var(--acc); color: #fff; border-radius: 50%;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(232,76,30,.5); transition: all .2s;
}
#pai-fab:active { transform: scale(.92); }
#pai-fab svg { width: 22px; height: 22px; }
@media (min-width: 768px) { #pai-fab { display: none; } }

/* ── PRINTAI LIGHT THEME (aplicado via CSS vars no editor-page.php) ── */
/* As variáveis já são definidas no <style> inline da página */
/* Aqui ficam apenas overrides específicos para temas claros */

/* Canvas shadow no tema claro */
[data-is-light="1"] #pai-canvas-wrap {
  box-shadow: 0 4px 24px rgba(26,35,64,.15), 0 0 0 1px rgba(26,35,64,.08);
}

/* Input fields no tema claro */
[data-is-light="1"] .pai-font-search,
[data-is-light="1"] .pai-hex-inp,
[data-is-light="1"] .pai-prop-input,
[data-is-light="1"] .pt-fsize {
  background: rgba(0,0,0,.04);
  color: var(--text);
}

/* Toast no tema claro */
[data-is-light="1"] .pai-toast {
  box-shadow: 0 2px 12px rgba(26,35,64,.15);
}

/* Swatches border no tema claro */
[data-is-light="1"] .pai-sw {
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}

/* ── TEMA PRINTAI ESPECÍFICO (azul marinho + amarelo) ── */
/* Quando editor_theme = 'printai', o accent é azul marinho #1A2340
   O amarelo (#F5C842) fica como cor secundária de destaque */

/* ── FIX: Scrollbar no tema claro ── */
[data-is-light="1"] ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
}
