/* Scanner de Preços — CSS próprio (app isolado, não importa CSS de outros apps).
   Valores espelham o System Design Montreal (mt-tokens): branco + vermelho #D2112C
   como acento. Prefixo: sc- */
:root {
  --sc-red: #D2112C;
  --sc-red-ink: #A50E24;
  --sc-red-bg: #FBE9EC;
  --sc-red-border: #F6D3D8;
  --sc-bg: #F7F6F4;
  --sc-surface: #FFFFFF;
  --sc-surface-2: #FAFAF9;
  --sc-border: #E7E5E4;
  --sc-border-3: #F0EEEC;
  --sc-ink: #1C1917;
  --sc-ink-3: #44403C;
  --sc-ink-5: #78716C;
  --sc-ink-6: #A8A29E;
  --sc-ok-bg: #E3F4E8; --sc-ok-ink: #166534; --sc-ok-border: #BFE3CA;
  --sc-warn-bg: #FDF1DB; --sc-warn-ink: #92400E; --sc-warn-border: #F5E0BC;
  --sc-shadow: 0 4px 14px rgba(28,25,23,.07);
  --sc-shadow-pop: 0 16px 40px rgba(28,25,23,.18);
  --sc-font: 'Public Sans', system-ui, -apple-system, sans-serif;
  --sc-head: 'Manrope', system-ui, -apple-system, sans-serif;
  --sc-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sc-font); color: var(--sc-ink); background: var(--sc-bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }

.sc-app { max-width: 480px; margin: 0 auto; min-height: 100%; background: var(--sc-surface);
          display: flex; flex-direction: column; }

/* Topo */
.sc-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
          padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--sc-surface);
          border-bottom: 1px solid var(--sc-border); }
.sc-marca { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.sc-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--sc-red); color: #fff;
           display: grid; place-items: center; flex: 0 0 auto; }
.sc-logo svg { width: 20px; height: 20px; stroke-width: 2.2; }
.sc-marca-txt { min-width: 0; line-height: 1.15; }
.sc-marca-txt b { display: block; font-family: var(--sc-head); font-weight: 800; font-size: 15px;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-marca-txt small { font-size: 11.5px; color: var(--sc-ink-5); }
.sc-loja-btn { display: flex; align-items: center; gap: 6px; max-width: 52%; padding: 7px 10px;
               border: 1px solid var(--sc-border); border-radius: 999px; background: var(--sc-surface-2);
               color: var(--sc-ink); font-size: 13px; font-weight: 600; }
.sc-loja-btn svg { width: 15px; height: 15px; color: var(--sc-red); }
.sc-loja-btn .sc-chev { color: var(--sc-ink-5); }
.sc-loja-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-loja-btn.is-vazia { border-color: var(--sc-red-border); background: var(--sc-red-bg); color: var(--sc-red-ink); }

.sc-main { flex: 1; padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); display: flex;
           flex-direction: column; gap: 14px; }

/* Modos */
.sc-modos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
            background: var(--sc-surface-2); border: 1px solid var(--sc-border); border-radius: 12px; }
.sc-modo { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 6px;
           border: 0; border-radius: 9px; background: transparent; color: var(--sc-ink-5);
           font-size: 14px; font-weight: 600; }
.sc-modo.is-on { background: var(--sc-surface); color: var(--sc-red-ink); box-shadow: 0 1px 3px rgba(28,25,23,.12); }

/* Câmera */
.sc-camera { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
             background: #1C1917; }
.sc-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-mira { position: absolute; inset: 22% 12%; pointer-events: none; }
.sc-mira i { position: absolute; width: 28px; height: 28px; border: 3px solid #fff; }
.sc-mira .c1 { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.sc-mira .c2 { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.sc-mira .c3 { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.sc-mira .c4 { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.sc-laser { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--sc-red);
            box-shadow: 0 0 10px 2px rgba(210,17,44,.7); animation: sc-laser 1.8s ease-in-out infinite; }
@keyframes sc-laser { 0%,100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
.sc-dica { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0;
           padding: 6px 12px; border-radius: 999px; background: rgba(28,25,23,.72); color: #fff;
           font-size: 13px; font-weight: 600; white-space: nowrap; }
.sc-cam-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
              justify-content: center; gap: 12px; padding: 24px; background: var(--sc-surface-2);
              text-align: center; }
.sc-cam-msg { margin: 0; font-size: 13.5px; color: var(--sc-ink-5); line-height: 1.45; max-width: 300px; }
.sc-cam-msg:empty { display: none; }

/* Digitar */
.sc-form { display: flex; flex-direction: column; gap: 8px; }
.sc-form label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
                 color: var(--sc-ink-5); }
.sc-form input, .sc-busca { width: 100%; padding: 13px 14px; border: 1px solid var(--sc-border);
                 border-radius: 10px; background: var(--sc-surface); font: 500 17px/1.2 var(--sc-mono);
                 color: var(--sc-ink); outline: none; }
.sc-busca { font-family: var(--sc-font); font-size: 15px; }
.sc-form input:focus, .sc-busca:focus { border-color: var(--sc-red); box-shadow: 0 0 0 3px var(--sc-red-bg); }

/* Botões */
.sc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px;
          border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 15px; }
.sc-btn-pri { background: var(--sc-red); color: #fff; }
.sc-btn-pri:active { background: var(--sc-red-ink); }
.sc-btn-sec { background: var(--sc-surface); color: var(--sc-red-ink); border-color: var(--sc-red-border); }
.sc-btn[disabled] { opacity: .65; cursor: default; }
.sc-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
           border-right-color: transparent; animation: sc-gira .7s linear infinite; display: inline-block; }
@keyframes sc-gira { to { transform: rotate(360deg); } }

/* Resultado */
.sc-card { border: 1px solid var(--sc-border); border-radius: 14px; background: var(--sc-surface);
           box-shadow: var(--sc-shadow); overflow: hidden; }
.sc-card-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--sc-border-3); }
.sc-estr { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sc-chip { padding: 3px 9px; border-radius: 999px; background: var(--sc-surface-2); border: 1px solid var(--sc-border);
           font-size: 11.5px; font-weight: 600; color: var(--sc-ink-3); }
.sc-desc { margin: 0; font-family: var(--sc-head); font-size: 17px; font-weight: 800; line-height: 1.3; }
.sc-cods { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; line-height: 1.4; }
.sc-cod { display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.sc-cod > span { color: var(--sc-ink-5); }
.sc-cod > b { font: 600 13px/1.4 var(--sc-mono); color: var(--sc-ink); }
.sc-precos { display: grid; grid-template-columns: 1fr 1fr; }
.sc-preco { padding: 14px 16px; }
.sc-preco + .sc-preco { border-left: 1px solid var(--sc-border-3); }
.sc-preco small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .04em; color: var(--sc-ink-5); margin-bottom: 4px; }
.sc-preco b { font: 800 22px/1.15 var(--sc-head); }
.sc-preco.is-original b { color: var(--sc-ink-5); font-size: 19px; }
.sc-preco.is-original.is-riscado b { text-decoration: line-through; }
.sc-aviso { margin: 0 16px 14px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4;
            background: var(--sc-warn-bg); color: var(--sc-warn-ink); border: 1px solid var(--sc-warn-border); }

.sc-aviso-solo { margin-top: 14px; }

.sc-camps { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.sc-camp { border: 1px solid var(--sc-red-border); background: var(--sc-red-bg); border-radius: 12px; padding: 12px 14px; }
.sc-camp-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800;
               text-transform: uppercase; letter-spacing: .05em; color: var(--sc-red); }
.sc-camp-tag svg { width: 14px; height: 14px; }
.sc-camp-nome { margin: 4px 0 8px; font-weight: 700; font-size: 14.5px; line-height: 1.35; color: var(--sc-ink); }
.sc-camp-linhas { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.sc-camp-linhas dt { color: var(--sc-ink-5); }
.sc-camp-linhas dd { margin: 0; font-weight: 600; text-align: right; }
.sc-sem-camp { padding: 0 16px 16px; margin: 0; font-size: 13.5px; color: var(--sc-ink-5); }

.sc-lista-tit { margin: 0 0 8px; font-size: 14px; color: var(--sc-ink-3); }
.sc-opcoes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--sc-border); border-radius: 12px; overflow: hidden; }
.sc-opcoes li + li { border-top: 1px solid var(--sc-border-3); }
.sc-opcoes button { width: 100%; text-align: left; padding: 12px 14px; border: 0; background: var(--sc-surface);
                    display: flex; align-items: center; gap: 10px; }
.sc-opcoes button:active { background: var(--sc-surface-2); }
.sc-op-txt { flex: 1; min-width: 0; }
.sc-op-txt b { display: block; font-size: 14px; line-height: 1.3; }
.sc-op-txt small { display: block; margin-top: 2px; font-size: 12px; color: var(--sc-ink-5); }
.sc-opcoes svg { color: var(--sc-ink-6); }

.sc-vazio { padding: 22px 18px; border: 1px dashed var(--sc-border); border-radius: 14px; text-align: center;
            color: var(--sc-ink-5); font-size: 14px; line-height: 1.45; }
.sc-vazio b { display: block; color: var(--sc-ink); font-size: 15px; margin-bottom: 4px; }
.sc-carregando { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 12px;
                 color: var(--sc-ink-5); font-size: 14px; }
.sc-carregando .sc-spin { color: var(--sc-red); }

/* Escolha de loja */
.sc-sheet { position: fixed; inset: 0; z-index: 20; background: rgba(41,37,36,.38); display: flex;
            align-items: flex-end; justify-content: center; }
.sc-sheet-box { width: 100%; max-width: 480px; height: 90vh; height: 90dvh; display: flex; flex-direction: column;
                background: var(--sc-surface); border-radius: 18px 18px 0 0; box-shadow: var(--sc-shadow-pop);
                padding: 18px 16px 0; }
@media (min-width: 640px) {
  .sc-sheet { align-items: center; padding: 24px; }
  .sc-sheet-box { max-width: 440px; height: min(640px, 86vh); border-radius: 16px; }
}
.sc-sheet-head { display: flex; align-items: center; gap: 10px; }
.sc-sheet-head h2 { flex: 1; margin: 0; font: 800 18px/1.2 var(--sc-head); }
.sc-x { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px;
        background: var(--sc-surface-2); color: var(--sc-ink-5); }
.sc-sheet-sub { margin: 4px 0 14px; font-size: 13px; color: var(--sc-ink-5); }
.sc-busca-box { position: relative; }
.sc-busca-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--sc-ink-6); }
.sc-busca-box .sc-busca { padding-left: 40px; background: var(--sc-surface-2); }
.sc-busca-box .sc-busca:focus { background: var(--sc-surface); }
.sc-busca::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sc-lojas-total { margin: 12px 2px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .05em; color: var(--sc-ink-6); }
.sc-lojas-total:empty { display: none; }
.sc-lojas { list-style: none; margin: 0 -16px; padding: 0 10px calc(14px + env(safe-area-inset-bottom));
            overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.sc-lojas .sc-grupo { margin: 10px 6px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
                      letter-spacing: .05em; color: var(--sc-ink-6); }
.sc-loja { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 8px; margin: 1px 0;
           border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; }
.sc-loja:hover { background: var(--sc-surface-2); }
.sc-loja:focus-visible { outline: none; border-color: var(--sc-red); }
.sc-loja-num { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px;
               background: var(--sc-surface-2); border: 1px solid var(--sc-border); font: 800 14px/1 var(--sc-head);
               color: var(--sc-ink-3); }
.sc-loja-txt { flex: 1; min-width: 0; }
.sc-loja-txt b { display: block; font-size: 14.5px; font-weight: 700; color: var(--sc-ink); line-height: 1.25;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-loja-txt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--sc-ink-5);
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-loja-ok { width: 22px; height: 22px; color: var(--sc-red); visibility: hidden; }
.sc-loja.is-on { background: var(--sc-red-bg); border-color: var(--sc-red-border); }
.sc-loja.is-on .sc-loja-num { background: var(--sc-red); border-color: var(--sc-red); color: #fff; }
.sc-loja.is-on .sc-loja-ok { visibility: visible; }
.sc-loja .sc-spin { color: var(--sc-red); }
.sc-loja mark { background: #FDF1DB; color: inherit; border-radius: 3px; padding: 0 1px; }

/* Aviso rápido */
.sc-toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
            z-index: 30; max-width: calc(100% - 28px); padding: 11px 16px; border-radius: 10px;
            background: var(--sc-ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--sc-shadow-pop); }
.sc-toast.is-erro { background: var(--sc-red-ink); }
