/* Vitrine do Modo Completo — camada base (kalymnosshop#219, T1). Reset, tipografia, formulários e utilitários que as telas do
   Completo usam, copiados do app.css com os MESMOS valores. O painel, o Admin e a vitrine do Simples seguem no app.css.
   Cor literal só no bloco de tokens abaixo (contrato: KalShop.Web.Infra.StoreTokens); daqui para baixo, só var(--…).
   Sem dependências; sem estilo inline (CSP). */
@layer base, components, template, brand;

@layer base {
  :root {
    /* Neutros (o template muda; a marca não). */
    --ink: #1d2327; --muted: #5d6870; --line: #e2e6e9; --line-strong: #c5ccd2; --bg: #f6f7f8; --card: #fff; --surface-2: #eef1f3;
    /* Estados: do template, nunca da cor da loja. */
    --ok: #1e7b45; --ok-bg: #e7f5ec; --warn: #8a5300; --warn-bg: #fff4e0; --danger: #b3261e; --danger-bg: #fdecea; --focus: #1a73e8;
    /* Marca: o /tema.css da loja sobrescreve --brand; os derivados ainda são fixos (o servidor passa a calculá-los na T2). */
    --brand: #1F6F4A; --brand-strong: #1F6F4A; --brand-soft: #f1f6f3; --brand-deep: #1d2327; --on-brand: #fff; --on-deep: #fff;
    /* Tipo */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --fs-sm: .85rem; --fs-h1: 1.5rem; --fs-h2: 1.15rem; --fs-h3: 1rem; --lh-base: 1.45;
    /* Forma */
    --r-sm: 4px; --r: 10px; --r-lg: 12px; --radius: var(--r-lg); --shadow: 0 1px 3px rgba(0,0,0,.08);
    --wrap: 760px; --gap-sm: .4rem; --gap: .8rem; --tap: 44px;

    font-family: var(--font-sans);
    color: var(--ink); background: var(--bg); line-height: var(--lh-base); -webkit-text-size-adjust: 100%;
  }
  /* O atributo hidden sempre vence: classes com display (ex.: .flash) anulavam o hidden. */
  [hidden] { display: none !important; }
  * { box-sizing: border-box; }
  body { margin: 0; }
  img { max-width: 100%; height: auto; }
  a { color: var(--brand); }
  h1 { font-size: var(--fs-h1); margin: .4rem 0 .6rem; }
  h2 { font-size: var(--fs-h2); margin: .2rem 0 .6rem; }
  h3 { font-size: var(--fs-h3); margin: 1rem 0 .4rem; }
  p { margin: .4rem 0; }
  small, .small { font-size: var(--fs-sm); }
  .muted { color: var(--muted); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  code { background: var(--surface-2); padding: .05rem .3rem; border-radius: var(--r-sm); word-break: break-all; }
  hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

  /* ----- formulários ----- */
  .field { display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; flex: 1; min-width: 0; }
  .field > span { font-weight: 600; font-size: .92rem; }
  input, select, textarea { font: inherit; padding: .65rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--card); color: var(--ink); min-height: var(--tap); width: 100%; }
  input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: var(--brand); margin: 0 .4rem 0 0; vertical-align: middle; }
  textarea { resize: vertical; }
  .check { display: flex; align-items: center; gap: .3rem; margin: .5rem 0; }
  fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; margin: .6rem 0; }
  legend { font-weight: 600; padding: 0 .3rem; }
  .choice label { display: flex; align-items: center; min-height: var(--tap); }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap); padding: .55rem 1rem; border-radius: var(--r);
    border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
  .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
  .btn.danger { color: var(--danger); border-color: var(--danger); }
  .btn.block, .block { display: flex; width: 100%; }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .link, button.link { background: none; border: 0; color: var(--brand); padding: .3rem; font: inherit; cursor: pointer; text-decoration: underline; min-height: 0; }
  .row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
  .row.space { justify-content: space-between; }
  .row.wrap { flex-wrap: wrap; }
  .grow { flex: 1; min-width: 0; }
  .stack > * + * { margin-top: .4rem; }
  .inline { display: inline; }
  .error { color: var(--danger); font-weight: 600; }
  .warn { color: var(--warn); }
  .flash { padding: .7rem 1rem; border-radius: var(--r); margin: .6rem 0; background: var(--surface-2); display: block; }
  .flash.ok { background: var(--ok-bg); color: var(--ok); }
  .flash.warn { background: var(--warn-bg); color: var(--warn); }
  .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin: .8rem 0; }
  .card.highlight { border: 2px solid var(--brand); }
  .card.danger { border: 2px solid var(--danger); }
  .card.subtle { background: transparent; box-shadow: none; border: 1px solid var(--line); }
  .card.narrow, .narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
  .badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 600; }
  .badge.big { font-size: 1rem; padding: .3rem .8rem; }
  .badge.warn { background: var(--warn-bg); color: var(--warn); }
  .badge.ok { background: var(--ok-bg); color: var(--ok); }
  .empty { text-align: center; color: var(--muted); }
  .prose p { margin: .6rem 0; }
  pre.prose { white-space: pre-wrap; font-family: inherit; }

  /* ----- vitrine (a largura vem do token --wrap: o Padrão mantém 760 px) ----- */
  body.store { background: var(--card); max-width: var(--wrap); margin: 0 auto; padding-bottom: 6rem; }
  .preview-bar { background: var(--warn-bg); color: var(--warn); text-align: center; padding: .4rem; font-size: .9rem; }
  .store-foot { margin: 2rem 0; color: var(--muted); font-size: .9rem; }
  .cart-lines { list-style: none; padding: 0; margin: 0 0 .6rem; }
  .cart-lines li { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .cart-lines li small { display: block; color: var(--muted); }
  .cart-lines li .thumb { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: var(--r); background: var(--bg); }   /* #231 */
  .totals > div { display: flex; justify-content: space-between; padding: .2rem 0; }
  .totals .total, .total { font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .3rem; }
  .track { padding: 1rem; }
  .steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
  .steps li { padding: .5rem .8rem; border-left: 4px solid var(--line); color: var(--muted); }
  .steps li.done { border-color: var(--ok); color: var(--ink); }
  .steps li.current { border-color: var(--brand); color: var(--ink); font-weight: 700; background: var(--brand-soft); }
  .status-line { font-weight: 600; }
  .qr { display: block; margin: .6rem auto; image-rendering: pixelated; background: var(--card); }
  .thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
  .thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r); cursor: pointer; border: 1px solid var(--line); }
  .announce { margin: 0; padding: .55rem 1rem; background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: .9rem; text-align: center; }
  .contacts { display: flex; gap: .8rem; margin: .2rem 0 0; font-size: .9rem; }
  .contacts a { color: var(--brand); font-weight: 600; }
  .badge { border-radius: 6px; padding: 0 .4rem; font-size: .75rem; font-weight: 700; }
  .btn.small { min-height: 36px; padding: .3rem .7rem; font-size: var(--fs-sm); }
  .pre-line { white-space: pre-line; }
}
