/* Demo de Vender: la misma pantalla del sistema (diseño Suizo FacturAR), con datos de ejemplo. */
.browser.has-demo > img { display: none !important; }
.demo { position: relative; color: var(--text); font-size: 14px; line-height: 1.35; text-align: left; }
.demo[hidden] { display: none; }
.demo button, .demo input, .demo select { font: inherit; color: inherit; }
.demo kbd { padding: 2px 5px; border: 1px solid var(--ink); border-bottom-width: 1px; border-radius: 5px; background: var(--surface); color: var(--text); font: 600 11px/1 var(--mono); white-space: nowrap; }
.d-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.demo .r { text-align: right; } .demo .c { text-align: center; }

.d-app { display: flex; flex-direction: column; height: 600px; background: var(--bg); }
.d-top { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 18px; flex: none; border-bottom: 2px solid var(--ink); background: var(--surface); }
.d-wm { display: inline-flex; align-items: baseline; font: 800 26px/1 'Geist', system-ui, sans-serif; letter-spacing: -.055em; }
.d-wm .ink { color: var(--wm-ink); } .d-wm .ar { color: var(--wm-ar); }
.d-wm .c { display: block; flex: none; height: .56em; margin: 0 .01em 0 .025em; transform: translateY(.025em); }
.d-wm .c img, .zoom .d-wm .c img, .zoom-right .d-wm .c img { display: block; width: auto; height: 100%; max-width: none; margin: 0; }
.d-show-s { display: none; }
.d-nav { display: flex; flex: 1; justify-content: center; gap: 2px; color: var(--muted); font-size: 13px; }
.d-nav span { padding: 18px 10px; }
.d-nav .on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -4px 0 var(--sky); }
.d-new { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sky); color: var(--sky-text); font-size: 13px; font-weight: 700; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; }
.d-new kbd { border-color: currentColor; background: transparent; color: inherit; }

.d-stage { position: relative; display: flex; flex: 1; min-height: 0; padding: 12px 18px 0; }
.d-main { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; gap: 10px; }
.d-cart { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
.d-cart-top { display: flex; gap: 8px; }
.d-search { position: relative; flex: 1; min-width: 0; }
.d-search-ic { position: absolute; left: 12px; top: 13px; color: var(--ink); pointer-events: none; }
.d-search input { width: 100%; height: 46px; padding: 0 40px; border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface); font-size: 15px; outline: none; }
.d-search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 55%, transparent); }
.d-slash { position: absolute; right: 12px; top: 13px; }
.d-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--surface); box-shadow: 0 18px 40px -18px rgb(0 0 0 / .45); }
.d-results li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; cursor: pointer; }
.d-results li small { display: block; color: var(--muted); font: 11.5px var(--mono); }
.d-results li.is-on, .d-results li:hover { background: var(--soft); box-shadow: inset 3px 0 0 var(--ink); }

.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 600; white-space: nowrap; box-shadow: 0 2px 0 rgb(18 57 109 / .22); cursor: pointer; }
.d-btn:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.d-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.d-btn.is-stop { border-color: #8f1d14; background: #d92d20; color: #fff; box-shadow: 0 2px 0 #8f1d14; }
.d-btn.is-stop kbd, .d-btn.is-main kbd { border-color: currentColor; background: transparent; color: inherit; }
.d-btn.is-main { border-color: var(--ink); background: var(--sky); color: var(--sky-text); box-shadow: 0 2px 0 var(--ink); }

.d-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; font-size: 13px; }
.d-meta-l { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.d-meta-r { color: var(--muted); }
.d-chip { padding: 2px 9px; border-radius: 4px; background: color-mix(in srgb, var(--sky) 22%, var(--surface)); color: var(--ink); font-weight: 600; }
.d-link { padding: 0; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.d-link:disabled { color: var(--muted); text-decoration: none; opacity: .65; cursor: not-allowed; }
.d-msg { color: var(--muted); font-size: 13px; }

.d-lines { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.d-line { display: grid; grid-template-columns: minmax(0, 1fr) 92px 128px 100px 36px; align-items: center; gap: 8px; padding: 6px 4px 6px 0; border-bottom: 1px solid var(--line); }
.d-head { position: sticky; top: 0; z-index: 1; padding: 4px 4px 4px 0; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.d-line.is-last { background: color-mix(in srgb, var(--sky) 14%, var(--surface)); }
.d-name { display: flex; min-width: 0; flex-direction: column; padding-left: 4px; }
.d-name b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.d-name small { color: var(--muted); font: 11.5px var(--mono); }
.d-qty { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.d-qty button { width: 34px; height: 34px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 600; box-shadow: 0 2px 0 rgb(18 57 109 / .22); cursor: pointer; }
.d-qty b { min-width: 22px; text-align: center; font-size: 15px; }
.d-line strong { font-size: 15px; font-weight: 600; }
.d-del { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.d-del:hover { background: color-mix(in srgb, #d92d20 14%, transparent); color: #d92d20; }
.d-empty { padding: 56px 12px; color: var(--muted); text-align: center; }

.d-paybar { display: grid; flex: none; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; padding: 10px 0 0; border-top: 2px solid var(--ink); }
.d-methods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-content: center; }
.d-method { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: end; gap: 1px 4px; min-width: 0; min-height: 58px; padding: 7px 8px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; box-shadow: 0 2px 0 rgb(18 57 109 / .22); cursor: pointer; }
.d-method-name { grid-column: 1 / -1; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.d-method-rule { grid-column: 1; overflow: hidden; color: var(--muted); font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.d-method-rule.is-down { color: var(--go-text); } .d-method-rule.is-up { color: #b45309; }
.d-method kbd { grid-column: 2; grid-row: 2; font-size: 10.5px; padding: 1px 4px; }
.d-method.is-on { border-color: var(--ink); background: var(--ink); color: var(--ink-on); box-shadow: 0 2px 0 var(--sky); }
.d-method.is-on .d-method-rule { color: var(--ink-on); }
.d-method.is-on kbd { border-color: currentColor; background: transparent; color: inherit; }
.d-method:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
.d-methods.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-methods.is-compact .d-method { min-height: 40px; align-items: center; }
.d-methods.is-compact .d-method-name { grid-column: 1; grid-row: 1 / 3; }
.d-methods.is-compact kbd { grid-row: 1 / 3; }
.d-paybar-r { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: end; }
.d-sum { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.d-sum > div { display: flex; justify-content: space-between; gap: 8px; }
.d-sum .is-down { color: var(--go-text); } .d-sum .is-up { color: #b45309; } .d-sum .is-muted { color: var(--muted); }
.d-total { align-items: baseline; margin-top: 3px; padding-top: 4px; border-top: 1px solid var(--line); }
.d-total span { font-size: 14px; font-weight: 700; }
.d-total strong { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.d-sum.is-only-total .d-total { margin: 0; padding: 0; border: 0; }
.d-charge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 58px; padding: 0 12px; border: 2px solid var(--go-edge); border-radius: 6px; background: var(--go); color: var(--go-ink); font-size: 15px; font-weight: 700; box-shadow: 0 3px 0 var(--go-edge); cursor: pointer; }
.d-charge kbd { border-color: currentColor; background: transparent; color: inherit; }
.d-charge:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.d-charge:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.d-charge.is-xl { width: 100%; min-height: 56px; font-size: 17px; }

.d-scrim { position: absolute; inset: 0; z-index: 20; background: rgb(10 14 25 / .45); }
.d-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 21; display: flex; width: 360px; max-width: 100%; flex-direction: column; gap: 10px; overflow-y: auto; padding: 16px; border: 2px solid var(--ink); background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / .28); }
.d-drawer-head { display: flex; align-items: baseline; gap: 8px; }
.d-drawer-head h3 { margin-right: auto; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.d-drawer-head span { color: var(--muted); font-size: 12.5px; }
.d-close { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.d-drawer .d-sum { margin-top: auto; }
.d-extra { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 6px; background: var(--soft); }
.d-label { font-size: 12.5px; font-weight: 600; }
.d-field { display: flex; flex-direction: column; gap: 4px; }
.d-field input, .d-field select { width: 100%; height: 44px; padding: 0 10px; border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface); outline: none; }
.d-field input:focus, .d-field select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 55%, transparent); }
.d-cash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.d-money { position: relative; display: block; }
.d-money em { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-weight: 600; }
.d-money input { padding-left: 24px; font-size: 16px; }
.d-change { display: flex; flex-direction: column; align-items: flex-end; padding: 4px 10px; border-radius: 6px; background: color-mix(in srgb, var(--go) 18%, var(--surface)); color: var(--go-text); }
.d-change span { font-size: 12.5px; font-weight: 700; }
.d-change strong { font-size: 24px; font-weight: 600; line-height: 1.1; }
.d-bills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.d-bill { min-height: 38px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.d-bill.is-on { border-color: var(--sky); background: color-mix(in srgb, var(--sky) 20%, var(--surface)); color: var(--ink); }
.d-options { display: grid; gap: 6px; }
.d-option { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); text-align: left; cursor: pointer; }
.d-option b, .d-option small { display: block; } .d-option small { color: var(--muted); font-size: 12px; }
.d-option.is-on { border-color: var(--ink); background: var(--ink); color: var(--ink-on); }
.d-option.is-on small { color: inherit; opacity: .85; }
.d-option.is-on kbd { border-color: currentColor; background: transparent; color: inherit; }

.d-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 18px 12px; background: var(--bg); color: var(--muted); font-size: 12px; }
.d-keys kbd { margin-right: 3px; }

.d-overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgb(10 14 25 / .45); }
.d-modal { display: flex; width: 380px; max-width: 100%; max-height: 100%; flex-direction: column; gap: 10px; overflow-y: auto; padding: 18px; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.d-modal h3 { font-size: 19px; letter-spacing: -.02em; }
.d-modal p { color: var(--muted); font-size: 13.5px; }
.d-ok { align-self: flex-start; padding: 2px 9px; border-radius: 4px; background: color-mix(in srgb, var(--go) 22%, var(--surface)); color: var(--go-text); font-size: 12.5px; font-weight: 700; }
.d-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.d-modal-actions .d-btn { flex: 1; }
.d-ticket { max-height: 200px; overflow-y: auto; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fffffc; color: #161616; font: 12px/1.45 var(--mono); }
.d-ticket p { color: inherit; font-size: inherit; }
.d-ticket .c { text-align: center; } .d-ticket .row { display: flex; justify-content: space-between; gap: 8px; } .d-ticket .t { font-weight: 700; } .d-ticket .dash { margin: 5px 0; border-top: 1px dashed #888; }

.d-start { position: absolute; left: 50%; bottom: 120px; z-index: 35; transform: translateX(-50%); padding: 12px 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--ink-on); font-weight: 700; box-shadow: 0 14px 30px -12px rgb(0 0 0 / .5); cursor: pointer; animation: d-pulse 2.4s ease-in-out infinite; }
@keyframes d-pulse { 50% { transform: translateX(-50%) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .d-start { animation: none; } }
.demo :focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Pantallas angostas: la demo se acomoda como en el celular. */
@media (max-width: 860px) {
  .d-app { height: auto; min-height: 640px; }
  .d-nav, .d-new kbd, .d-slash, .d-keys { display: none; }
  .d-top { justify-content: space-between; }
  .d-stage { padding: 10px 10px 0; }
  .d-hide-s { display: none; }
  .d-show-s { display: inline-flex; }
  .d-btn kbd { display: none; }
  .d-btn { min-width: 46px; padding: 0 10px; }
  .d-line { grid-template-columns: minmax(0, 1fr) auto 76px 30px; }
  .d-head { display: none; }
  .d-price { display: none; }
  .d-lines { min-height: 220px; }
  .d-paybar { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
  .d-paybar > .d-methods { display: flex; overflow-x: auto; scrollbar-width: none; }
  .d-paybar > .d-methods .d-method { min-width: 104px; }
  .d-paybar-r { grid-template-columns: 1fr 1fr; align-items: center; }
  .d-paybar-r .d-sum > div:not(.d-total) { display: none; }
  .d-paybar-r .d-total { flex-direction: column; margin: 0; padding: 0; border: 0; }
  .d-charge kbd { display: none; }
  .d-drawer { top: auto; left: 0; width: auto; max-height: 92%; border: 0; border-top: 2px solid var(--ink); border-radius: 12px 12px 0 0; }
  .d-drawer .d-methods { display: none; }
  .d-start { bottom: 170px; width: max-content; max-width: calc(100% - 32px); white-space: normal; text-align: center; }
}
