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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: var(--t-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--fonte-titulo); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
p { margin: 0 0 var(--e3); }
a { color: var(--acento); }
small { font-size: var(--t-xs); }

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--marrom-700); outline-offset: 2px; }

/* ---------- Estrutura ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--e3);
  padding: var(--e3) var(--e4);
  padding-top: max(var(--e3), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bege-100) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borda);
}
.topo .marca { font-family: var(--fonte-titulo); font-size: var(--t-md); }
.topo .marca span { color: var(--texto-fraco); font-size: var(--t-xs); display: block; font-family: var(--fonte); }
.topo .espaco { flex: 1; }

main {
  flex: 1;
  width: 100%;
  max-width: var(--larg-max);
  margin: 0 auto;
  padding: var(--e4);
  padding-bottom: calc(var(--e7) + 56px);
}

/* Navegacao inferior no celular */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--superficie);
  border-top: 1px solid var(--borda);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--toque); padding: var(--e2) 0;
  font-size: var(--t-xs); color: var(--texto-fraco); text-decoration: none;
}
.nav a .icone { font-size: 1.05rem; line-height: 1; }
.nav a[aria-current='page'] { color: var(--acento); background: var(--bege-200); }
.nav .so-desktop { display: none; }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .nav {
    position: sticky; top: 0; bottom: auto; left: auto; right: auto;
    height: 100vh; width: 220px; flex: 0 0 220px;
    grid-auto-flow: row; grid-auto-columns: auto; align-content: start;
    gap: 2px; padding: var(--e4) var(--e2);
    border-top: none; border-right: 1px solid var(--borda);
    background: var(--bege-50);
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: var(--e3); padding: var(--e3); border-radius: var(--r); font-size: var(--t-base); }
  .nav a[aria-current='page'] { background: var(--bege-300); }
  .nav .so-desktop { display: block; padding: 0 var(--e3) var(--e4); font-family: var(--fonte-titulo); font-size: var(--t-md); }
  .nav .so-desktop span { display: block; font-family: var(--fonte); font-size: var(--t-xs); color: var(--texto-fraco); }
  .coluna { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  main { padding: var(--e6) var(--e5); padding-bottom: var(--e7); }
  .topo { display: none; }
}

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

/* Itens da navegacao que aparecem so no celular ou so no desktop */
.nav .so-desktop-item { display: none; }
@media (min-width: 900px) {
  .nav .so-celular { display: none; }
  .nav .so-desktop-item { display: flex; }
}
