/* DBS Personalizador — editor de pantalla completa */
:root {
  /* Marca Do Brand Store (el plugin las reescribe desde Ajustes) */
  --pz-a1: #E5173F; --pz-a2: #F2542D; --pz-a3: #F7931E;
  --pz-b1: #7A2BF5; --pz-b2: #E0218A;
  --pz-grad: linear-gradient(90deg, var(--pz-a1) 0%, var(--pz-a2) 52%, var(--pz-a3) 100%);
  --pz-grad2: linear-gradient(135deg, var(--pz-b1) 0%, var(--pz-b2) 100%);
  --pz-primary: var(--pz-a2);
  --pz-second: var(--pz-b1);
  --pz-tint: #f4eefe;
  --pz-ink: #0F0F12;
  --pz-muted: #5d6170;
  --pz-line: #dfe1e8;
  --pz-bg: #f4f4f6;
  --pz-card: #ffffff;
  --pz-accent: var(--pz-b2);
  --pz-safe: #18a34a;
  --pz-ok: #1a7f37;
  --pz-warn: #b26a00;
  --pz-bad: #c62828;
  --pz-radius: 18px;
  --pz-shadow: 0 6px 24px rgba(20, 24, 50, .09);
  --pz-top: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body.dbs-pz { margin: 0; height: 100%; }
body.dbs-pz { font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--pz-ink); background: var(--pz-bg); -webkit-font-smoothing: antialiased; }
:where(.dbs-pz) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.dbs-pz) :where(button) { cursor: pointer; background: none; border: 0; padding: 0; }
.dbs-pz button:disabled { cursor: not-allowed; opacity: .45; }
.dbs-pz :focus-visible { outline: 3px solid color-mix(in srgb, var(--pz-second) 45%, transparent); outline-offset: 2px; }
.pz-boot { display: grid; place-items: center; height: 100vh; color: var(--pz-muted); }
#dbs-pz-app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Barra superior ---------- */
.pz-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--pz-top); padding: 0 22px; background: #fff; border-bottom: 1px solid var(--pz-line); }
.pz-exit { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 10px 8px; border-radius: 10px; }
.pz-exit:hover { background: #f3f4f8; }
.pz-saved { width: 9px; height: 9px; border-radius: 50%; background: #c7cad4; margin-right: 6px; transition: background .2s; }
.pz-saved.ok { background: var(--pz-safe); }
.pz-steps { display: flex; gap: 6px; margin: 0 auto; height: 100%; }
.pz-steps button { position: relative; padding: 0 26px; height: 100%; font-weight: 500; color: var(--pz-ink); }
.pz-steps button.on { font-weight: 700; }
.pz-steps button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: var(--pz-grad); }
.pz-history { display: flex; gap: 8px; }
.pz-round { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #f1f2f6; transition: background .15s; }
.pz-round:hover:not(:disabled) { background: #e4e6ee; }
.pz-sep { width: 1px; height: 40px; background: var(--pz-line); }
.pz-ghost { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.pz-ghost:hover { background: #f3f4f8; }
.pz-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 28px; border-radius: 999px; background: var(--pz-grad); color: #fff !important; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--pz-a1) 28%, transparent); transition: filter .15s, transform .1s; }
.pz-primary:hover:not(:disabled) { filter: brightness(1.06) saturate(1.1); }
.pz-primary:active:not(:disabled) { transform: translateY(1px); }
.pz-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 999px; border: 2px solid transparent !important; color: var(--pz-second) !important; font-weight: 700; background: linear-gradient(#fff, #fff) padding-box, var(--pz-grad2) border-box; text-decoration: none; }
.pz-outline:hover:not(:disabled) { background: linear-gradient(var(--pz-tint), var(--pz-tint)) padding-box, var(--pz-grad2) border-box; }
.pz-block { width: 100%; }
.pz-link { display: inline-flex; align-items: center; gap: 6px; color: var(--pz-second); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pz-link svg { width: 18px; height: 18px; }

/* ---------- Pantalla de diseño ---------- */
.pz-design { position: relative; flex: 1; display: grid; grid-template-columns: auto auto 1fr auto; gap: 24px; padding: 96px 32px 110px; min-height: calc(100vh - var(--pz-top)); }
.pz-rail { align-self: start; display: flex; flex-direction: column; gap: 4px; width: 132px; padding: 16px; background: var(--pz-card); border-radius: var(--pz-radius); box-shadow: var(--pz-shadow); }
.pz-rail button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; font-size: 14px; text-align: center; line-height: 1.25; border: 2px solid transparent; }
.pz-rail button svg { width: 34px; height: 34px; stroke-width: 1.6; }
.pz-rail button:hover { background: #f3f4f8; }
.pz-rail button.on { background: var(--pz-tint); border-color: var(--pz-second); color: var(--pz-second); }
.pz-panel { align-self: start; width: 360px; max-height: calc(100vh - var(--pz-top) - 200px); overflow: auto; background: var(--pz-card); border-radius: var(--pz-radius); box-shadow: var(--pz-shadow); }
.pz-panel-in { padding: 28px 28px 30px; }
.pz-ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pz-ph h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.pz-x { padding: 2px; border-radius: 8px; }
.pz-x:hover { background: #f1f2f6; }
.pz-lead { margin: 14px 0 22px; color: #2c2e36; font-size: 16.5px; }
.pz-panel h3, .pz-side h3 { margin: 22px 0 10px; font-size: 16.5px; }
.pz-tip { margin-top: 24px; color: #2c2e36; }
.pz-empty { color: var(--pz-muted); }
.pz-field { width: 100%; padding: 14px 16px; margin-bottom: 12px; border: 1.5px solid #c9ccd6; border-radius: 12px; resize: vertical; font-size: 17px !important; line-height: 1.35; }
.pz-field:focus { border-color: var(--pz-second); outline: none; }
.pz-imgfield { display: flex; align-items: center; gap: 18px; margin: 6px 0 14px; }
.pz-ithumb { flex: 0 0 auto; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 1px solid var(--pz-line);
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.pz-ithumb img { width: 100%; height: 100%; object-fit: contain; }
.pz-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pz-quick button { padding: 16px 10px; border: 1.5px solid var(--pz-line); border-radius: 12px; font-size: 18px; }
.pz-quick button:hover { border-color: var(--pz-second); }
.pz-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 18px; border: 2px dashed #b9bdca; border-radius: 16px; text-align: center; cursor: pointer; color: var(--pz-muted); transition: background .15s, border-color .15s; }
.pz-drop strong { color: var(--pz-ink); }
.pz-drop.over, .pz-drop:hover { border-color: var(--pz-second); background: var(--pz-tint); }
.pz-drop-ic svg { width: 40px; height: 40px; color: var(--pz-second); }
.pz-rules { margin: 18px 0 0; padding-left: 18px; color: #3a3d48; font-size: 14.5px; }
.pz-rules li { margin-bottom: 8px; }
.pz-recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pz-recent button { aspect-ratio: 1; border: 1px solid var(--pz-line); border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.pz-recent img { width: 100%; height: 100%; object-fit: contain; }
.pz-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pz-sw { aspect-ratio: 1; border-radius: 50%; border: 1px solid #c9ccd6 !important; box-shadow: inset 0 0 0 3px #fff; }
.pz-sw.on { outline: 3px solid var(--pz-second); outline-offset: 1px; }
.pz-sw.none { background: linear-gradient(135deg, #fff 45%, var(--pz-bad) 45% 55%, #fff 55%); }
.pz-colorpick { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-weight: 600; }
.pz-colorpick input { width: 52px; height: 36px; border: 0; padding: 0; background: none; }

.pz-workspace { position: relative; display: grid; place-items: center; min-width: 0; overflow: auto; }
.pz-board { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 14px; align-items: center; justify-items: center; padding: 10px; }
.pz-art { position: relative; background: #fff; border: 1.5px solid #9599a6; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.pz-art .canvas-container { position: absolute !important; inset: 0; }
.pz-guides { position: absolute; inset: 0; pointer-events: none; }
.pz-safe { position: absolute; border: 2px dashed var(--pz-safe); border-radius: 2px; }
.pz-safe span { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: #e9f9ee; border: 1px solid #9fdcb2; color: var(--pz-ok); font-size: 14px; white-space: nowrap; }
.pz-handle { position: absolute; top: 50%; transform: translateY(-50%) rotate(-90deg); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9a9eab; }
.pz-handle.l { left: -12px; } .pz-handle.r { right: -12px; }
.pz-snap { position: absolute; background: var(--pz-accent); opacity: 0; transition: opacity .1s; }
.pz-snap.on { opacity: .9; }
.pz-snap.v { top: 0; bottom: 0; left: 50%; width: 1px; }
.pz-snap.h { left: 0; right: 0; top: 50%; height: 1px; }
.pz-dim { display: flex; align-items: center; justify-content: center; color: #4c505c; font-weight: 600; font-size: 15px; }
.pz-dim-v { grid-row: 1; grid-column: 1; align-self: stretch; flex-direction: column; position: relative; width: 70px; }
.pz-dim-v::before { content: ""; position: absolute; top: 0; bottom: 0; right: 14px; border-right: 2px solid #5c606c; }
.pz-dim-v::after { content: ""; position: absolute; top: 0; bottom: 0; right: 7px; width: 14px; border-top: 2px solid #5c606c; border-bottom: 2px solid #5c606c; }
.pz-dim-v span { position: relative; z-index: 1; background: var(--pz-bg); padding: 6px 0; margin-right: 10px; }
.pz-dim-h { grid-row: 2; grid-column: 2; justify-self: stretch; position: relative; height: 30px; }
.pz-dim-h::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid #5c606c; }
.pz-dim-h::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 8px); height: 16px; border-left: 2px solid #5c606c; border-right: 2px solid #5c606c; }
.pz-dim-h span { position: relative; z-index: 1; background: var(--pz-bg); padding: 0 16px; }
.pz-art { grid-row: 1; grid-column: 2; }

.pz-thumb { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 168px; padding: 10px 10px 14px; background: #fff; border: 2px solid var(--pz-ink) !important; border-radius: 6px; font-size: 15px; }
.pz-thumb canvas { width: 100%; height: auto; border-radius: 4px; }
.pz-thumb:hover { box-shadow: var(--pz-shadow); }

.pz-zoom { position: absolute; left: 32px; bottom: 28px; display: flex; align-items: center; gap: 14px; }
.pz-zoom .pz-round { background: #fff; box-shadow: var(--pz-shadow); width: 64px; height: 64px; }
.pz-zoom-sel { height: 56px; padding: 0 14px; border: 0; border-radius: 8px; background: #fff; font-weight: 700 !important; font-size: 18px !important; }

/* Barra contextual */
.pz-ctx { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 40px); padding: 10px 22px; background: #fff; border-radius: 999px; box-shadow: 0 8px 28px rgba(20,24,50,.14); overflow-x: auto; white-space: nowrap; }
.pz-ctx > * { flex: 0 0 auto; }
.pz-ctx::-webkit-scrollbar { height: 0; }
.pz-tb-btn span, .pz-q, .pz-tb-label { white-space: nowrap; }
.pz-vr { width: 1px; height: 32px; background: var(--pz-line); margin: 0 6px; flex: 0 0 auto; }
.pz-tb-label { font-weight: 600; padding: 8px 10px; border-radius: 10px; }
.pz-tb-label:hover { background: #f3f4f8; }
.pz-tb-font { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pz-tb-font select { height: 38px; padding: 0 8px; border: 1px solid var(--pz-line); border-radius: 8px; max-width: 170px; }
.pz-tb-size { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.pz-tb-size button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.pz-tb-size button:hover { background: #f3f4f8; }
.pz-tb-size input { width: 74px; height: 38px; text-align: center; border: 1px solid var(--pz-line); border-radius: 8px; font-weight: 700; }
.pz-tb-color { position: relative; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.pz-tb-color span { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #c9ccd6; }
.pz-tb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pz-tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; min-width: 44px; padding: 0 10px; border-radius: 10px; justify-content: center; }
.pz-tb-btn:hover { background: #f3f4f8; }
.pz-tb-btn.on { background: var(--pz-tint); color: var(--pz-second); }
.pz-tb-btn.wide { font-weight: 600; font-size: 14px; }
.pz-tb-btn.danger:hover { color: var(--pz-bad); background: #fdecec; }
.pz-q { padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pz-q.good { background: #e6f6ea; color: var(--pz-ok); }
.pz-q.mid { background: #fff4dc; color: var(--pz-warn); }
.pz-q.bad { background: #fdecec; color: var(--pz-bad); }

/* ---------- Opciones y Revisar ---------- */
.pz-show { flex: 1; display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(340px, 560px); gap: 28px; padding: 26px 32px 40px; background: #fff; }
.pz-views { display: flex; flex-direction: column; gap: 12px; }
.pz-view { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 3px solid transparent !important; background: #f2f3f7; }
.pz-view.on { border-color: var(--pz-second) !important; }
.pz-view canvas { display: block; width: 100%; height: auto; }
.pz-view span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; background: rgba(20, 22, 40, .72); color: #fff; font-size: 14px; text-align: center; }
.pz-stagebox { position: sticky; top: calc(var(--pz-top) + 26px); align-self: start; aspect-ratio: 1; width: 100%; max-height: calc(100vh - var(--pz-top) - 52px); border-radius: 26px; overflow: hidden; background: #f2f3f7; }
.pz-mock { width: 100%; height: 100%; display: block; object-fit: contain; }
.pz-side { padding: 6px 4px 30px; }
.pz-h1 { font-size: 34px; line-height: 1.15; margin: 4px 0 8px; letter-spacing: -.01em; }
.pz-pname { margin: 0 0 6px; color: var(--pz-muted); }
.pz-muted { color: var(--pz-muted); font-weight: 400; }
.pz-small { font-size: 14px; }
.pz-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pz-style { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border: 1.5px solid var(--pz-line) !important; border-radius: 12px; text-align: left; font-size: 15px; }
.pz-style img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.pz-style.on { border: 2.5px solid var(--pz-second) !important; background: var(--pz-tint); }
.pz-style small { color: var(--pz-muted); }
.pz-dotc { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c9ccd6; }
.pz-out { color: var(--pz-bad) !important; }
.pz-techs { display: grid; gap: 10px; }
.pz-tech { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; padding: 14px 16px; border: 1.5px solid var(--pz-line); border-radius: 12px; cursor: pointer; }
.pz-tech input { grid-row: span 2; margin-top: 4px; accent-color: var(--pz-second); }
.pz-tech span { color: var(--pz-muted); font-size: 14.5px; }
.pz-tech.on { border: 2.5px solid var(--pz-second); background: var(--pz-tint); }
.pz-qtyrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pz-qty { display: flex; align-items: center; border-radius: 12px; background: #f1f2f6; padding: 4px; }
.pz-qty button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
.pz-qty button:hover { background: #fff; }
.pz-qty input { width: 84px; height: 44px; border: 0; background: #fff; border-radius: 8px; text-align: center; font-size: 18px !important; font-weight: 700; }
.pz-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pz-chips button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--pz-line) !important; font-weight: 600; }
.pz-chips button.on { border-color: var(--pz-second) !important; color: var(--pz-second); background: var(--pz-tint); }
.pz-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fff4dc; color: #6b4200; font-size: 14.5px; }
.pz-warn svg { flex: 0 0 auto; width: 20px; height: 20px; }
.pz-price { margin-top: 24px; padding: 20px 22px; border-radius: 16px; background: #f6f7fa; }
.pz-pline { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.pz-ptotal { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--pz-line); }
.pz-ptotal span { font-size: 17px; }
.pz-ptotal small { color: var(--pz-muted); }
.pz-ptotal strong { font-size: 34px; letter-spacing: -.01em; }
.pz-ptotal.big { border-top: 1px solid var(--pz-line); margin-top: 22px; }
.pz-ptotal.big span { font-size: 20px; font-weight: 600; }
.pz-save { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--pz-tint); color: #4a1a99; font-size: 15px; }
.pz-tiers { margin-top: 14px; }
.pz-tiers summary { cursor: pointer; color: var(--pz-second); font-weight: 600; }
.pz-tiers table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 15px; }
.pz-tiers td { padding: 7px 10px; border-bottom: 1px solid var(--pz-line); }
.pz-tiers tr.on td { background: var(--pz-tint); font-weight: 700; }
.pz-checks { list-style: none; margin: 18px 0 20px; padding: 0; display: grid; gap: 10px; }
.pz-checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.pz-checks svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; }
.pz-checks .ok svg, .pz-checks .manual svg { color: var(--pz-ink); }
.pz-checks .warn { color: #6b4200; } .pz-checks .warn svg { color: var(--pz-warn); }
.pz-checks .bad { color: var(--pz-bad); font-weight: 600; }
.pz-summary { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--pz-line); }
.pz-summary div { display: flex; justify-content: space-between; gap: 12px; }
.pz-approve { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; padding: 16px; border: 2px solid transparent; border-radius: 14px; background: linear-gradient(var(--pz-tint), var(--pz-tint)) padding-box, var(--pz-grad2) border-box; cursor: pointer; }
.pz-approve input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--pz-second); flex: 0 0 auto; }
.pz-approve.disabled { opacity: .5; border-color: var(--pz-line); background: #f6f7fa; cursor: not-allowed; }
.pz-actions { display: grid; gap: 12px; margin-bottom: 16px; }
.pz-buy { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 18px; border-radius: 999px; background: var(--pz-grad) !important; font-weight: 700; font-size: 18px; color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--pz-a1) 30%, transparent); transition: filter .15s, transform .1s; }
.pz-buy:hover:not(:disabled) { filter: brightness(1.06) saturate(1.1); transform: translateY(-1px); }

/* ---------- Modales, toasts, carga ---------- */
.pz-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(14, 16, 30, .5); animation: pzfade .15s ease; }
.pz-mbox { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 26px 28px 28px; background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.pz-mbox p { margin: 14px 0; }
.pz-mrow { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
.pz-copy { display: flex; gap: 8px; }
.pz-copy input { flex: 1; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--pz-line); border-radius: 12px; font-size: 14px !important; }
.pz-copy .pz-primary { padding: 12px 20px; }
.pz-prev canvas { width: 100%; height: auto; border-radius: 16px; background: #f2f3f7; margin-top: 14px; }
.pz-prev-views { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.pz-prev-views button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--pz-line) !important; font-weight: 600; font-size: 14px; }
.pz-prev-views button.on { border-color: var(--pz-second) !important; color: var(--pz-second); background: var(--pz-tint); }
.pz-help { padding-left: 18px; } .pz-help li { margin-bottom: 8px; }
.pz-toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; max-width: min(560px, calc(100vw - 32px)); padding: 14px 20px; border-radius: 14px; background: #1d1f2b; color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; transition: .25s ease; }
.pz-toast.in { transform: translate(-50%, 0); opacity: 1; }
.pz-toast.err { background: var(--pz-bad); }
.pz-toast.warn { background: #8a5300; }
.pz-busy { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: rgba(255,255,255,.75); backdrop-filter: blur(2px); }
.pz-busy div { text-align: center; font-weight: 600; }
.pz-spin { display: inline-block; width: 42px; height: 42px; border-radius: 50%; border: 4px solid #dfe1ea; border-top-color: var(--pz-a2); animation: pzspin .8s linear infinite; }
@keyframes pzspin { to { transform: rotate(360deg); } }
@keyframes pzfade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .pz-design { grid-template-columns: auto auto 1fr; padding-left: 20px; padding-right: 20px; }
  .pz-thumb { position: absolute; right: 20px; bottom: 24px; width: 130px; }
  .pz-panel { width: 320px; }
  .pz-show { grid-template-columns: 150px minmax(0, 1fr) minmax(320px, 440px); }
}
@media (max-width: 980px) {
  :root { --pz-top: 60px; }
  .pz-top { padding: 0 8px; gap: 2px; }
  .pz-saved { display: none; }
  .pz-exit span, .pz-preview-btn span, .pz-sep, .pz-history { display: none; }
  .pz-exit { padding: 6px; }
  .pz-steps { margin: 0; flex: 1; justify-content: center; gap: 0; }
  .pz-steps button { padding: 0 6px; font-size: 14px; }
  .pz-preview-btn { padding: 6px; }
  .pz-next { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
  .pz-next { font-size: 0; } .pz-next::after { content: "Siguiente"; font-size: 13px; }
  .pz-design { display: flex; flex-direction: column; gap: 0; padding: 0 0 86px; }
  .pz-workspace { order: 1; min-height: 46vh; padding: 64px 4px 24px; }
  .pz-zoom .pz-round:not([data-act=help]) { display: grid; }
  .pz-rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; flex-direction: row; justify-content: space-around; width: auto; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .pz-rail button { flex: 1; padding: 6px 2px; font-size: 12px; }
  .pz-rail button svg { width: 26px; height: 26px; }
  .pz-panel { order: 2; width: auto; max-height: none; margin: 0 10px 12px; }
  .pz-panel-in { padding: 20px; }
  .pz-thumb { display: none; }
  .pz-zoom { position: absolute; left: 10px; top: 70px; bottom: auto; gap: 6px; z-index: 5; }
  .pz-zoom .pz-round { width: 42px; height: 42px; }
  .pz-zoom-sel, .pz-zoom [data-act=help] { display: none; }
  .pz-ctx { position: fixed; top: calc(var(--pz-top) + 8px); border-radius: 16px; padding: 8px 12px; }
  .pz-dim-v { width: 44px; font-size: 13px; }
  .pz-show { display: flex; flex-direction: column; padding: 14px 14px 40px; gap: 14px; }
  .pz-stagebox { position: relative; top: 0; order: 1; border-radius: 18px; }
  .pz-views { order: 2; flex-direction: row; overflow-x: auto; }
  .pz-view { flex: 0 0 96px; }
  .pz-view span { font-size: 11px; }
  .pz-side { order: 3; }
  .pz-h1 { font-size: 26px; }
}

/* ---------- Diseño sobre la foto (gorras y productos planos) ---------- */
.pz-board.pz-onphoto { position: relative; display: block; padding: 0; gap: 0; border-radius: 22px; overflow: visible; }
.pz-onphoto .pz-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 22px; user-select: none; pointer-events: none; }
.pz-onphoto .pz-art { position: absolute; background: transparent; border: 1.5px solid rgba(60, 64, 80, .55); box-shadow: none; }
.pz-onphoto .pz-art .lower-canvas { mix-blend-mode: var(--pz-blend, normal); }
.pz-onphoto .pz-dim { position: absolute; }
.pz-onphoto .pz-dim-v { width: 66px; }
.pz-onphoto .pz-dim-v span, .pz-onphoto .pz-dim-h span { background: rgba(255,255,255,.85); border-radius: 6px; }
.pz-onphoto .pz-dim-h { height: 26px; }

/* ---------- Capas ---------- */
.pz-layers { display: grid; gap: 8px; }
.pz-layer { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 12px; background: #f4f5f8; cursor: pointer; border: 2px solid transparent; }
.pz-layer:hover { background: #eceef4; }
.pz-layer.on { background: var(--pz-tint); border-color: color-mix(in srgb, var(--pz-second) 55%, #fff); }
.pz-layer.off .pz-lic, .pz-layer.off .pz-lname { opacity: .4; }
.pz-layer.bg { cursor: default; }
.pz-lic { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: repeating-conic-gradient(#e7e7e7 0 25%, #fff 0 50%) 0 0 / 10px 10px; border: 1px solid var(--pz-line); }
.pz-lic img { width: 100%; height: 100%; object-fit: contain; }
.pz-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pz-lbtns { display: flex; gap: 2px; }
.pz-lbtns button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #4c505c; }
.pz-lbtns button:hover:not(:disabled) { background: #fff; color: var(--pz-ink); }
.pz-lbtns button.on { color: var(--pz-second); }
.pz-lbtns svg { width: 18px; height: 18px; }

/* ---------- Menú de alineación ---------- */
.pz-pop { position: fixed; z-index: 60; padding: 12px; background: #fff; border-radius: 16px; box-shadow: 0 12px 32px rgba(20,24,50,.18); }
.pz-pop p { margin: 0 4px 8px; font-size: 13px; font-weight: 600; color: var(--pz-muted); }
.pz-popgrid { display: grid; grid-template-columns: repeat(3, 84px); gap: 6px; }
.pz-popgrid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; font-size: 12.5px; }
.pz-popgrid button:hover { background: #f1f2f6; }
@media (max-width: 980px) {
  .pz-rail button span { font-size: 11px; }
  .pz-onphoto .pz-dim-v { width: 48px; font-size: 12px; }
}

/* ---------- Ubicaciones de marca ---------- */
.pz-positions { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 6px; }
.pz-pos { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1.5px solid var(--pz-line) !important; border-radius: 12px; font-size: 13px; }
.pz-pos canvas { width: 100%; height: auto; border-radius: 8px; }
.pz-pos.on { border: 2.5px solid var(--pz-accent) !important; }
/* Zona inclinada o curva: vista previa en el producto más grande al lado del lienzo */
@media (min-width: 981px) {
  .pz-livepreview .pz-thumb { width: 300px; }
}

/* ---------- Móvil: barra contextual sin textos encimados ---------- */
@media (max-width: 980px) {
  .pz-ctx { left: 8px; right: 8px; transform: none; max-width: none; gap: 2px; padding: 6px 8px; justify-content: flex-start;
    overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .pz-ctx.at-end { -webkit-mask-image: none; mask-image: none; }
  .pz-tb-btn { height: 50px; min-width: 46px; padding: 0 6px; }
  .pz-tb-btn.wide { flex-direction: column; gap: 2px; font-size: 10.5px; font-weight: 600; line-height: 1.1; }
  .pz-tb-btn.wide svg { width: 20px; height: 20px; }
  .pz-tb-label { font-size: 13px; padding: 6px 8px; }
  .pz-q { font-size: 11px; padding: 4px 8px; }
  .pz-vr { height: 28px; margin: 0 3px; }
  .pz-tb-font { gap: 4px; font-size: 0; }        /* el select ya dice la fuente */
  .pz-tb-font select { font-size: 14px !important; max-width: 128px; height: 36px; }
  .pz-tb-size { gap: 2px; font-size: 0; }
  .pz-tb-size input { width: 56px; height: 36px; font-size: 14px !important; }
  .pz-tb-size button { width: 28px; height: 28px; }
  .pz-ctx:not([hidden]) ~ .pz-zoom { top: 136px; }
  .pz-popgrid { grid-template-columns: repeat(3, minmax(72px, 1fr)); }
  .pz-pop { left: 8px !important; right: 8px; }
  .pz-pos { font-size: 12px; line-height: 1.2; text-align: center; }
  .pz-positions { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .pz-tech { padding: 12px; }
  .pz-ptotal strong { font-size: 28px; }
  .pz-summary div { flex-wrap: wrap; }
  .pz-summary div > :last-child { text-align: right; margin-left: auto; }
  .pz-toast { left: 12px; right: 12px; max-width: none; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateY(20px); font-size: 14.5px; }
  .pz-toast.in { transform: translateY(0); }
}

/* ---------- Colores vs. técnica, aviso de vista previa, descarga ---------- */
.pz-tflag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #fff4dc; color: #7a4b00; font-size: 12px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.pz-advice { margin-top: 14px; }
.pz-advice p { margin: 6px 0 0; }
.pz-advice-btns { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; }
.pz-advice-btns .pz-outline { padding: 9px 18px; font-size: 14.5px; }
.pz-inks { display: inline-flex; gap: 4px; vertical-align: -3px; margin-left: 4px; }
.pz-inks i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }
.pz-disclaimer { margin: 14px 0 0; padding-left: 10px; border-left: 3px solid; border-image: var(--pz-grad2) 1; }
.pz-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.pz-lead label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
.pz-lead .pz-field { margin-top: 6px; }
.pz-consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 4px 0 6px; }
.pz-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pz-second); flex: 0 0 auto; }
.pz-consent a { color: var(--pz-second); }
.pz-mbox .pz-sw.on { outline: 3px solid var(--pz-second); outline-offset: 2px; }
