/* Tokens e base — compartilhados pelo site e pelo painel. */
:root {
  --cru: #efe8da;
  --cru-claro: #f8f4ec;
  --cru-fundo: #e5dbc6;
  --borda: #d5c9b1;
  --borda-forte: #b9ab8f;

  --tinta: #2e2159;
  --tinta-forte: #1c1438;
  --tinta-suave: #e4dff0;
  --texto: #231d31;
  --texto-2: #5f5770;

  --linha: #c2412d;
  --ok: #2f7556;
  --atencao: #9a6110;
  --erro: #b3352b;

  --f-display: 'Young Serif', Georgia, serif;
  --f-texto: 'Hanken Grotesk', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;

  --sombra-1: 0 1px 2px rgba(35, 29, 49, .08), 0 2px 6px rgba(35, 29, 49, .06);
  --sombra-2: 0 2px 4px rgba(35, 29, 49, .06), 0 12px 32px rgba(35, 29, 49, .14);

  --rapido: 150ms;
  --normal: 260ms;
  --saida: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` sempre esconde, mesmo em componente que define o próprio display */
[hidden] { display: none !important; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cru);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 1rem;
  line-height: 1.55;
  /* nada que voa pela tela (sacola da abertura) pode criar rolagem para o lado; clip não quebra o sticky */
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.01em;
  color: var(--tinta-forte);
  text-wrap: balance;
  margin: 0;
}

p, li { text-wrap: pretty; }

a { color: var(--tinta); }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--tinta);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r-s);
  z-index: 100;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.marca-nome { font-family: var(--f-display); font-size: 1.5rem; line-height: 1; display: grid; }
.marca-nome small {
  font-family: var(--f-texto);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--texto-2);
  margin-top: 3px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-m);
  border: 1px solid var(--borda-forte);
  background: var(--cru-claro);
  color: var(--texto);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition-property: transform, background-color, border-color, box-shadow;
  transition-duration: var(--rapido);
  transition-timing-function: ease-out;
}
.btn:hover { border-color: var(--tinta); }
.btn:active { transform: scale(.97); }
.btn-principal {
  background: var(--tinta);
  border-color: var(--tinta);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.btn-principal:hover { background: var(--tinta-forte); }
.btn-largo { width: 100%; }
.btn-perigo { color: var(--erro); }
.btn-perigo:hover { border-color: var(--erro); }

.btn-icone {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
  border: 0;
  background: transparent;
  color: var(--texto-2);
  cursor: pointer;
  transition: background-color var(--rapido) ease-out, color var(--rapido) ease-out;
}
.btn-icone:hover { background: var(--cru-fundo); color: var(--texto); }

.link {
  border: 0; background: none; padding: 0;
  color: var(--tinta); text-decoration: underline; cursor: pointer;
}

/* Campos */
.campo { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo-rotulo {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--texto-2);
  padding: 0;
}
.campo-valor { text-transform: none; letter-spacing: 0; color: var(--texto); font-weight: 500; }
.campo input:not([type='checkbox']), .campo select, .campo textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--r-s);
  background: #fffdf8;
  transition: border-color var(--rapido) ease-out, box-shadow var(--rapido) ease-out;
}
.campo textarea { min-height: 88px; resize: vertical; }
.campo input:not([type='checkbox']):focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--tinta);
  box-shadow: 0 0 0 3px var(--tinta-suave);
}

/* Seletores de opção (modelo, estampa) e amostras de tecido */
.segmentos { display: flex; flex-wrap: wrap; gap: 6px; }
.segmentos button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--borda-forte);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition-property: background-color, color, border-color, transform;
  transition-duration: var(--rapido);
}
.segmentos button:hover { border-color: var(--tinta); }
.segmentos button:active { transform: scale(.97); }
.segmentos button[aria-checked='true'] { background: var(--tinta); border-color: var(--tinta); color: #fff; }

.amostras { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.amostras button, .amostra-livre, .tinta {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18);
  background: var(--c);
  cursor: pointer;
  transition: transform var(--rapido) ease-out, box-shadow var(--rapido) ease-out;
}
.amostras button:hover, .tinta:hover { transform: translateY(-2px); }
.amostras button[aria-checked='true'], .tinta[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--cru-claro), 0 0 0 5px var(--tinta); }
.amostra-livre {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: conic-gradient(#b3352b, #9a6110, #2f7556, #1f2c4a, #2e2159, #b3352b);
}
.amostra-livre input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .88em; }

/* A agulha so' aparece enquanto a costura esta' sendo feita */
.bag-agulha { opacity: 0; }

dialog { color: inherit; }
dialog::backdrop { background: rgba(28, 20, 56, .38); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
