/* Loja virtual: o site do cliente da loja (index.html + loja.js). Feito primeiro para o celular.
   --cor é a cor do site (Configuração da Loja virtual no SAM); --sobre é o texto por cima dela. */
:root {
  --cor: #0A4D7A;
  --sobre: #fff;
  --fundo: #f6f7f9;
  --cartao: #fff;
  --texto: #1b2430;
  --suave: #667085;
  --linha: #e3e7ee;
  --verde: #128c4b;
  --raio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--texto); background: var(--fundo); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 14px 28px; }

/* topo */
.topo { background: var(--cor); color: var(--sobre); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.topo-in { max-width: 1120px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.01em; min-width: 0; }
.marca img { max-height: 40px; max-width: 170px; display: block; }
.marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-whats { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 600; font-size: 13.5px; padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); white-space: nowrap; }
.bt-whats svg { fill: currentColor; stroke: none; }
.sobre-escuro .bt-whats { background: rgba(0, 0, 0, .09); }
.aviso-topo { background: color-mix(in srgb, var(--cor) 10%, #fff); color: var(--texto); text-align: center; padding: 8px 14px; font-size: 13.5px; }

/* estado: carregando, fechado, erro */
.estado { text-align: center; padding: 70px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.estado h1 { font-size: 20px; }
.estado p { color: var(--suave); max-width: 44ch; }
.gira { width: 30px; height: 30px; border: 3px solid var(--linha); border-top-color: var(--cor); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.pri { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.pri svg { fill: currentColor; stroke: none; }
.btn.grande { width: 100%; padding: 14px 16px; font-size: 16px; }
.btn.parado { background: var(--linha); border-color: var(--linha); color: var(--suave); cursor: default; }

/* busca e filtros */
.busca { position: relative; }
.busca svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--suave); }
.busca input { width: 100%; border: 1px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 12px 12px 12px 42px; font-size: 16px; }
.busca input:focus, select:focus { outline: 2px solid var(--cor); outline-offset: 0; border-color: transparent; }
.grupos { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.grupos::-webkit-scrollbar { display: none; }
.grupos button { border: 1px solid var(--linha); background: var(--cartao); border-radius: 99px; padding: 7px 14px; white-space: nowrap; cursor: pointer; font-size: 14px; }
.grupos button[aria-selected="true"] { background: var(--cor); border-color: var(--cor); color: var(--sobre); font-weight: 600; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; color: var(--suave); font-size: 13.5px; }
.barra-sel { display: flex; gap: 8px; }
.barra select { border: 1px solid var(--linha); background: var(--cartao); border-radius: 10px; padding: 7px 8px; font-size: 14px; color: var(--texto); max-width: 46vw; }

/* vitrine */
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .grade { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; } }
.item { background: var(--cartao); border-radius: var(--raio); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; border: 1px solid var(--linha); }
.item .img { position: relative; aspect-ratio: 3 / 4; background: #eceff3; display: grid; place-items: center; color: #9aa4b2; font-size: 12.5px; }
.item .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item .selo { position: absolute; left: 8px; top: 8px; background: rgba(27, 36, 48, .82); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; z-index: 1; }
.item .txt { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.item .marca-p { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); }
.item .nome { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .preco { font-size: 16px; font-weight: 700; margin-top: 2px; }
.item .preco s { font-size: 12.5px; font-weight: 500; color: var(--suave); }
.item .selo.promo { background: #d92d20; }
.item .preco small { font-size: 11.5px; font-weight: 500; color: var(--suave); }
.item .ncores { font-size: 12px; color: var(--suave); }
.item.fora .img img { opacity: .55; }
.vazio { text-align: center; color: var(--suave); padding: 40px 10px; }
.mais { text-align: center; padding-top: 18px; }

/* produto */
.voltar { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--suave); font-weight: 600; padding: 4px 0 12px; }
.prod { display: grid; gap: 18px; }
@media (min-width: 800px) { .prod { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; } }
.fotos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--raio); background: #eceff3; scrollbar-width: none; aspect-ratio: 3 / 4; }
.fotos::-webkit-scrollbar { display: none; }
.fotos > * { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; color: #9aa4b2; }
.fotos img { width: 100%; height: 100%; object-fit: contain; display: block; }
.minis { display: flex; gap: 8px; padding-top: 8px; overflow-x: auto; }
.minis button { flex: none; width: 58px; height: 74px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: #eceff3; cursor: pointer; }
.minis button[aria-current="true"] { border-color: var(--cor); }
.minis img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { display: flex; flex-direction: column; gap: 12px; }
.info h1 { font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.p-marca { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
.p-preco { font-size: 26px; font-weight: 800; }
.p-preco s { font-size: 16px; font-weight: 500; color: var(--suave); }
.p-preco .p-off { font-size: 13px; font-weight: 700; background: #d92d20; color: #fff; border-radius: 99px; padding: 3px 9px; vertical-align: 4px; }
.p-promo { color: #b42318; font-weight: 600; font-size: 13.5px; margin-top: -8px; }
.p-esgotado { color: #b42318; font-weight: 600; }
.bloco h2 { font-size: 13.5px; font-weight: 600; color: var(--suave); margin-bottom: 8px; }
.bloco h2 b { color: var(--texto); }
.bloco p { white-space: pre-line; }
.cores, .tams { display: flex; flex-wrap: wrap; gap: 8px; }
.cores button { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 4px 12px 4px 4px; cursor: pointer; min-height: 48px; }
.cores button .cmini { width: 34px; height: 40px; border-radius: 8px; background: #eceff3; overflow: hidden; flex: none; }
.cores button .cmini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cores button[aria-pressed="true"] { border-color: var(--cor); box-shadow: 0 0 0 1px var(--cor); font-weight: 600; }
.cores button.fora { color: var(--suave); }
.tams button { min-width: 48px; min-height: 44px; border: 1.5px solid var(--linha); background: var(--cartao); border-radius: 10px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.tams button[aria-pressed="true"] { background: var(--cor); border-color: var(--cor); color: var(--sobre); }
.tams button:disabled { color: #a6aebb; background: #f1f3f6; cursor: default; text-decoration: line-through; font-weight: 500; }
.p-dica { color: var(--suave); font-size: 13px; text-align: center; margin-top: -4px; }
.p-cod { color: #98a2b3; font-size: 12px; }

.p-duvida { text-align: center; color: var(--suave); font-size: 13.5px; text-underline-offset: 3px; }

/* sacola no topo */
.topo-in { gap: 8px; }
.marca { margin-right: auto; }
.bt-sacola { position: relative; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 600; font-size: 13.5px; padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); white-space: nowrap; }
.sobre-escuro .bt-sacola { background: rgba(0, 0, 0, .09); }
.bt-sacola b { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--sobre); color: var(--cor); font-size: 12px; display: grid; place-items: center; }
@media (max-width: 480px) { .bt-whats span { display: none; } .bt-whats { padding: 8px 10px; } }

/* sacola */
.tit { font-size: 21px; margin-bottom: 12px; }
.sacola { display: grid; gap: 18px; }
@media (min-width: 800px) { .sacola { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; } }
.s-itens { display: flex; flex-direction: column; gap: 10px; }
.s-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 10px; }
.s-item .s-foto { width: 64px; height: 82px; border-radius: 9px; background: #eceff3; overflow: hidden; }
.s-item .s-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-item .s-nome { font-weight: 600; font-size: 14px; line-height: 1.3; }
.s-item .s-det { color: var(--suave); font-size: 13px; }
.s-item .s-fora { color: #b42318; font-size: 13px; font-weight: 600; }
.s-item .s-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.s-item .s-preco { font-weight: 700; }
.s-qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 10px; overflow: hidden; }
.s-qtd button { width: 38px; height: 36px; border: 0; background: var(--cartao); cursor: pointer; font-size: 18px; }
.s-qtd span { min-width: 30px; text-align: center; font-weight: 600; }
.s-tirar { border: 0; background: none; color: var(--suave); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 6px 0; }
.s-form { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.s-form h2 { font-size: 16px; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--suave); }
.campo input, .campo textarea { border: 1px solid var(--linha); border-radius: 10px; padding: 11px 12px; font-size: 16px; font-weight: 400; color: var(--texto); background: #fff; resize: vertical; }
.campo input:focus, .campo textarea:focus { outline: 2px solid var(--cor); outline-offset: 0; border-color: transparent; }
.campo.ruim input { border-color: #b42318; }
#cEndBox { display: flex; flex-direction: column; gap: 12px; }
.s-opcoes { display: grid; gap: 8px; }
.s-opcoes label { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--linha); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.s-opcoes label:has(input:checked) { border-color: var(--cor); box-shadow: 0 0 0 1px var(--cor); }
.s-opcoes input { margin-top: 3px; accent-color: var(--cor); }
.s-opcoes small { display: block; color: var(--suave); font-size: 12.5px; }
.s-total { margin: 4px 0 0; display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--linha); padding-top: 12px; }
.s-total div { display: flex; justify-content: space-between; gap: 10px; color: var(--suave); }
.s-total dd { margin: 0; color: var(--texto); }
.s-total .forte { font-size: 18px; font-weight: 800; color: var(--texto); }
.s-erro { background: #fef3f2; color: #b42318; border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.s-nota { color: var(--suave); font-size: 12.5px; text-align: center; }

/* pedido feito */
.feito-ico { width: 62px; height: 62px; border-radius: 50%; background: #e7f6ee; color: var(--verde); display: grid; place-items: center; }
.feito-ico svg { width: 32px; height: 32px; stroke-width: 2.5; }
.feito-resumo { width: 100%; max-width: 420px; background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px; text-align: left; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.feito-resumo .ln { display: flex; justify-content: space-between; gap: 10px; }
.feito-resumo .ln span:first-child { min-width: 0; }
.feito-resumo .tot { border-top: 1px solid var(--linha); padding-top: 8px; font-weight: 800; font-size: 16px; }
#vFeito .btn { width: 100%; max-width: 420px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1b2430; color: #fff; padding: 11px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; z-index: 40; max-width: calc(100vw - 28px); text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

/* rodapé */
.rodape { border-top: 1px solid var(--linha); background: var(--cartao); padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); text-align: center; color: var(--suave); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.rodape b { color: var(--texto); font-size: 14px; }
