/* =========================================================
   MT Stock — estilo
   Segue o DESIGN (estilo MongoDB): bandas teal-escuro com o
   verde vivo nas ações principais, superfícies brancas com
   linhas finas, botões sempre em pílula, cartões de 12px.
   Cores de categoria (roxo, laranja, azul, rosa) só nas etiquetas.
   Letra: Poppins (geométrica, livre) no lugar da Euclid Circular A.
   ========================================================= */

@font-face { font-family: "Poppins MT"; src: url("/fontes/poppins-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins MT"; src: url("/fontes/poppins-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins MT"; src: url("/fontes/poppins-600.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
    /* Marca */
    --verde: #00ed64;            /* brand-green: ações principais */
    --verde-premido: #00c957;    /* primary-pressed */
    --verde-escuro: #00684a;     /* brand-green-dark: ligações, foco */
    --verde-medio: #00a35c;      /* brand-green-mid */
    --menta: #e3fcf7;            /* brand-green-soft / surface-feature */
    --teal-fundo: #001e2b;       /* brand-teal-deep: bandas, abas */
    --teal: #023430;             /* brand-teal */
    --teal-medio: #112733;       /* brand-teal-mid */
    /* Superfícies */
    --fundo: #f9fbfa;            /* surface */
    --cartao: #ffffff;           /* canvas */
    --suave-fundo: #f5f6f7;      /* surface-soft */
    --linha: #e8edeb;            /* hairline */
    --linha-suave: #f0f3f2;      /* hairline-soft */
    --linha-forte: #c1c7c6;      /* hairline-strong */
    --codigo: #001e2b;           /* canvas-dark */
    /* Texto */
    --tinta: #001e2b;            /* ink */
    --carvao: #1c2d38;           /* charcoal */
    --suave: #5c6c75;            /* steel */
    --muito-suave: #889397;      /* stone */
    --sobre-escuro: #ffffff;
    --sobre-escuro-suave: rgba(255,255,255,.7);
    /* Estado */
    --aviso-fundo: #fef7db;      /* semantic-warning-bg */
    --aviso-tinta: #944f01;      /* semantic-warning-text */
    --mau: #c8102e;
    --bom: var(--verde-escuro);
    /* Nomes antigos que o código ainda usa */
    --marca: var(--verde-escuro);
    --marca-clara: var(--menta);
    --sobre-marca: var(--tinta);
    /* Profundidade (só o que flutua) */
    --sombra-1: rgba(0,30,43,.04) 0 1px 2px 0;
    --sombra-2: rgba(0,30,43,.08) 0 4px 12px 0;
    --sombra-3: rgba(0,30,43,.12) 0 12px 24px -4px;
    --sombra-4: rgba(0,30,43,.16) 0 16px 48px -8px;
    /* Raios */
    --r-tag: 4px;
    --r-campo: 8px;
    --r-cartao: 12px;
    --r-painel: 16px;
    --r-folha: 24px;
    /* Letra */
    --ui: "Poppins MT", Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "Source Code Pro", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

/* Modo escuro: a página inteira vira "banda teal" */
@media (prefers-color-scheme: dark) {
    :root {
        --fundo: #001e2b;
        --cartao: #0b2633;
        --suave-fundo: #112733;
        --linha: #1c3a47;
        --linha-suave: #163240;
        --linha-forte: #3d4f58;
        --menta: #0b3b35;
        --tinta: #ffffff;
        --carvao: #e8edeb;
        --suave: #a9b3b6;
        --muito-suave: #889397;
        --aviso-fundo: #3a2c06;
        --aviso-tinta: #ffdf8a;
        --mau: #ff6b6b;
        --verde-escuro: #00ed64;
        --sombra-2: 0 0 0 1px rgba(255,255,255,.06);
        --sombra-3: 0 0 0 1px rgba(255,255,255,.08);
        --sombra-4: 0 0 0 1px rgba(255,255,255,.08);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; scroll-padding-bottom: 170px; }
body {
    font-family: var(--ui);
    font-size: 16px; line-height: 1.55; font-weight: 400;
    background: var(--fundo);
    color: var(--tinta);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* Ícones de traço */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-grande { display: block; width: 40px; height: 40px; margin: 0 auto 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; color: var(--muito-suave); }
.seta { color: var(--muito-suave); width: 18px; height: 18px; }

/* Foco visível */
:focus-visible { outline: 2px solid var(--verde-escuro); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--verde-escuro); box-shadow: 0 0 0 1px var(--verde-escuro); }

/* ---------- Topo: barra branca com linha fina ---------- */
.topo {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; min-height: 60px;
    background: var(--cartao); border-bottom: 1px solid var(--linha);
}
.topo-marca { display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 0; flex: 1; }
.topo-marca span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A marca: pílula teal com letras verdes (como o "Most Popular") */
.logo {
    display: inline-grid; place-items: center; height: 28px; padding: 0 10px; border-radius: 999px;
    background: var(--teal-fundo); color: var(--verde); font-size: 12px; font-weight: 600; letter-spacing: .06em; flex: none;
}
@media (prefers-color-scheme: dark) { .logo { background: var(--verde); color: #001e2b; } }
/* A escrita "mt st●ck": letras na cor do texto, a bola sempre verde */
.marca-escrita { display: block; height: 20px; width: auto; flex: none; color: var(--tinta); }
.topo-marca #nomeLoja { padding-left: 12px; border-left: 1px solid var(--linha); color: var(--suave); font-weight: 400; font-size: 15px; }
.marca-palavra .marca-escrita { height: 26px; color: #fff; }
.topo-quem { font-size: 13px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 45%; }

/* Indicador de internet / operações por enviar */
.rede {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--linha-forte); border-radius: 999px; padding: 5px 12px 5px 10px; min-height: 34px;
    font-size: 13px; font-weight: 500; cursor: pointer; background: var(--cartao); color: var(--tinta);
}
.rede .ic { width: 16px; height: 16px; }
.rede.espera { background: var(--aviso-fundo); color: var(--aviso-tinta); border-color: transparent; }
.rede.erro { background: var(--mau); color: #fff; border-color: var(--mau); }
@media (max-width: 420px) { .rede:not([hidden]) ~ .topo-quem { display: none; } }

/* ---------- Ecrã ---------- */
.ecra { max-width: 760px; margin: 0 auto; padding: 20px 16px; }
h1 { font-size: clamp(30px, 8vw, 36px); font-weight: 500; line-height: 1.2; letter-spacing: -.5px; margin: 6px 0 18px; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.4; margin: 28px 0 10px; }
.subtitulo { color: var(--suave); margin: -10px 0 18px; font-size: 15px; max-width: 60ch; }

/* ---------- Barra de abas: pílula teal-escuro a flutuar ---------- */
.abas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    padding: 0 12px calc(12px + env(safe-area-inset-bottom));
    pointer-events: none;
}
.abas-pilula {
    pointer-events: auto;
    display: flex; gap: 2px; max-width: 520px; margin: 0 auto; padding: 6px;
    background: var(--teal-fundo); border-radius: 999px;
    box-shadow: var(--sombra-3);
}
@media (prefers-color-scheme: dark) { .abas-pilula { background: #112733; box-shadow: 0 0 0 1px #1c3a47; } }
.abas button {
    flex: 1; min-width: 0; border: 0; background: none; border-radius: 999px;
    padding: 8px 4px; min-height: 52px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11.5px; font-weight: 500; color: var(--sobre-escuro-suave);
    transition: background-color .18s ease, color .18s ease;
}
.abas button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.abas button[aria-current="page"] { background: var(--verde); color: #001e2b; font-weight: 600; }
.abas button:focus-visible { outline-color: var(--verde); outline-offset: -2px; }

/* ---------- Cartões e listas (planos, com linha fina) ---------- */
.cartao { background: var(--cartao); border-radius: var(--r-cartao); border: 1px solid var(--linha); padding: 16px; margin-bottom: 12px; }
.linha { display: flex; align-items: center; gap: 12px; }
.linha .cresce, .cresce { flex: 1; min-width: 0; }
.lista { list-style: none; padding: 0; margin: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha-suave); min-height: 56px; }
.lista > li:last-child { border-bottom: 0; }
.lista > li[data-id] { cursor: pointer; }
.nome { font-weight: 500; }
.pequeno { font-size: 13px; color: var(--suave); line-height: 1.45; }
.direita { text-align: right; font-variant-numeric: tabular-nums; }
.forte { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Menus (Stock, Mais) */
.menu { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--r-cartao); overflow: hidden; margin-bottom: 12px; }
.opcao {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    padding: 14px 16px; min-height: 72px; border: 0; border-bottom: 1px solid var(--linha-suave); background: none; cursor: pointer;
    transition: background-color .15s ease;
}
.opcao:last-child { border-bottom: 0; }
.opcao .nome { display: block; }
.opcao .pequeno { display: block; }
.opcao-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-cartao); background: var(--menta); color: var(--verde-escuro); flex: none; }
.opcao.perigo .opcao-ic { background: var(--suave-fundo); color: var(--suave); }
.opcao:active { background: var(--suave-fundo); }
@media (hover: hover) { .opcao:hover { background: var(--fundo); } }

/* ---------- Formulários ---------- */
label.campo { display: block; margin-bottom: 14px; }
label.campo > span, .rotulo-campo { display: block; font-size: 14px; font-weight: 500; color: var(--carvao); margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 8px 12px; border-radius: var(--r-campo); border: 1px solid var(--linha-forte);
    background: var(--cartao); color: var(--tinta); min-height: 48px; font-size: 16px;
}
input::placeholder { color: var(--muito-suave); }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.com-botao { display: flex; gap: 8px; }
.com-botao input { flex: 1; }

/* ---------- Botões: sempre pílula ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 22px; border-radius: 999px;
    border: 1px solid var(--linha-forte); background: transparent; color: var(--tinta);
    font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s ease, transform .1s ease;
}
.btn .ic { width: 18px; height: 18px; }
.btn:active { transform: scale(.98); background: var(--suave-fundo); }
/* Ação principal: o verde vivo com letras teal */
.btn.principal { background: var(--verde); border-color: var(--verde); color: #001e2b; }
.btn.principal:active { background: var(--verde-premido); border-color: var(--verde-premido); }
@media (hover: hover) {
    .btn:hover { background: var(--suave-fundo); }
    .btn.principal:hover { background: var(--verde-premido); border-color: var(--verde-premido); }
}
.btn.perigo { color: var(--mau); }
.btn.cheio { width: 100%; }
.btn.peq { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.icone { padding: 0; width: 48px; flex: none; }
.btn:disabled { background: var(--linha); border-color: var(--linha); color: var(--muito-suave); cursor: default; transform: none; }
.botoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Escolhas (pagamento): a escolhida como o plano em destaque, menta e borda verde */
.escolhas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.escolhas button {
    min-height: 52px; border-radius: 999px; border: 1px solid var(--linha-forte); background: var(--cartao);
    font-weight: 500; cursor: pointer; padding: 8px 14px;
}
.escolhas button[aria-pressed="true"] { background: var(--menta); border-color: var(--verde); box-shadow: inset 0 0 0 1px var(--verde); font-weight: 600; }

/* Segmentos (entrar como dono / equipa) */
.segmentos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.segmentos button { min-height: 44px; border: 1px solid var(--linha); border-radius: 999px; background: var(--cartao); font-weight: 500; font-size: 14px; color: var(--suave); cursor: pointer; }
.segmentos button[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--fundo); }

/* Separadores (pill-tab) */
.separadores { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.separadores::-webkit-scrollbar { display: none; }
.separadores button {
    border: 1px solid var(--linha); background: var(--cartao); border-radius: 999px; padding: 6px 16px; min-height: 40px;
    white-space: nowrap; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--suave);
}
.separadores button[aria-pressed="true"] { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }

/* Etiquetas de categoria (as únicas cores fortes além do verde) */
.tag {
    display: inline-block; max-width: 100%; margin-bottom: 4px; padding: 2px 8px; border-radius: var(--r-tag);
    font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; line-height: 1.4;
    color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top;
}
.tag-0 { background: #7d2fd0; }   /* roxo */
.tag-1 { background: #c2410c; }   /* laranja */
.tag-2 { background: #016bf8; }   /* azul */
.tag-3 { background: #c0216d; }   /* rosa */
.tag-4 { background: #00684a; }   /* verde-escuro */

/* ---------- Vender: azulejos ---------- */
.procura { position: sticky; top: 60px; z-index: 4; background: var(--fundo); padding: 4px 0 12px; display: flex; gap: 8px; }
.procura input { flex: 1; border-radius: var(--r-campo); }
.grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.produto {
    position: relative; display: block; width: 100%; padding: 0; overflow: hidden;
    background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--r-cartao);
    text-align: left; cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.produto .foto { position: relative; aspect-ratio: 1; overflow: hidden; container-type: inline-size; background: var(--suave-fundo); }
.produto .foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
/* Sem foto: a primeira palavra do produto em grande, cortada na borda */
.produto .nome-grande {
    position: absolute; top: 10px; left: 12px; right: 0;
    font-weight: 500; font-size: clamp(30px, 26cqw, 56px); line-height: 1.1; letter-spacing: -1px;
    white-space: nowrap; overflow: hidden;
}
.produto.tom-escuro .foto { background: var(--teal-fundo); color: #fff;
    background-image: radial-gradient(120% 90% at 100% 100%, rgba(0,237,100,.22), transparent 60%); }
.produto.tom-menta .foto { background: #e3fcf7; color: #001e2b; }
.produto.tom-claro .foto { background: #eef2f1; color: #001e2b; }
@media (prefers-color-scheme: dark) {
    .produto.tom-escuro .foto { background-color: #023430; }
    .produto.tom-menta .foto { background: #0b3b35; color: #e3fcf7; }
    .produto.tom-claro .foto { background: #112733; color: #fff; }
}
/* O preço: pílula teal com letras verdes; sobre fundo escuro, ao contrário */
.produto .preco {
    position: absolute; left: 8px; bottom: 8px;
    padding: 4px 10px; border-radius: 999px; background: #001e2b; color: #00ed64;
    font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.produto.tom-escuro .preco { background: #00ed64; color: #001e2b; }
.produto .info { padding: 10px 12px 12px; }
.produto .info .nome { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.produto .info .pequeno { font-size: 12.5px; margin-top: 2px; }
.produto .qtd-carrinho {
    position: absolute; right: 8px; bottom: 8px; z-index: 1;
    min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px;
    display: grid; place-items: center; background: #00ed64; color: #001e2b;
    font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.produto.tom-escuro .qtd-carrinho { background: #fff; }
/* No carrinho: como o plano em destaque, borda verde de 2px */
.produto.no-carrinho { border-color: var(--verde); box-shadow: inset 0 0 0 1px var(--verde), var(--sombra-2); }
.produto.esgotado .foto { opacity: .45; }
.produto:active { transform: scale(.98); }
@media (hover: hover) {
    .produto:hover { transform: translateY(-2px); box-shadow: var(--sombra-2); }
    .produto.no-carrinho:hover { box-shadow: inset 0 0 0 1px var(--verde), var(--sombra-2); }
    .produto:hover .foto img { transform: scale(1.03); }
}

.etiqueta { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--menta); color: var(--verde-escuro); font-weight: 600; }
.etiqueta.mau { background: color-mix(in srgb, var(--mau) 12%, transparent); color: var(--mau); }
.etiqueta.aviso { background: var(--aviso-fundo); color: var(--aviso-tinta); }

.miniatura {
    width: 48px; height: 48px; border-radius: var(--r-campo); object-fit: cover; flex: none;
    background: var(--menta); color: var(--verde-escuro); display: grid; place-items: center;
    font-weight: 600; font-size: 15px;
}

/* Barra do carrinho: a ação principal, pílula verde */
.barra-carrinho {
    position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 5;
    max-width: 520px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
    min-height: 56px; padding: 6px 20px 6px 6px; border: 0; border-radius: 999px;
    background: var(--verde); color: #001e2b; cursor: pointer; text-align: left;
    box-shadow: var(--sombra-3);
    animation: subir .25s ease-out;
}
.barra-carrinho:active { background: var(--verde-premido); }
.barra-qtd { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px; background: #001e2b; color: #00ed64; font-weight: 600; font-variant-numeric: tabular-nums; }
.barra-carrinho .cresce { font-weight: 600; font-size: 15px; }
.barra-total { font-size: 22px; font-weight: 500; letter-spacing: -.5px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barra-total small { font-size: 13px; font-weight: 600; margin-left: 3px; letter-spacing: 0; }
@keyframes subir { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Folha (janela de baixo) ---------- */
.folha-fundo { position: fixed; inset: 0; background: rgba(0,30,43,.55); z-index: 20; animation: aparecer .2s ease-out; }
.folha {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
    max-width: 760px; margin: 0 auto;
    background: var(--cartao); border-radius: var(--r-folha) var(--r-folha) 0 0;
    padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
    box-shadow: var(--sombra-4);
    animation: subir-folha .26s cubic-bezier(.2,.8,.2,1);
}
.folha .pega { width: 40px; height: 4px; border-radius: 999px; background: var(--linha-forte); margin: 4px auto 8px; }
.folha-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.folha-titulo h2 { font-size: 22px; font-weight: 500; letter-spacing: -.3px; margin: 4px 0 12px; }
.fechar { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--linha); border-radius: 999px; background: var(--cartao); cursor: pointer; color: var(--tinta); flex: none; }
@keyframes subir-folha { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

.qtd { display: flex; align-items: center; gap: 6px; }
.qtd button { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--linha-forte); background: var(--cartao); font-size: 20px; font-weight: 500; cursor: pointer; }
.qtd input { width: 64px; text-align: center; min-height: 44px; padding: 6px; font-variant-numeric: tabular-nums; }
.preco-input { width: 100px !important; min-height: 44px !important; padding: 6px 10px !important; text-align: right; font-variant-numeric: tabular-nums; }

/* Total da venda */
.total-venda { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 0; margin: 4px 0 12px; border-top: 1px solid var(--linha); }
.total-venda > span { font-weight: 600; }
.total-venda output { font-size: 40px; font-weight: 500; line-height: 1.1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.total-venda small { font-size: 15px; font-weight: 600; margin-left: 6px; letter-spacing: 0; color: var(--suave); }

/* ---------- Relatório: banda teal com o número, depois a linha de números ---------- */
.numeros {
    display: flex; flex-wrap: wrap; margin-bottom: 12px;
    background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--r-cartao); overflow: hidden;
}
.numero { flex: 1 1 0; min-width: 0; padding: 14px 16px; border-left: 1px solid var(--linha); }
.numero:first-child, .numero.marca + .numero { border-left: 0; }
.numero .valor { font-size: 22px; font-weight: 500; letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.numero .valor small { font-size: 12px; font-weight: 600; margin-left: 3px; letter-spacing: 0; color: var(--suave); }
.numero .rotulo { font-size: 13px; color: var(--suave); margin-top: 2px; }
.numero.marca {
    flex-basis: 100%; padding: 24px 20px 22px; border-left: 0;
    background: var(--teal-fundo); color: #fff;
    background-image: radial-gradient(90% 120% at 100% 0%, rgba(0,237,100,.20), transparent 55%);
}
.numero.marca .valor { font-size: clamp(44px, 13vw, 64px); line-height: 1.05; letter-spacing: -1.5px; }
.numero.marca .valor small { font-size: 18px; color: var(--verde); margin-left: 8px; }
.numero.marca .rotulo { font-size: 15px; font-weight: 500; color: var(--verde); margin-top: 6px; }

/* ---------- Entrar: banda teal no topo, formulário por cima ---------- */
.entrar { max-width: 480px; margin: -20px auto 0; }
.entrar-banda {
    margin: 0 -16px; padding: 40px 24px 84px;
    background: var(--teal-fundo); color: #fff;
    background-image: radial-gradient(80% 100% at 100% 0%, rgba(0,237,100,.22), transparent 60%);
}
@media (min-width: 520px) { .entrar { margin-top: 24px; } .entrar-banda { margin: 0; border-radius: var(--r-painel); } }
.marca-palavra { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 18px; margin-bottom: 28px; }
.entrar-banda .logo { background: var(--verde); color: #001e2b; }
.titulo-entrar { font-size: clamp(34px, 9.5vw, 44px); font-weight: 500; line-height: 1.12; letter-spacing: -1px; margin: 0; max-width: 14ch; }
.entrar-corpo { position: relative; margin: -52px 8px 0; }
.entrar-corpo .segmentos { background: var(--cartao); padding: 6px; border-radius: 999px; box-shadow: var(--sombra-3); }
.entrar-corpo .segmentos button { border-color: transparent; }
.entrar .cartao { padding: 20px; }

.pin { display: flex; gap: 12px; justify-content: center; margin: 8px 0 18px; }
.pin span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--linha-forte); transition: background-color .15s ease; }
.pin span.cheio { background: var(--verde); border-color: var(--verde-escuro); }
.teclado { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: 14px 22px; }
.teclado button {
    width: 72px; height: 72px; border-radius: 999px; border: 1px solid var(--linha); background: var(--cartao); cursor: pointer;
    display: grid; place-items: center; font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.teclado button:active { background: var(--suave-fundo); }
.teclado button.ok { background: var(--verde); border-color: var(--verde); color: #001e2b; }
.teclado .ic { width: 24px; height: 24px; }

/* Código da loja: bloco de código, letras verdes em fundo escuro */
.codigo-loja {
    font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: .18em; text-align: center;
    padding: 14px 12px; margin: 6px 0 4px; border-radius: var(--r-campo);
    background: var(--codigo); color: var(--verde);
}

.vazio { text-align: center; color: var(--suave); padding: 48px 16px; }
.tudo-certo { display: flex; align-items: center; gap: 10px; }
.tudo-certo .ic { color: var(--verde-escuro); }

/* Leitor de código de barras */
.camara { position: relative; border-radius: var(--r-painel); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camara video { width: 100%; height: 100%; object-fit: cover; }
.camara .mira { position: absolute; left: 10%; right: 10%; top: 38%; height: 24%; border: 2px solid var(--verde); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,30,43,.45); }

.camara-estado { position: absolute; left: 12px; right: 12px; top: 12px; padding: 8px 12px; border-radius: var(--r-campo); background: rgba(0,30,43,.8); color: #fff; font-size: 14px; text-align: center; }
.lanterna { position: absolute; right: 12px; bottom: 12px; background: rgba(0,30,43,.8); color: #fff; border-color: transparent; }
.lanterna[aria-pressed="true"] { background: var(--verde); color: #001e2b; }
.foto-produto {
    position: relative; width: 120px; height: 120px; border-radius: var(--r-cartao); object-fit: cover;
    background: var(--menta); display: grid; place-items: center; align-content: center; gap: 6px;
    color: var(--verde-escuro); font-size: 13px; font-weight: 500; text-align: center;
    border: 1px dashed var(--verde-medio); cursor: pointer; overflow: hidden;
}
.foto-produto img { width: 100%; height: 100%; object-fit: cover; }
.foto-produto .ic { width: 26px; height: 26px; margin: 0 auto; }

/* Aviso (toast): pílula teal com ícone verde */
.aviso {
    position: fixed; left: 50%; top: calc(68px + env(safe-area-inset-top)); z-index: 40;
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
    padding: 10px 20px 10px 14px; border-radius: 999px;
    background: #001e2b; color: #fff; font-weight: 500; font-size: 14.5px;
    box-shadow: var(--sombra-4);
    opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-12px);
    transition: opacity .2s ease, transform .2s ease;
}
@media (prefers-color-scheme: dark) { .aviso { background: #fff; color: #001e2b; } .aviso .ic { color: #00684a !important; } }
.aviso .ic { color: var(--verde); }
.aviso.semrede .ic { color: #ffc010; }
.aviso.mostrar { opacity: 1; transform: translateX(-50%) translateY(0); }
.aviso.erro { background: var(--mau); color: #fff; }
.aviso.erro .ic { color: #fff !important; }

.marcar { width: 24px; height: 24px; accent-color: var(--verde-escuro); flex: none; }
.alerta { display: flex; gap: 10px; align-items: flex-start; background: var(--aviso-fundo); color: var(--aviso-tinta); border-radius: var(--r-cartao); padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.alerta .ic { margin-top: 1px; }

.assinatura { text-align: center; color: var(--muito-suave); font-size: 13px; margin-top: 28px; }

/* Modo suporte (Painel MT): faixa teal por cima, como a faixa de promoção */
.faixa-suporte {
    position: sticky; top: 60px; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 16px; background: var(--teal-fundo); color: #fff; font-size: 13.5px; font-weight: 500;
}
.faixa-suporte span { display: flex; align-items: center; gap: 8px; }
.faixa-suporte span .ic { flex: none; color: var(--verde); }
.faixa-suporte b { margin-right: 4px; color: var(--verde); }
.faixa-suporte button { flex: none; border: 0; border-radius: 999px; padding: 6px 16px; min-height: 36px; background: var(--verde); color: #001e2b; font-weight: 600; cursor: pointer; }

/* Telemóveis estreitos (320–360 px) */
@media (max-width: 360px) {
    .ecra { padding: 16px 12px; }
    .entrar-banda { margin: 0 -12px; }
    .abas { padding-left: 8px; padding-right: 8px; }
    .abas-pilula { padding: 4px; gap: 0; }
    .abas button { font-size: 10.5px; padding: 8px 0; }
    .barra-carrinho { left: 8px; right: 8px; }
    .barra-carrinho .so-largo { display: none; }
    .numero { padding: 12px; }
    .numero .valor { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
