/* França Tintas — site de promoções. Celular primeiro. Cores tiradas do logo (arco-íris azul → verde → amarelo → vermelho). */
:root {
  --fundo: #f7f6f3;
  --cartao: #ffffff;
  --tinta: #141414;
  --suave: #5f5e5a;
  --linha: #e4e2dc;
  --azul: #1756c9;
  --vermelho: #d8321f;
  --whats: #1a8f4c;
  --whats-txt: #ffffff;
  --sombra: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px -12px rgb(0 0 0 / .18);
  --arco: linear-gradient(90deg, #1f4fd1 0%, #1aa0e0 18%, #2fb24c 36%, #f2d21b 54%, #f58a1f 72%, #e2261d 100%);
  --raio: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #121212; --cartao: #1c1c1b; --tinta: #f4f3ef; --suave: #aaa8a2; --linha: #2e2d2b;
    --azul: #7aa5ff; --vermelho: #ff7a66; --whats: #25b360; --whats-txt: #06240f;
    --sombra: 0 1px 2px rgb(0 0 0 / .5), 0 10px 26px -12px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fundo: #121212; --cartao: #1c1c1b; --tinta: #f4f3ef; --suave: #aaa8a2; --linha: #2e2d2b;
  --azul: #7aa5ff; --vermelho: #ff7a66; --whats: #25b360; --whats-txt: #06240f;
  --sombra: 0 1px 2px rgb(0 0 0 / .5), 0 10px 26px -12px rgb(0 0 0 / .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--tinta);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 6px; }
h1, h2 { text-wrap: balance; margin: 0; }

.arco { height: 5px; background: var(--arco); }
.arco.fino { height: 3px; border-radius: 3px; width: 120px; margin: 0 auto 20px; }

/* Topo */
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.marca img { width: 40px; height: auto; background: #fff; border-radius: 10px; padding: 2px; }
.marca b { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.marca small { display: block; color: var(--suave); font-size: .78rem; }

/* Botões WhatsApp */
.btn-whats {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--whats); color: var(--whats-txt); text-decoration: none; font-weight: 700;
  border-radius: 999px; padding: 12px 18px; min-height: 48px; border: 0; cursor: pointer;
  font-size: 1rem; width: 100%;
}
.btn-whats:active { transform: translateY(1px); }
.btn-whats svg, .flutuante svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.btn-whats svg .cheio, .flutuante svg .cheio { fill: currentColor; stroke: none; }
.btn-mini { width: auto; padding: 8px 14px; min-height: 40px; font-size: .9rem; flex-shrink: 0; }

/* Destaque do topo */
main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 24px 0 12px; }
.selo {
  display: inline-block; margin: 0 0 8px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--vermelho);
}
.hero h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 850; }
.hero .sub { color: var(--suave); margin: 10px 0 0; max-width: 46ch; }

/* Filtros */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 16px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.filtros::-webkit-scrollbar { display: none; }
.filtros button {
  flex-shrink: 0; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--linha); background: var(--cartao); color: var(--tinta);
  border-radius: 999px; padding: 8px 16px; min-height: 40px;
}
.filtros button[aria-pressed="true"] { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }

/* Cartões */
.grade { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .grade { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grade { grid-template-columns: repeat(3, 1fr); } }
.oferta {
  background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra);
  overflow: hidden; display: flex; flex-direction: column;
}
.oferta.destaque { border-color: transparent; box-shadow: 0 0 0 2px var(--vermelho), var(--sombra); }
.foto { position: relative; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.foto img.semfoto { inset: 18%; width: 64%; height: 64%; padding: 0; opacity: .9; }
.foto::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--arco); }
.etiqueta {
  position: absolute; top: 10px; left: 10px; background: var(--vermelho); color: #fff;
  font-weight: 800; font-size: .9rem; border-radius: 8px; padding: 4px 9px;
}
.etiqueta.cat { left: auto; right: 10px; background: rgb(20 20 20 / .78); font-weight: 600; font-size: .75rem; }
.corpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.corpo h2 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -.01em; }
.corpo .desc { color: var(--suave); margin: 0; font-size: .95rem; }
.precos { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.de { color: var(--suave); text-decoration: line-through; font-size: .95rem; }
.por { font-size: 1.75rem; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.un { color: var(--suave); font-size: .9rem; }
.validade { font-size: .82rem; color: var(--suave); margin: 0 0 8px; }
.corpo .btn-whats { margin-top: auto; }

.vazio { text-align: center; color: var(--suave); padding: 40px 8px; }

/* Rodapé */
.rodape { text-align: center; padding: 40px 16px 24px; margin-top: 40px; border-top: 1px solid var(--linha); color: var(--suave); font-size: .92rem; }
.rodape img { margin: 0 auto 12px; background: #fff; border-radius: 14px; padding: 4px; }
.rodape p { margin: 4px 0; }
.rodape b { color: var(--tinta); }
.rodape .aviso { font-size: .78rem; max-width: 52ch; margin: 18px auto 0; }

/* Aviso de demonstração */
.demo { margin: 0; background: #fff3c4; color: #5a4300; font-size: .85rem; font-weight: 600; text-align: center; padding: 8px 16px; }

/* Botão Orçamento no topo */
.btn-orc {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
  background: var(--tinta); color: var(--fundo); border: 0; border-radius: 999px; padding: 8px 14px; min-height: 42px;
}
.btn-orc svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.btn-orc .qtd {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--vermelho); color: #fff; font-size: .75rem; display: grid; place-items: center; border: 2px solid var(--fundo);
}

/* Cupom */
.cupom {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 4px;
  background: var(--cartao); border: 2px dashed var(--vermelho); border-radius: var(--raio); padding: 14px 16px;
}
.cupom p { margin: 0; }
.cupom-t { font-weight: 800; font-size: 1.05rem; }
.cupom-txt { font-size: .92rem; }
.cupom-regras { font-size: .75rem; color: var(--suave); margin-top: 4px !important; }
.cupom-cod {
  flex-shrink: 0; font-weight: 900; letter-spacing: .06em; font-size: 1rem; color: #fff; background: var(--vermelho);
  border-radius: 10px; padding: 8px 12px; font-family: ui-monospace, Consolas, monospace;
}

/* Preços e extras do cartão */
.precos { flex-direction: column; align-items: flex-start; gap: 0; }
.linha-por { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.por.consulta { font-size: 1.15rem; font-weight: 750; }
.cartao { font-size: .85rem; color: var(--suave); }
.faixas { list-style: none; margin: 6px 0 0; padding: 8px 10px; background: color-mix(in srgb, var(--azul) 9%, transparent); border-radius: 10px; font-size: .86rem; font-weight: 600; }
.faixas li + li { margin-top: 2px; }
.nota-cor { margin: 4px 0 0; font-size: .82rem; color: var(--suave); border-left: 3px solid; border-image: var(--arco) 1; padding-left: 8px; }

.add { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--suave); }
.campo input, .qtdbox input {
  font: inherit; font-size: 1rem; color: var(--tinta); background: var(--fundo); border: 1px solid var(--linha); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
.linha-add { display: flex; gap: 8px; }
.qtdbox { display: flex; align-items: center; border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--fundo); }
.qtdbox button { font: inherit; font-size: 1.2rem; font-weight: 700; width: 40px; min-height: 46px; border: 0; background: transparent; color: var(--tinta); cursor: pointer; }
.qtdbox input { width: 46px; border: 0; border-radius: 0; text-align: center; padding: 0; min-height: 46px; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qtdbox input::-webkit-inner-spin-button, .qtdbox input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.btn-add { flex: 1; font: inherit; font-weight: 700; font-size: .95rem; border: 0; border-radius: 12px; background: var(--tinta); color: var(--fundo); cursor: pointer; min-height: 48px; padding: 0 12px; }
.btn-add:active { transform: translateY(1px); }

/* Gaveta do orçamento */
.gaveta {
  border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); margin: auto auto 0; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; background: var(--cartao); color: var(--tinta); border-radius: 20px 20px 0 0;
}
@media (min-width: 620px) { .gaveta { margin: auto; border-radius: 20px; } }
.gaveta::backdrop { background: rgb(0 0 0 / .5); }
.gaveta-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gaveta-topo h2 { font-size: 1.3rem; }
.fechar { font: inherit; font-size: 1.8rem; line-height: 1; width: 44px; height: 44px; border: 0; background: transparent; color: var(--tinta); cursor: pointer; border-radius: 50%; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--linha); align-items: center; }
.item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-info b { font-size: .95rem; line-height: 1.25; }
.item-info span { font-size: .82rem; color: var(--suave); }
.item-info .cor { color: var(--tinta); font-weight: 600; }
.item-info .cor.falta { color: var(--vermelho); }
.qtdbox.mini button { width: 36px; min-height: 38px; }
.qtdbox.mini .v { min-width: 28px; text-align: center; font-weight: 700; }
.tirar { grid-column: 1 / -1; justify-self: start; font: inherit; font-size: .8rem; color: var(--vermelho); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; }
.total b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.obs { font-size: .82rem; color: var(--suave); margin: 0 0 8px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; padding: 10px 12px; margin: 8px 0; border: 2px dashed var(--vermelho); border-radius: 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--vermelho); }
.gaveta .campo { margin: 10px 0; }
.receber { border: 0; padding: 0; margin: 10px 0; display: flex; gap: 16px; flex-wrap: wrap; }
.receber legend { font-size: .82rem; font-weight: 600; color: var(--suave); margin-bottom: 6px; padding: 0; }
.receber label { display: flex; gap: 8px; align-items: center; font-weight: 600; min-height: 40px; }
.receber input { width: 20px; height: 20px; }
.gaveta .btn-whats { margin-top: 8px; }
.limpar { display: block; margin: 12px auto 0; font: inherit; font-size: .85rem; color: var(--suave); background: none; border: 0; cursor: pointer; text-decoration: underline; min-height: 40px; }

/* Aviso rápido */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--tinta); color: var(--fundo); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Botão flutuante */
.flutuante {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--whats); color: var(--whats-txt); box-shadow: 0 10px 24px -8px rgb(0 0 0 / .45);
}
.flutuante svg { width: 30px; height: 30px; }
