/* San Remo Baby — tokens e peças comuns.
   Ideia: o enxoval bordado. Fundo de algodão, linha azul de bordado como cor de marca,
   o "ponto" (tracejado) só onde há um gesto pessoal da vendedora. */
:root {
  --algodao: #FBFBF9;
  --pano: #F1F2F0;
  --linha: var(--marca, #2F4A7A);
  --linha-clara: #E6EBF3;
  --rosa-cha: #F4DDD7;
  --tinta: #23262E;
  --tinta-2: #4B505A;
  --cinza: #7C818B;
  --borda: #E1E3E0;
  --ok: #1E8E4E;
  --zap: #1F9D55;
  --zap-escuro: #17803F;
  --erro: #B3261E;
  --erro-fundo: #FBEAE8;
  --aviso-fundo: #FFF4D6;

  --serif: 'Young Serif', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-foto: 14px;
  --r-ctrl: 10px;
  --r-folha: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--algodao);
  color: var(--tinta);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--linha); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--linha) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

.marca-nome { font-family: var(--serif); font-size: 1.25rem; letter-spacing: -0.01em; color: var(--linha); text-decoration: none; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--linha); background: var(--linha); color: #fff;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sec { background: transparent; color: var(--linha); }
.btn.sec:hover { background: var(--linha-clara); }
.btn.zap { background: var(--zap); border-color: var(--zap); }
.btn.zap:hover { background: var(--zap-escuro); }
.btn.perigo { background: transparent; color: var(--erro); border-color: color-mix(in srgb, var(--erro) 40%, transparent); }
.btn.pequeno { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.largo { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }

.link-btn { background: none; border: 0; padding: 4px; color: var(--linha); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Campos */
.campo { display: grid; gap: 6px; }
.campo > span { font-size: .85rem; font-weight: 600; color: var(--tinta-2); }
.campo small { color: var(--cinza); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-ctrl);
  border: 1.5px solid var(--borda); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--linha); }
textarea { min-height: 84px; resize: vertical; }

/* Folha (bottom sheet no celular, diálogo centralizado no computador) */
dialog.folha {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: var(--r-folha) var(--r-folha) 0 0; background: #fff; color: var(--tinta);
  box-shadow: 0 -8px 40px rgba(35, 38, 46, .18);
}
dialog.folha::backdrop { background: rgba(35, 38, 46, .42); }
dialog.folha[open] { animation: sobe .22s ease-out; display: flex; flex-direction: column; }
@media (min-width: 720px) {
  dialog.folha { margin: auto; border-radius: var(--r-folha); max-height: 88vh; }
}
@keyframes sobe { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.folha[open] { animation: none; } }
.folha-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--borda); }
.folha-topo h2 { font-size: 1.25rem; }
.folha-corpo { padding: 16px 20px; overflow: auto; flex: 1; }
.folha-pe { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borda); display: grid; gap: 10px; }
.fechar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--pano); cursor: pointer; display: grid; place-items: center; flex: none; }
.fechar svg { width: 18px; height: 18px; }

/* Aviso rápido */
.aviso-flutuante {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--tinta); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center;
}
.aviso-flutuante.ver { opacity: 1; }

.alerta { padding: 12px 14px; border-radius: var(--r-ctrl); background: var(--aviso-fundo); color: #5B4500; font-size: .92rem; }
.alerta.erro { background: var(--erro-fundo); color: var(--erro); }

.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Chips de variação */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 48px; min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--borda); background: #fff; font-weight: 600; font-size: .9rem;
}
.chip[aria-pressed=true] { border-color: var(--linha); background: var(--linha); color: #fff; }
.chip:disabled, .chip.indisp { color: var(--cinza); background: var(--pano); border-style: dashed; cursor: not-allowed; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--cinza) 70%, transparent); }

.qtd { display: inline-flex; align-items: center; border: 1.5px solid var(--borda); border-radius: 999px; background: #fff; }
.qtd button { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; color: var(--linha); }
.qtd button:disabled { color: var(--borda); cursor: default; }
.qtd output { min-width: 28px; text-align: center; font-weight: 700; }
