:root {
  --accent: #2b3ee6;
  --accent-d: #1f2db8;
  --accent-soft: #e8ebff;
  --ink: #15171c;
  --ink-2: #4a4f5c;
  --ink-3: #80869a;
  --line: #e1e4ec;
  --bg: #f4f5f8;
  --card: #ffffff;
  --ok: #138a52;
  --warn: #c27400;
  --bad: #c62f3a;
  --wa: #1fa855;
  --radius: 14px;
  --font: 'Montserrat', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 15px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Cabecera ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { display: inline-flex; flex-direction: column; line-height: .86; font-weight: 900; font-size: 15px; letter-spacing: -.02em; color: #fff; background: var(--accent); padding: 5px 9px 4px; transform: skew(-8deg); box-shadow: 3px 3px 0 #11166b; }
.logo span { transform: skew(8deg); display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--line); }
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.top-note { margin: 0; color: var(--ink-3); font-size: 13px; font-weight: 500; }

/* ---------- Distribución ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 0; min-height: calc(100vh - 61px); }
.stage { position: sticky; top: 0; height: calc(100vh - 61px); max-height: 100vh; display: flex; flex-direction: column; padding: 16px 22px 12px; }
.panel { background: #fff; border-left: 1px solid var(--line); padding: 8px 22px 40px; }

/* ---------- Escenario ---------- */
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #e6e8ef; border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 40, .14); }
.seg-full { display: flex; }
.seg-full .seg-btn { flex: 1; }
.seg-sm .seg-btn { padding: 6px 11px; }
.tools { display: flex; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); position: relative; }
.tool svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tool.sel select { border: 0; background: transparent; font-weight: 700; color: var(--accent); padding: 0 2px; cursor: pointer; }
.tool.sel select:focus { outline: none; }
.canvas { position: relative; flex: 1; min-height: 0; margin-top: 10px; border-radius: 18px; background: radial-gradient(ellipse at 50% 30%, #ffffff 0%, #eef0f5 60%, #e3e6ee 100%); overflow: hidden; }
#fig { width: 100%; height: 100%; display: block; }
.cap { position: absolute; left: 14px; top: 12px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: rgba(255, 255, 255, .85); border-radius: 8px; padding: 6px 9px; line-height: 1.45; pointer-events: none; }
.cap b { color: var(--ink); }
.cap .dash { display: inline-block; width: 18px; border-top: 2px dashed var(--accent); vertical-align: middle; margin-right: 5px; }
.strip { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.strip li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 11px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.strip li b { display: block; color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.strip li strong { color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.stage-note { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--ink-3); }

/* figura */
.guia line { stroke: #8a90a2; stroke-width: .25; stroke-dasharray: 1.2 1; }
.guia text { font: 600 3.3px var(--font); fill: #6d7387; }
.guia .hem line { stroke: var(--accent); stroke-width: .45; stroke-dasharray: none; }
.guia .hem text { fill: var(--accent); font-weight: 700; }
.comp { fill: none; stroke: var(--accent); stroke-width: .55; stroke-dasharray: 1.6 1.1; }
.comp-t { font: 700 3.6px var(--font); fill: var(--accent); }

/* ---------- Pasos ---------- */
.step { padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step h2 { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.step h2 > b { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12.5px; display: grid; place-items: center; flex: none; }
.h-sub { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.row2 { margin-bottom: 14px; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-bottom: 12px; }
.slider label, .lbl { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.slider output { font-weight: 800; font-size: 15px; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); margin: 6px 0 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.skins { display: flex; gap: 7px; }
.skin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.skin[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.exact { border: 1px solid var(--line); border-radius: 12px; padding: 0; margin: 12px 0; background: #fafbfd; }
.exact summary { cursor: pointer; padding: 11px 13px; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.exact summary::-webkit-details-marker { display: none; }
.exact summary::after { content: '+'; margin-left: auto; font-weight: 700; color: var(--accent); }
.exact[open] summary::after { content: '–'; }
.exact summary em { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.exact-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 13px; }
.exact-in label { display: grid; grid-template-columns: 1fr auto; font-size: 12.5px; font-weight: 700; color: var(--ink-2); align-items: center; }
.exact-in small { grid-column: 1 / -1; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.exact-in input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: #fff; font-weight: 700; margin-top: 3px; }
.exact-in input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.exact-in span { font-size: 11.5px; color: var(--ink-3); padding-left: 4px; margin-top: 3px; }
.how { margin: 10px 0 0; padding: 0 13px 12px 30px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.how .muted { color: var(--ink-3); list-style: none; margin-left: -17px; margin-top: 4px; }
.body-sum { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); background: var(--bg); border-radius: 10px; padding: 9px 11px; line-height: 1.55; }
.body-sum b { color: var(--ink); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #e9ebf1; color: var(--ink-3); vertical-align: 1px; }
.tag.real { background: #dcf3e7; color: var(--ok); }

/* cortes */
.cortes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.corte { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 10px 10px; display: grid; grid-template-columns: 48px 1fr; gap: 3px 10px; align-items: center; }
.corte svg { grid-row: span 3; width: 48px; height: 52px; }
.corte .n { font-weight: 800; font-size: 13.5px; line-height: 1.2; }
.corte .t { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.corte .t b { color: var(--ink); }
.corte .pr { font-size: 11.5px; color: var(--ink-3); }
.corte[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.corte-desc { grid-column: 1 / -1; }
.telas { margin-top: 12px; display: grid; gap: 6px; }
.telas:empty { display: none; }
.telas .lbl { margin-bottom: 2px; }
.tela { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 11px; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; font-size: 13px; }
.tela b { font-weight: 700; }
.tela small { color: var(--ink-3); font-size: 12px; }
.tela[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.desc { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }

/* tallas */
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.size { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 4px 8px; display: grid; gap: 2px; justify-items: center; position: relative; }
.size .s { font-weight: 900; font-size: 19px; }
.size .h { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.size[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.size .rec { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .03em; white-space: nowrap; }
.size.empty { visibility: hidden; }
.advice { margin-top: 12px; font-size: 13.5px; line-height: 1.5; background: var(--bg); border-radius: 12px; padding: 11px 13px; color: var(--ink-2); }
.advice b { color: var(--ink); }
.advice .alt { display: block; margin-top: 6px; font-size: 12.5px; }
.advice .alt button { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.ficha { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin-top: 14px; }
.ficha svg { width: 150px; height: 160px; overflow: visible; }
.cota-t { font: 700 4.6px var(--font); fill: var(--accent); }
table.med { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.med th { text-align: left; font-weight: 700; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; padding: 0 0 5px 6px; white-space: nowrap; }
table.med th:first-child { padding-left: 0; }
table.med th:not(:first-child), table.med td:not(:first-child) { text-align: right; }
table.med td { padding: 6px 0 6px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
table.med td:first-child { padding-left: 0; white-space: normal; }
table.med td:first-child { font-weight: 600; }
table.med .dif { font-weight: 700; }

/* colores */
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.color { aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d4d8e2; position: relative; padding: 0; }
.color[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--accent); }
.color .star { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: #ffcf3f; color: #6b4a00; font-size: 10px; line-height: 16px; text-align: center; font-weight: 900; box-shadow: 0 0 0 2px #fff; }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.hint .star-i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: #ffcf3f; color: #6b4a00; font-size: 9px; line-height: 14px; text-align: center; font-weight: 900; vertical-align: -2px; }

/* pedido */
.qty { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q { border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 6px; text-align: center; }
.q.on { border-color: var(--accent); }
.q .s { font-weight: 800; font-size: 14px; }
.q .s small { font-weight: 700; color: var(--accent); font-size: 9.5px; display: block; letter-spacing: .03em; }
.q .ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.q .ctl button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 800; line-height: 1; }
.q .ctl input { width: 32px; text-align: center; border: 0; font-weight: 800; font-size: 15px; padding: 0; background: transparent; -moz-appearance: textfield; }
.q .ctl input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tiers { margin-top: 12px; display: flex; gap: 4px; overflow-x: auto; }
.tier { flex: 1; min-width: 52px; text-align: center; border-radius: 9px; background: var(--bg); padding: 6px 2px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.tier b { display: block; color: var(--ink); font-size: 13px; }
.tier.on { background: var(--accent); color: #dfe3ff; }
.tier.on b { color: #fff; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-weight: 600; color: var(--ink-2); }
.total strong { font-size: 24px; font-weight: 900; color: var(--ink); }
.tier-hint { margin: 4px 0 12px; font-size: 12.5px; color: var(--accent); font-weight: 600; min-height: 1em; }
.tier-hint.warn { color: var(--warn); }
.cta { width: 100%; border: 0; border-radius: 12px; background: var(--wa); color: #fff; font-weight: 800; font-size: 15px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 9px; }
.cta svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 1.7; }
.cta svg .fill { fill: #fff; stroke: none; }
.cta:disabled { background: #b7bcc8; cursor: not-allowed; }
.cta-ghost { width: 100%; margin-top: 8px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.fine { font-size: 11.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.5; }

.mbar { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .stage, .panel { min-width: 0; }
  .stage { position: relative; height: auto; padding: 12px 16px 6px; }
  .canvas { height: 62vh; min-height: 380px; flex: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 4px 16px 110px; }
  .top { padding: 10px 16px; }
  .top-note { display: none; }
  .brand-title { font-size: 15px; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -6px 20px rgba(20, 24, 40, .06); }
  .mb-info { display: grid; line-height: 1.2; }
  .mb-info span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
  .mb-info strong { font-size: 19px; font-weight: 900; }
  .mb-btn { border: 0; background: var(--wa); color: #fff; font-weight: 800; border-radius: 12px; padding: 12px 22px; font-size: 15px; }
  .toast { bottom: 90px; }
}
@media (max-width: 420px) {
  .tool span { display: none; }
  .tool.sel span { display: none; }
  .seg-btn { padding: 7px 11px; }
  .exact-in { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .cortes { grid-template-columns: 1fr 1fr; }
  .corte { grid-template-columns: 1fr; justify-items: start; }
  .corte svg { grid-row: auto; width: 42px; height: 44px; }
  .qty { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qty > span:empty { display: none; }
  .ficha { grid-template-columns: 96px 1fr; }
  .ficha svg { width: 96px; height: 110px; }
}
