/* ============================================================================
   IGAMINGSUP — SUP Design System · Base
   Reset moderno, tipografia, primitivas de layout e utilitários.
   ========================================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa o header fixo quando o navegador salta para uma âncora. */
  scroll-padding-top: calc(var(--header-h) + var(--space-6));
  -moz-tab-size: 2;
  tab-size: 2;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Numeral proporcional no texto corrido, tabular só onde alinhamos coluna. */
  font-variant-numeric: normal;
  overflow-x: hidden;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

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

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

/* ─── Foco ─────────────────────────────────────────────────────────────
   :focus-visible em vez de :focus — o anel aparece para quem navega por
   teclado e não polui o clique de mouse. Nunca removido: sem ele o site
   fica inoperável no teclado. */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--primary-soft-hover);
  color: var(--text-strong);
}

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ============================================================================
   TIPOGRAFIA
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tighter); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-md); font-weight: var(--weight-semibold); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--primary-hover); }

strong, b { font-weight: var(--weight-semibold); color: var(--text-strong); }

small { font-size: var(--text-xs); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.15em 0.4em;
  color: var(--info);
}

pre {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  line-height: var(--leading-normal);
}

pre code { background: none; border: none; padding: 0; color: inherit; }

/* ─── Escala utilitária de texto ─────────────────────────────────────── */
.display-1 { font-family: var(--font-display); font-size: var(--text-6xl); font-weight: var(--weight-extra); line-height: var(--leading-none); letter-spacing: var(--tracking-tighter); }
.display-2 { font-family: var(--font-display); font-size: var(--text-5xl); font-weight: var(--weight-bold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tighter); }

.text-2xs  { font-size: var(--text-2xs); }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.fw-regular  { font-weight: var(--weight-regular); }
.fw-medium   { font-weight: var(--weight-medium); }
.fw-semibold { font-weight: var(--weight-semibold); }
.fw-bold     { font-weight: var(--weight-bold); }

.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-strong  { color: var(--text-strong); }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  font-weight: var(--weight-semibold);
}

/* Dígitos de largura fixa: sem isso, um contador que muda de 199 para 200
   empurra o layout lateralmente a cada atualização. */
.tabular { font-variant-numeric: tabular-nums; }

/* Texto com o gradiente da marca. O fallback de cor sólida vem antes do
   background-clip para o caso do clip não ser suportado — sem ele o texto
   sairia transparente e invisível. */
.gradient-text {
  color: var(--primary);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Descendentes precisam de pintura para o clip funcionar em todos os
     navegadores. */
  padding-bottom: 0.08em;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .gradient-text {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--primary);
  }
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Bloco de leitura: medida controlada e espaçamento entre elementos. */
.prose { max-width: var(--container-prose); }
.prose > * + * { margin-top: var(--space-4); }
.prose p { color: var(--text-muted); line-height: var(--leading-relaxed); text-wrap: pretty; }
.prose h2 { margin-top: var(--space-10); }
.prose h3 { margin-top: var(--space-8); }
.prose ul { list-style: disc; padding-left: var(--space-6); color: var(--text-muted); }
.prose ol { list-style: decimal; padding-left: var(--space-6); color: var(--text-muted); }
.prose li + li { margin-top: var(--space-2); }

/* ============================================================================
   LAYOUT
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide  { max-width: var(--container-wide); }
.container--prose { max-width: var(--container-prose); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }

.stack { display: flex; flex-direction: column; }
.stack-1 { gap: var(--space-1); } .stack-2 { gap: var(--space-2); }
.stack-3 { gap: var(--space-3); } .stack-4 { gap: var(--space-4); }
.stack-6 { gap: var(--space-6); } .stack-8 { gap: var(--space-8); }
.stack-12 { gap: var(--space-12); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.row--between { justify-content: space-between; }
.row--center  { justify-content: center; }
.row--end     { justify-content: flex-end; }
.row--top     { align-items: flex-start; }
.row--baseline{ align-items: baseline; }
.row--wrap    { flex-wrap: wrap; }

.grid { display: grid; gap: var(--space-5); }

/* auto-fit + minmax: as colunas se reorganizam pela largura real disponível,
   não por breakpoint fixo — o mesmo grid serve card de categoria e de
   supplier sem media query. */
.grid--auto   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--auto-sm{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid--auto-lg{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Diretório: conteúdo + trilho lateral de filtros/módulos. */
.grid--sidebar {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-8);
}

.grid--sidebar-left {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--space-8);
}

@media (max-width: 1024px) {
  .grid--sidebar,
  .grid--sidebar-left { grid-template-columns: minmax(0, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.flex-1 { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }

/* ─── Utilitários ────────────────────────────────────────────────────── */
.hidden { display: none !important; }
[hidden] { display: none !important; }

.relative { position: relative; }
.sticky-top { position: sticky; top: calc(var(--header-h) + var(--space-4)); }

.w-full { width: 100%; }
.mt-auto { margin-top: auto; }

.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); } .mb-8 { margin-bottom: var(--space-8); }
.mb-10{ margin-bottom: var(--space-10); }.mb-12{ margin-bottom: var(--space-12); }

/* Corta em N linhas com reticências. Usado em tagline de supplier e
   trecho de review, onde altura irregular quebra o alinhamento do grid. */
.clamp-1, .clamp-2, .clamp-3, .clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }

/* Visível só para leitor de tela. */
.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;
}

/* Link de pular para o conteúdo — primeiro tab da página. */
.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--primary-contrast);
}

/* Rola horizontalmente dentro do próprio bloco — tabela larga e faixa de
   cards nunca podem fazer o body rolar de lado. */
.scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

.divider--gradient {
  height: 1px;
  border: none;
  background: linear-gradient(90deg,
    transparent,
    var(--border-strong) 20%,
    var(--border-strong) 80%,
    transparent);
}

/* ============================================================================
   MOVIMENTO
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-in {
  animation: fade-up var(--dur-slower) var(--ease-out) both;
}

/* ─── Impressão ──────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}
