/* Store builder (/tienda/crear/): phone first, one question per screen, fixed action bar at the bottom. Same visual language as /disena (paper background, green, marigold hard-shadow CTA).
   Prefix tb- = builder; the preview and the template cards reuse the real store look from ../store.css (prefix ts-). Light only. */
:root { --paper: #fbf8f1; --card: #fff; --ink: #14161a; --ink-2: #555a52; --line: #e6dfcf; --green: #1f6f5c; --green-2: #17594a; --gold: #f2b23a; --soft: #f3efe4; --bad: #b42318; --ok: #1a7f37;
  --display: "Gabarito", "Avenir Next", system-ui, sans-serif; --body: "Figtree", "Segoe UI", system-ui, sans-serif; --r: 10px; --tap: 48px; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tb-boot { padding: 80px 16px; text-align: center; color: var(--ink-2); }

.tb-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tb-top img { height: 28px; width: auto; display: block; }
.tb-pill { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--green); background: #e7f1ed; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.tb-pill.is-demo { background: #fdf0d2; color: #7a5200; }
.tb-linkbtn { background: none; border: 0; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 2px; min-height: 40px; font-size: 14px; }

.tb-wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px calc(112px + env(safe-area-inset-bottom, 0px)); }
.tb-prog { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.tb-dot { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.tb-dot.is-done { background: var(--green); }
.tb-dot.is-now { background: var(--gold); }
.tb-step { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; margin: 0 0 4px; }
.tb-h { font: 900 clamp(26px, 7vw, 34px)/1.08 var(--display); margin: 0 0 8px; letter-spacing: -.01em; text-wrap: balance; }
.tb-lead { margin: 0 0 18px; color: var(--ink-2); }
.tb-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }

.tb-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.tb-field > label, .tb-lab { font-weight: 700; font-size: 14px; }
.tb-field input[type="text"], .tb-field input[type="tel"], .tb-field input[type="email"], .tb-field textarea { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--card); font-size: 17px; font-weight: 600; }
.tb-field textarea { min-height: 120px; resize: vertical; font-weight: 500; line-height: 1.4; }
.tb-field input:focus, .tb-field textarea:focus { border-color: var(--green); outline: none; }
.tb-hint { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.tb-hint.is-ok { color: var(--ok); font-weight: 600; } .tb-hint.is-bad { color: var(--bad); font-weight: 600; }
.tb-pre { font-size: 13.5px; color: var(--ink-2); word-break: break-all; }
.tb-err { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: #fdecea; color: #7a1a12; font-weight: 600; }
.tb-note { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: #e7f1ed; color: #0f4a3b; }
.tb-warn { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: #fdf0d2; color: #6b4600; font-size: 14px; }

.tb-btn { min-height: var(--tap); padding: 0 20px; border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.tb-btn:disabled { opacity: .55; cursor: default; }
.tb-btn-primary { background: var(--gold); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.tb-btn-primary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tb-btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.tb-btn-block { width: 100%; }
.tb-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(251,248,241,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.tb-bar .tb-btn { flex: 1; }
.tb-bar .tb-btn-ghost { flex: 0 0 38%; }
@media (min-width: 700px) { .tb-bar { justify-content: center; } .tb-bar .tb-btn { max-width: 280px; } }

.tb-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tb-logo-pv { width: 96px; height: 96px; border-radius: 50%; background: var(--soft) center / cover no-repeat; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font: 900 34px var(--display); color: var(--green); overflow: hidden; flex: 0 0 auto; }
.tb-logo-pv img { width: 100%; height: 100%; object-fit: cover; }

.tb-tpls { display: grid; gap: 14px; }
.tb-tpl { text-align: left; padding: 0; border: 3px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; overflow: hidden; display: block; width: 100%; min-height: 0; }
.tb-tpl.is-on { border-color: var(--green); box-shadow: 0 0 0 3px #cfe5dd; }
.tb-mini { height: 176px; overflow: hidden; pointer-events: none; position: relative; }
.tb-mini .ts-store { width: 375px; transform-origin: top left; transform: scale(var(--sc, .9)); }
.tb-tpl-t { padding: 10px 14px 12px; display: block; }
.tb-tpl-t b { display: flex; align-items: center; justify-content: space-between; font: 800 18px var(--display); }
.tb-tpl-t span { display: block; font-size: 14px; color: var(--ink-2); }
.tb-check { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: #fff; align-items: center; justify-content: center; font-size: 14px; }
.tb-tpl.is-on .tb-check { background: var(--green); }

.tb-prod { position: relative; }
.tb-prod-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.tb-ph { width: 96px; height: 96px; flex: 0 0 auto; border-radius: 12px; border: 2px dashed var(--line); background: var(--soft); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--green); cursor: pointer; overflow: hidden; padding: 0; position: relative; min-height: 0; }
.tb-ph img { width: 100%; height: 100%; object-fit: cover; }
.tb-ph.is-busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%231f6f5c' stroke-width='3' stroke-dasharray='28 60'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 32px no-repeat; }
.tb-prod-f { flex: 1; min-width: 0; }
.tb-prod-f .tb-field { margin-bottom: 10px; }
.tb-money { display: flex; align-items: center; gap: 6px; }
.tb-money span { font-weight: 800; font-size: 18px; }
.tb-money input { flex: 1; min-width: 0; }
.tb-del { background: none; border: 0; color: var(--bad); font-weight: 700; cursor: pointer; padding: 8px 0; min-height: 40px; font-size: 14px; }
.tb-tip { font-size: 14px; padding: 12px 14px; background: var(--soft); border-radius: var(--r); margin-bottom: 14px; }
.tb-tip a { color: var(--green); font-weight: 700; }

.tb-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 10px 30px -14px rgba(20,22,26,.35); background: #fff; }
.tb-consent { font-size: 13.5px; color: var(--ink-2); margin: 0 0 14px; }
.tb-consent a { color: var(--green); font-weight: 600; }
.tb-url { display: block; padding: 14px; border-radius: var(--r); background: var(--soft); font: 700 17px/1.3 var(--body); word-break: break-all; text-align: center; text-decoration: none; color: var(--green); margin-bottom: 14px; }
.tb-done { text-align: center; }
.tb-done .tb-h { margin-top: 8px; }
.tb-actions { display: grid; gap: 10px; margin: 16px 0; }
.tb-login { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
@media (min-width: 440px) { .tb-mini .ts-store { width: 100%; transform: none; } }
.tb-cuenta { margin-left: auto; color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: #fbf8f1; border: 1.5px solid var(--green); text-decoration: none; box-sizing: border-box; }
.tb-cuenta svg { display: block; }
.tb-cuenta .cq-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.tb-cuenta:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tb-cuenta ~ .tb-pill { margin-left: 0; }
@media (max-width: 400px) { .tb-top:has(.tb-cuenta):has(.tb-linkbtn) .tb-pill:not(.is-demo) { display: none; } .tb-top { gap: 8px; } }
