/* ============================================================================
   IGAMINGSUP — SUP Design System · Componentes
   Convenção BEM: .bloco, .bloco__elemento, .bloco--modificador
   ========================================================================= */

/* ============================================================================
   BOTÃO
   ========================================================================= */

.btn {
  --btn-h: 40px;
  --btn-px: var(--space-5);
  --btn-fs: var(--text-sm);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-h);
  padding-inline: var(--btn-px);
  font-family: var(--font-text);
  font-size: var(--btn-fs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  position: relative;
  isolation: isolate;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn__icon { flex-shrink: 0; width: 1.15em; height: 1.15em; }

/* ─── Variantes ──────────────────────────────────────────────────────── */

.btn--primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-1);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-glow);
}

/* O botão da marca. Reservado ao CTA principal de cada tela: usado duas
   vezes na mesma vista, nenhum dos dois é principal. */
.btn--gradient {
  background: var(--brand-gradient);
  color: #fff;
  /* 170% de largura com a janela centrada em 45%: um botão estreito mostra
     o miolo azul→violeta do arco em repouso, e o hover ainda tem para onde
     deslizar. Ancorado em 0% ele exibia só a faixa azul e o botão parecia
     um primário comum. */
  background-size: 170% 100%;
  background-position: 45% 0%;
  box-shadow: var(--shadow-2);
  transition: background-position var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn--gradient:hover:not(:disabled) {
  background-position: 100% 0%;
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(139, 44, 255, 0.5),
              0 4px 12px -4px rgba(37, 99, 255, 0.4);
}

.btn--secondary {
  background: var(--surface-3);
  color: var(--text-strong);
  border-color: var(--border);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.btn--outline {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn--outline:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text-strong);
}

.btn--soft {
  background: var(--primary-soft);
  color: var(--primary);
}
.btn--soft:hover:not(:disabled) {
  background: var(--primary-soft-hover);
  color: var(--primary);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }

/* ─── Tamanhos ───────────────────────────────────────────────────────── */
.btn--sm { --btn-h: 32px; --btn-px: var(--space-3); --btn-fs: var(--text-xs); border-radius: var(--radius-sm); }
.btn--lg { --btn-h: 48px; --btn-px: var(--space-6); --btn-fs: var(--text-md); border-radius: var(--radius-lg); }
.btn--xl { --btn-h: 56px; --btn-px: var(--space-8); --btn-fs: var(--text-md); border-radius: var(--radius-lg); }

.btn--icon { --btn-px: 0; width: var(--btn-h); }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--radius-full); }

/* Estado de carregamento: o rótulo some mas o botão mantém a largura,
   senão o layout salta no meio da interação. */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1em; height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--primary-contrast);
  animation: spin 640ms linear infinite;
}
.btn--secondary.is-loading::after,
.btn--outline.is-loading::after,
.btn--ghost.is-loading::after { color: var(--text-strong); }

/* ============================================================================
   CAMPOS DE FORMULÁRIO
   ========================================================================= */

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}

.field__label .req { color: var(--danger); margin-left: 2px; }

.field__hint  { font-size: var(--text-xs); color: var(--text-subtle); }
.field__error { font-size: var(--text-xs); color: var(--danger); font-weight: var(--weight-medium); }

.input,
.textarea,
.select {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.input::placeholder,
.textarea::placeholder { color: var(--text-subtle); }

.input:hover:not(:disabled),
.textarea:hover:not(:disabled),
.select:hover:not(:disabled) { border-color: var(--border-strong); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input:disabled,
.textarea:disabled,
.select:disabled { opacity: 0.55; cursor: not-allowed; }

.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--danger);
}
.input[aria-invalid='true']:focus,
.textarea[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.textarea { min-height: 110px; resize: vertical; }

.select {
  appearance: none;
  padding-right: var(--space-8);
  cursor: pointer;
  /* Seta desenhada em SVG inline: sem requisição extra e herda a cor do
     tema pelo stroke, coisa que uma imagem estática não faria. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236F7CA3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
}

.input--sm, .select--sm { min-height: 32px; font-size: var(--text-sm); padding-block: var(--space-1); }
.input--lg { min-height: 48px; font-size: var(--text-md); }

/* Campo com ícone/afixo. O grupo controla a borda; o input interno fica
   transparente, senão dois cantos arredondados brigam entre si. */
.input-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-group .input {
  border: none;
  background: transparent;
  padding-inline: 0;
  box-shadow: none;
}
.input-group .input:focus { box-shadow: none; background: transparent; }

.input-group__icon {
  flex-shrink: 0;
  color: var(--text-subtle);
  width: 18px; height: 18px;
}

/* ─── Checkbox e radio ───────────────────────────────────────────────── */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-muted);
  user-select: none;
  padding-block: var(--space-1);
}

.check:hover { color: var(--text-strong); }

.check__box {
  flex-shrink: 0;
  appearance: none;
  width: 18px; height: 18px;
  margin: 1px 0 0;
  background: var(--surface-inset);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.check__box::after {
  content: '';
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-spring);
  background: var(--primary-contrast);
  clip-path: polygon(14% 45%, 0 60%, 39% 100%, 100% 22%, 85% 8%, 38% 71%);
}

.check__box:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check__box:checked::after { transform: scale(1); }

.check__box:indeterminate {
  background: var(--primary);
  border-color: var(--primary);
}
.check__box:indeterminate::after {
  transform: scale(1);
  clip-path: none;
  height: 2px;
  border-radius: 1px;
}

.check__box[type='radio'] { border-radius: 50%; }
.check__box[type='radio']::after { border-radius: 50%; clip-path: none; width: 8px; height: 8px; }

.check__count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

/* ─── Switch ─────────────────────────────────────────────────────────── */
.switch {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 42px; height: 24px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}

.switch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  translate: 0 -50%;
  width: 18px; height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: translate var(--dur-base) var(--ease-spring),
              background-color var(--dur-base) var(--ease-out);
}

.switch:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.switch:checked::after {
  translate: 18px -50%;
  background: #fff;
}

/* ─── Segmentado ─────────────────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.segmented__item {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.segmented__item:hover { color: var(--text-strong); }

.segmented__item[aria-selected='true'],
.segmented__item.is-active {
  background: var(--surface-3);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
}

/* ============================================================================
   CARD
   ========================================================================= */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.card--flush { padding: 0; overflow: hidden; }
.card--lg { padding: var(--space-8); border-radius: var(--radius-xl); }
.card--inset { background: var(--surface-inset); box-shadow: none; }

/* Card clicável: sobe 2px e ganha um fio da marca no topo. O deslocamento
   é pequeno de propósito — num grid de 60 cards, hover exagerado vira ruído. */
.card--interactive { cursor: pointer; }

.card--interactive::before {
  content: '';
  position: absolute;
  inset-inline: -1px;
  top: -1px;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.card--interactive:hover,
.card--interactive:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
}

.card--interactive:hover::before,
.card--interactive:focus-within::before { opacity: 1; }

/* Superfície de vidro. Só sobre fundo com gradiente — sobre cor chapada o
   blur não tem o que borrar e o custo de composição sai de graça. */
.card--glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-color: var(--border-strong);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}

.card__body { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-normal); }

.card__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Link que cobre o card inteiro. Mantém um único alvo no leitor de tela em
   vez de repetir "leia mais" — e deixa botões internos acessíveis por
   z-index acima dele. */
.card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}

.card__actions { position: relative; z-index: 2; }

/* ============================================================================
   LOGO TILE — a marca do supplier no diretório
   ========================================================================= */

.logo-tile {
  --tile: 52px;
  flex-shrink: 0;
  width: var(--tile);
  height: var(--tile);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-subtle);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: calc(var(--tile) * 0.36);
  letter-spacing: -0.03em;
}

.logo-tile img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 14%;
}

.logo-tile--sm { --tile: 36px; border-radius: var(--radius-sm); }
.logo-tile--lg { --tile: 72px; border-radius: var(--radius-lg); }
.logo-tile--xl { --tile: 104px; border-radius: var(--radius-xl); }

/* Fundo neutro claro para logo colorido que sumiria sobre o navy. */
.logo-tile--plate { background: #fff; border-color: rgba(11,16,38,0.12); }

/* ============================================================================
   ESTRELAS E RATING
   ========================================================================= */

.stars {
  --star-size: 16px;
  --star-fill: 0%;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  width: calc(var(--star-size) * 5 + 2px * 4);
  height: var(--star-size);
  vertical-align: -2px;
}

/* Duas camadas: trilho vazio e preenchimento cortado por largura. Permite
   meia estrela real (4.3 mostra 86%), coisa que ícone por ícone não faz. */
.stars::before,
.stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: calc(var(--star-size) + 2px) var(--star-size);
  -webkit-mask-image: var(--star-mask);
  mask-image: var(--star-mask);
  -webkit-mask-size: calc(var(--star-size) + 2px) var(--star-size);
  mask-size: calc(var(--star-size) + 2px) var(--star-size);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

.stars {
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16' viewBox='0 0 18 16'%3E%3Cpath d='M8 .6l2.06 4.36 4.69.63-3.44 3.3.87 4.75L8 11.35 3.82 13.64l.87-4.75L1.25 5.59l4.69-.63z'/%3E%3C/svg%3E");
}

.stars::before { background-color: var(--border-strong); }
.stars::after  { background-color: var(--gold-500); width: var(--star-fill); }

.stars--sm { --star-size: 13px; }
.stars--lg { --star-size: 22px; }
.stars--xl { --star-size: 30px; }

.rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.rating__value {
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

.rating__count { color: var(--text-subtle); font-size: var(--text-xs); }

.rating--hero { gap: var(--space-3); }
.rating--hero .rating__value { font-size: var(--text-3xl); line-height: 1; }

/* Distribuição 5→1 do perfil. */
.rating-bars { display: grid; gap: var(--space-2); }

.rating-bar {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.rating-bar__track {
  height: 7px;
  background: var(--surface-inset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rating-bar__fill {
  height: 100%;
  /* calc(x * 1%) e não var(--pct) direto: o JS grava o número puro ("62"),
     e "width: 62" é inválido — a barra simplesmente não aparecia. Mesma
     convenção do .ring-meter, que já fazia certo. */
  width: calc(var(--pct, 0) * 1%);
  background: var(--gold-500);
  border-radius: inherit;
  transition: width var(--dur-slower) var(--ease-out);
}

.rating-bar__count { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================================
   BADGE, CHIP E TAG
   ========================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  line-height: 1.4;
}

.badge--primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge--accent  { background: var(--accent-soft);  color: var(--accent);  border-color: transparent; }
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }

/* Badge de mérito da Matrix: fio de gradiente da marca. Reservado ao que é
   conquistado por dado, nunca ao que é comprado. */
.badge--merit {
  background: var(--surface-2);
  color: var(--text-strong);
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--surface-2), var(--surface-2)),
    var(--brand-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.badge__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Selo de verificação — o sinal de confiança do produto. */
.verified {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.verified__icon { width: 15px; height: 15px; flex-shrink: 0; }

/* Rótulo de posicionamento pago. Discreto mas sempre presente: escondê-lo
   destruiria a credibilidade que é o produto. */
.sponsored-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-subtle);
  background: var(--surface-inset);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xs);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
}

a.chip:hover, button.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.chip--active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.chip__remove {
  display: grid;
  place-items: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.6;
  flex-shrink: 0;
}
.chip__remove:hover { opacity: 1; background: var(--border-strong); }

/* ============================================================================
   MEDIDOR E PROGRESSO
   ========================================================================= */

.meter {
  height: 8px;
  background: var(--surface-inset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  background: var(--brand-gradient-soft);
  border-radius: inherit;
  transition: width var(--dur-slower) var(--ease-out);
}

.meter--success .meter__fill { background: var(--success); }
.meter--warning .meter__fill { background: var(--warning); }
.meter--danger  .meter__fill { background: var(--danger); }
.meter--sm { height: 5px; }
.meter--lg { height: 12px; }

/* Anel de completude do perfil. conic-gradient em vez de SVG: um elemento,
   sem viewBox para acertar, e anima só a custom property. */
.ring-meter {
  --pct: 0;
  --ring-size: 64px;
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--surface-inset) 0);
}

.ring-meter::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface);
}

.ring-meter__value {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   STAT TILE
   ========================================================================= */

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-extra);
  line-height: var(--leading-none);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  font-weight: var(--weight-semibold);
}

.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.stat__delta--up   { color: var(--success); }
.stat__delta--down { color: var(--danger); }

.stat--gradient .stat__value {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

/* ============================================================================
   TABS
   ========================================================================= */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs__item {
  position: relative;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.tabs__item:hover { color: var(--text-strong); }

.tabs__item[aria-selected='true'],
.tabs__item.is-active {
  color: var(--text-strong);
  border-bottom-color: var(--primary);
  font-weight: var(--weight-semibold);
}

.tabs__count {
  margin-left: var(--space-2);
  padding: 1px 6px;
  font-size: var(--text-2xs);
  background: var(--surface-3);
  border-radius: var(--radius-full);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.tabs--pill {
  border-bottom: none;
  gap: var(--space-2);
}
.tabs--pill .tabs__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 0;
  padding: var(--space-2) var(--space-4);
}
.tabs--pill .tabs__item[aria-selected='true'],
.tabs--pill .tabs__item.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================================
   ACCORDION — usado nas FAQ de categoria
   ========================================================================= */

.accordion { border-top: 1px solid var(--border); }

.accordion__item { border-bottom: 1px solid var(--border); }

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.accordion__trigger:hover { color: var(--primary); }

.accordion__icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--text-subtle);
  transition: transform var(--dur-base) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.accordion__trigger[aria-expanded='true'] .accordion__icon {
  transform: rotate(180deg);
  color: var(--primary);
}

/* grid-template-rows 0fr→1fr anima altura automática, coisa que
   height:auto não permite. O filho precisa de overflow:hidden. */
.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-out);
}

.accordion__panel > div { overflow: hidden; }

.accordion__trigger[aria-expanded='true'] + .accordion__panel {
  grid-template-rows: 1fr;
}

.accordion__content {
  padding-bottom: var(--space-5);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  max-width: var(--container-prose);
}

/* ============================================================================
   BREADCRUMB E PAGINAÇÃO
   ========================================================================= */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-subtle);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb__sep { opacity: 0.5; user-select: none; }
.breadcrumb [aria-current='page'] { color: var(--text-strong); font-weight: var(--weight-medium); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.pagination__item {
  min-width: 36px;
  height: 36px;
  padding-inline: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  transition: all var(--dur-fast) var(--ease-out);
}

.pagination__item:hover {
  background: var(--surface-3);
  color: var(--text-strong);
}

.pagination__item[aria-current='page'] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.pagination__item[aria-disabled='true'] { opacity: 0.4; pointer-events: none; }
.pagination__gap { color: var(--text-subtle); padding-inline: var(--space-1); }

/* ============================================================================
   TABELA
   ========================================================================= */

.table { font-size: var(--text-sm); }

.table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  vertical-align: middle;
}

.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }

.table--compare th:first-child { width: 180px; }
.table--compare td { text-align: center; }
.table--compare th:first-child,
.table--compare td:first-child {
  text-align: left;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
}

/* Vencedor da linha na comparação. Marcação explícita: a página existe
   para que a decisão fique óbvia. */
.table--compare .is-leader {
  background: var(--primary-soft);
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
}

.table--sticky th {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
}

/* ============================================================================
   ALERTA
   ========================================================================= */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  /* Barra lateral colorida em vez de fundo saturado: o alerta se destaca
     sem que o texto perca contraste. */
  border-left: 3px solid var(--text-subtle);
}

.alert__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.alert__title { font-weight: var(--weight-semibold); color: var(--text-strong); margin-bottom: 2px; }

.alert--info    { border-left-color: var(--info);    background: var(--info-soft); }
.alert--success { border-left-color: var(--success); background: var(--success-soft); }
.alert--warning { border-left-color: var(--warning); background: var(--warning-soft); }
.alert--danger  { border-left-color: var(--danger);  background: var(--danger-soft); }

.alert--info .alert__icon    { color: var(--info); }
.alert--success .alert__icon { color: var(--success); }
.alert--warning .alert__icon { color: var(--warning); }
.alert--danger .alert__icon  { color: var(--danger); }

/* ============================================================================
   ESTADO VAZIO E SKELETON
   ========================================================================= */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}

.empty__icon {
  width: 48px; height: 48px;
  color: var(--text-subtle);
  opacity: 0.6;
  margin-bottom: var(--space-2);
}

.empty__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.empty__text { max-width: 44ch; font-size: var(--text-sm); text-wrap: pretty; }

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-inset) 25%,
    var(--surface-3) 50%,
    var(--surface-inset) 75%
  );
  background-size: 300% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
  /* Sem cor herdada: o skeleton nunca deve mostrar texto real por baixo. */
  color: transparent;
  user-select: none;
  pointer-events: none;
}

.skeleton--text { height: 0.85em; margin-block: 0.2em; }
.skeleton--title { height: 1.4em; width: 55%; }
.skeleton--circle { border-radius: 50%; }
.skeleton--tile { height: 52px; width: 52px; border-radius: var(--radius-md); }

/* ============================================================================
   OVERLAY: MODAL, DRAWER, DROPDOWN, TOOLTIP, TOAST
   ========================================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--dur-base) var(--ease-out);
}

.modal__panel {
  width: min(100%, 560px);
  max-height: min(86vh, 800px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  animation: fade-up var(--dur-slow) var(--ease-out);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-4);
}

.modal__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text-strong); }
.modal__body { padding: 0 var(--space-6) var(--space-6); color: var(--text-muted); }

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.modal--lg .modal__panel { width: min(100%, 860px); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: var(--scrim);
  animation: fade-in var(--dur-base) var(--ease-out);
}

.drawer__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(100%, 400px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  overflow-y: auto;
  padding: var(--space-6);
  animation: drawer-in var(--dur-slow) var(--ease-out);
}

.drawer--left .drawer__panel {
  inset-inline: 0 auto;
  border-left: none;
  border-right: 1px solid var(--border);
  animation-name: drawer-in-left;
}

@keyframes drawer-in      { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-in-left { from { transform: translateX(-100%); } to { transform: none; } }

.dropdown { position: relative; }

.dropdown__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  inset-inline-start: 0;
  min-width: 200px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  z-index: var(--z-dropdown);
  animation: fade-up var(--dur-base) var(--ease-out);
}

.dropdown__menu--end { inset-inline: auto 0; }

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.dropdown__item:hover { background: var(--surface-3); color: var(--text-strong); }
.dropdown__item.is-active { background: var(--primary-soft); color: var(--primary); }
.dropdown__sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }

/* Tooltip por CSS. Sem JS e sem custo de layout; some no toque, onde
   hover não existe. */
.tooltip { position: relative; }

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  padding: var(--space-2) var(--space-3);
  background: var(--navy-950);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  max-width: 260px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
  z-index: var(--z-dropdown);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border-strong);
}

.tooltip:hover::after,
.tooltip:focus-visible::after { opacity: 1; }

@media (hover: none) {
  .tooltip::after { display: none; }
}

.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  inset-inline-end: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: min(92vw, 380px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  font-size: var(--text-sm);
  color: var(--text);
  animation: fade-up var(--dur-slow) var(--ease-out);
}

.toast--success { border-left: 3px solid var(--success); }
.toast--danger  { border-left: 3px solid var(--danger); }
.toast--info    { border-left: 3px solid var(--info); }

/* ============================================================================
   SPINNER
   ========================================================================= */

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 640ms linear infinite;
  flex-shrink: 0;
}

.spinner--lg { width: 32px; height: 32px; border-width: 3px; }

/* ============================================================================
   FACETAS DE FILTRO
   ========================================================================= */

.facet + .facet {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.facet__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-subtle);
  margin-bottom: var(--space-3);
}

.facet__list { display: flex; flex-direction: column; gap: var(--space-1); }

/* Lista longa de facetas rola dentro de si: uma categoria com 40 mercados
   não pode empurrar o resto do trilho para fora da tela. */
.facet__list--scroll {
  max-height: 220px;
  overflow-y: auto;
  padding-right: var(--space-2);
}

.facet__more {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--primary);
}

/* ============================================================================
   FAIXA DE LOGOS
   ========================================================================= */

.logo-strip {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  flex-wrap: wrap;
  justify-content: center;
}

.logo-strip img {
  height: 26px;
  width: auto;
  opacity: 0.55;
  filter: grayscale(1);
  transition: opacity var(--dur-base) var(--ease-out), filter var(--dur-base) var(--ease-out);
}

.logo-strip img:hover { opacity: 1; filter: none; }
