/* ==========================================================================
   Base, reset, tipografia e utilitários genéricos.
   Nada aqui é específico de componente ou de página.
   ========================================================================== */

/* --- Reset -------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altura-topo) + var(--e-6));
}

body {
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video,
canvas { display: block; max-width: 100%; height: auto; }

/* `min-width: 0` não é enfeite de reset: um <input> tem largura intrínseca de
   cerca de 20 caracteres, e dentro de grid ou flex essa largura vira um PISO
   que a coluna não consegue furar. Ao aumentar a tipografia do painel, os
   campos ficaram mais largos e empurraram a grade dos lotes 98px para fora do
   cartão. Deixar o campo encolher resolve a família inteira do problema. */
button,
input,
select,
textarea { font: inherit; color: inherit; min-width: 0; }

button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

/* --- Tipografia --------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 1.2rem + 2.1vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: .9rem; }

p { text-wrap: pretty; }

strong, b { font-weight: 700; }

small { font-size: .82rem; }

/* --- [hidden] tem que vencer --------------------------------------------
   O atributo `hidden` só esconde por causa de `[hidden]{display:none}` na
   folha de estilo do navegador, que tem especificidade praticamente zero.
   Qualquer regra de classe com `display` a derrota, e foi assim que o modal
   de acesso e o drawer do carrinho apareceram abertos ao carregar a home,
   mesmo com hidden="true" no HTML.

   Como `hidden` é usado aqui para abrir e fechar camadas, ele precisa ser
   inegociável. Daí o !important: é a exceção que evita a regra silenciosa.
   ------------------------------------------------------------------------ */

[hidden] { display: none !important; }

/* --- Foco: visível sempre, obrigatório ---------------------------------- */

:focus-visible {
  outline: 3px solid var(--ciano);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

:focus:not(:focus-visible) { outline: none; }

/* --- Seleção ------------------------------------------------------------ */

::selection {
  background: var(--rosa);
  color: var(--branco);
}

/* --- Layout ------------------------------------------------------------- */

.container {
  width: min(var(--largura-max), calc(100% - var(--e-8)));
  margin-inline: auto;
}

.container-estreito {
  width: min(860px, calc(100% - var(--e-8)));
  margin-inline: auto;
}

@media (max-width: 560px) {
  .container,
  .container-estreito { width: calc(100% - var(--e-6)); }
}

/* --- Utilitários -------------------------------------------------------- */

.visualmente-oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pular-para-conteudo {
  position: absolute;
  top: var(--e-2);
  left: var(--e-2);
  z-index: 999;
  padding: var(--e-3) var(--e-5);
  background: var(--navy);
  color: var(--branco);
  font-weight: 700;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--transicao);
}

.pular-para-conteudo:focus { transform: translateY(0); }

.texto-suave  { color: var(--suave); }
.texto-rosa   { color: var(--rosa); }
.texto-ciano  { color: var(--ciano); }
.texto-centro { text-align: center; }

.fundo-suave  { background: var(--fundo-suave); }
.fundo-escuro { background: var(--navy); color: var(--branco); }

.sem-quebra { white-space: nowrap; }

/* Barra de rolagem discreta, consistente entre navegadores. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--linha) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--linha);
  border-radius: var(--r-full);
  border: 3px solid var(--branco);
}
