/* =============================================================
   CARONA DE LICITAÇÕES — estilos da página
   Complementa styles-brand.css (tokens, .container, .section,
   .tag, .btn, navbar, dropdown, footer). Aqui só o que é do
   catálogo. Nenhum seletor do design system é redefinido.
   ============================================================= */

/* ---- utilitários que faltam no styles-brand.css ---- */
.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;
}
.section--tight { padding: 60px 0; }
.icon-badge {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: rgba(255,200,0,0.1); border: 1px solid rgba(255,200,0,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark); flex-shrink: 0;
}
.icon-badge svg { width: 22px; height: 22px; }
.wrap-any { overflow-wrap: anywhere; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold-dark); outline-offset: 2px; border-radius: 4px;
}

/* espaço para a barra de solicitação não cobrir o último card */
body.tem-cesta { padding-bottom: 96px; }
@media (max-width: 700px) { body.tem-cesta { padding-bottom: 152px; } }

/* =============================================================
   HERO
   ============================================================= */
.ca-hero { background: var(--navy-dark); padding: 122px 0 56px; position: relative; overflow: hidden; }
.ca-hero::after {
  content: ''; position: absolute; top: -160px; right: -120px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255,200,0,0.1) 0%, transparent 70%); pointer-events: none;
}
.ca-hero .container { position: relative; z-index: 1; }
.ca-hero__head { max-width: 640px; }
.ca-hero h1 {
  font-family: var(--sora); font-size: clamp(28px, 3.6vw, 41px); font-weight: 800;
  line-height: 1.16; letter-spacing: -0.015em; color: var(--white);
}
.ca-hero h1 em { color: var(--gold); font-style: normal; }
.ca-hero p { font-size: 16.5px; color: rgba(255,255,255,0.66); margin-top: 16px; line-height: 1.65; }
.ca-hero p strong { color: var(--white); font-weight: 600; }

.ca-stats { display: flex; margin-top: 44px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 28px; flex-wrap: wrap; }
.ca-stat { padding-right: 44px; margin-right: 44px; border-right: 1px solid rgba(255,255,255,0.1); }
.ca-stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.ca-stat__n {
  font-family: var(--sora); font-size: 30px; font-weight: 800; color: var(--gold);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.ca-stat__l {
  font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 7px;
  letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
}

/* =============================================================
   BARRA DE FILTROS (sticky sob a navbar flutuante)
   ============================================================= */
.ca-main { background: var(--gray-light); padding: 0 0 88px; min-height: 60vh; }
.ca-bar {
  position: sticky; top: 92px; z-index: 40;
  background: rgba(244,245,247,0.93); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-mid); padding: 18px 0 16px; margin-bottom: 34px;
}
.ca-bar__row { display: flex; align-items: center; gap: 18px; }
.ca-search { position: relative; flex: 0 0 340px; }
.ca-search svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted); pointer-events: none;
}
.ca-search input {
  width: 100%; padding: 12px 16px 12px 42px; border: 1.5px solid var(--gray-mid);
  border-radius: 999px; font-size: 14.5px; font-family: inherit; color: var(--navy);
  background: var(--white); transition: border-color 0.2s;
}
.ca-search input:focus { outline: none; border-color: var(--gold); }
.ca-search input::placeholder { color: #9AA3B0; }

/* FILTROS EM DROPDOWN (Categoria, Esfera, Ordenar)
   `flex-wrap` e nunca `overflow-x` neste container: overflow em pai de
   elemento posicionado RECORTA o painel aberto — a fileira rolável das
   antigas chips cortaria o dropdown pela metade. Faltando espaço, os
   botões descem para a segunda linha. */
.ca-filtros { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 0; min-width: 0; }
.ca-drop { position: relative; }
.ca-drop__b {
  display: inline-flex; align-items: center; gap: 7px; max-width: 240px;
  padding: 9px 13px 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--gray-mid); background: var(--white);
  font-family: var(--sora); font-size: 13px; font-weight: 600; color: #4A5666;
  white-space: nowrap; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ca-drop__b > span { overflow: hidden; text-overflow: ellipsis; }
.ca-drop__b:hover { border-color: #C3CAD4; color: var(--navy); }
.ca-drop__b.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.ca-drop__b[aria-expanded="true"] { border-color: var(--gold); }
.ca-drop__ch { width: 15px; height: 15px; flex-shrink: 0; transition: transform 0.18s; }
.ca-drop__b[aria-expanded="true"] .ca-drop__ch { transform: rotate(180deg); }

/* z-index acima do card (que sobe no hover) e da barra sticky */
.ca-drop__p {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: min(272px, calc(100vw - 36px));
  background: var(--white); border: 1px solid var(--gray-mid);
  border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(0,0,0,0.14);
  padding: 6px;
}
/* último botão da fileira: painel ancorado à direita para não vazar da tela */
.ca-drop:last-child .ca-drop__p { left: auto; right: 0; }
.ca-drop__busca { padding: 6px 6px 8px; }
.ca-drop__busca input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-mid);
  border-radius: 8px; font-family: inherit; font-size: 13.5px;
  color: var(--navy); background: var(--gray-light);
}
.ca-drop__busca input:focus { outline: none; border-color: var(--gold); background: var(--white); }
.ca-drop__lista { max-height: 258px; overflow-y: auto; }
.ca-drop__opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: #4A5666;
}
/* a regra de classe acima ganha do `[hidden] { display: none }` do
   navegador: sem esta linha, a opção descartada pela busca continuaria
   na tela — o `hidden` do JS não teria efeito nenhum */
.ca-drop__opt[hidden] { display: none; }
.ca-drop__opt:hover { background: var(--gray-light); color: var(--navy); }
.ca-drop__opt input {
  width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--gold);
}
.ca-drop__opt:has(input:checked) { color: var(--navy); font-weight: 600; }
.ca-drop__nada { padding: 10px; font-size: 13px; color: var(--text-muted); }
.ca-drop__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 6px; padding: 8px 6px 2px; border-top: 1px solid var(--gray-mid);
}
.ca-drop__lnk {
  padding: 4px 6px; background: none; border: none; cursor: pointer;
  font-family: var(--sora); font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.ca-drop__lnk:hover { color: var(--navy); }
.ca-drop__lnk--forte { color: var(--navy); }
.ca-cont {
  flex-shrink: 0; font-size: 13px; color: var(--text-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ca-cont b { color: var(--navy); font-weight: 700; }

/* =============================================================
   AVISO (item saiu da cesta porque a ata venceu)
   ============================================================= */
.ca-aviso {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,200,0,0.09); border: 1px solid rgba(255,200,0,0.3);
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 26px;
}
.ca-aviso svg { width: 19px; height: 19px; color: var(--gold-dark); flex-shrink: 0; margin-top: 2px; }
.ca-aviso p { font-size: 13.5px; color: #4A5666; line-height: 1.6; }
.ca-aviso b { color: var(--navy); font-weight: 700; }

/* =============================================================
   GRID E CARD DE PRODUTO
   ============================================================= */
.ca-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.ca-card {
  background: var(--white); border: 1px solid var(--gray-mid); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
  box-shadow: 0 6px 24px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.ca-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.08); transform: translateY(-3px); }
.ca-card.is-sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,200,0,0.16), 0 6px 24px rgba(0,0,0,0.04);
}

/* Moldura QUADRADA e fixa para toda foto de produto.
   Dois detalhes que nao sao decorativos:

   1. `flex: 0 0 auto` — o card e um flex column e a linha do grid pode
      ficar mais alta que o conteudo; sem isto o flex esmaga a moldura e
      as fotos saem com alturas diferentes entre si.

   2. `position: absolute` no img — com `height: 100%` num pai de altura
      automatica, a altura percentual cria DEPENDENCIA CICLICA: o CSS
      resolve o 100% para `auto`, a imagem assume a altura intrinseca e o
      `aspect-ratio` do pai e ignorado. Era esse o bug em que uma foto
      400x1400 renderizava 1216px de altura e empurrava o texto do card.
      O img absoluto nao contribui para a altura do pai, entao o
      aspect-ratio volta a mandar. */
.ca-card__ph { position: relative; aspect-ratio: 1/1; background: var(--navy-dark); flex: 0 0 auto; }
.ca-card__ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ca-card__cat {
  position: absolute; top: 12px; left: 12px;
  background: rgba(33,28,48,0.86); color: rgba(255,255,255,0.94);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px; backdrop-filter: blur(4px);
}
.ca-card__vig { position: absolute; bottom: 12px; right: 12px; }

.ca-card__body { padding: 19px 20px 0; flex: 1; display: flex; flex-direction: column; }
.ca-card__obj {
  font-family: var(--sora); font-size: 14.5px; font-weight: 700; color: var(--navy);
  line-height: 1.45; letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(3 * 1.45 * 14.5px);
}
.ca-ficha { margin: 15px 0 18px; border-top: 1px solid var(--gray-mid); }
.ca-ficha__r {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--gray-mid); font-size: 12.5px;
}
.ca-ficha__r:last-child { border-bottom: none; }
.ca-ficha__k { color: var(--text-muted); flex-shrink: 0; }
.ca-ficha__v { color: var(--navy); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.ca-card__foot { padding: 16px 20px 18px; background: var(--gray-light); border-top: 1px solid var(--gray-mid); }
.ca-card__pr { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ca-card__val {
  font-family: var(--sora); font-size: 23px; font-weight: 800; color: var(--navy);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.ca-card__val span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ca-card__saldo {
  font-size: 11.5px; color: var(--text-muted); text-align: right;
  line-height: 1.45; font-variant-numeric: tabular-nums;
}
.ca-card__saldo b { display: block; color: var(--navy); font-size: 13px; font-weight: 700; }
.ca-card__act { display: flex; align-items: center; gap: 10px; }
.ca-card__add { flex: 1; padding: 11px 16px; font-size: 13.5px; }
.ca-card__add.is-in { background: var(--navy); color: var(--white); cursor: default; }
.ca-card__add.is-in:hover { background: var(--navy); transform: none; }
.ca-card__sub {
  font-size: 12px; font-weight: 700; color: var(--gold-dark); text-align: center;
  margin-top: 10px; font-variant-numeric: tabular-nums;
}

/* =============================================================
   STEPPER
   ============================================================= */
.stp {
  display: inline-flex; align-items: center; border: 1.5px solid var(--gray-mid);
  border-radius: 999px; background: var(--white); overflow: hidden;
}
.stp__b {
  width: 34px; height: 34px; flex-shrink: 0; border: none; background: none; cursor: pointer;
  font-family: var(--sora); font-size: 17px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.stp__b:hover:not(:disabled) { background: var(--gray-light); color: var(--gold-dark); }
.stp__b:disabled { color: var(--gray-mid); cursor: not-allowed; }
.stp__i {
  width: 52px; height: 34px; border: none;
  border-left: 1px solid var(--gray-mid); border-right: 1px solid var(--gray-mid);
  text-align: center; font-family: var(--sora); font-size: 14px; font-weight: 700;
  color: var(--navy); background: none; font-variant-numeric: tabular-nums;
}
.stp__i:focus { outline: none; background: rgba(255,200,0,0.08); }

/* =============================================================
   BADGE DE VIGÊNCIA
   ============================================================= */
.vig {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.vig::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.vig--ok  { color: #4A5666; background: var(--gray-light); border: 1px solid var(--gray-mid); }
.vig--med { color: var(--gold-dark); background: rgba(255,200,0,0.12); border: 1px solid rgba(255,200,0,0.3); }
.vig--urg { color: #A4341A; background: rgba(196,58,30,0.09); border: 1px solid rgba(196,58,30,0.24); }

/* =============================================================
   CARREGANDO / ERRO / VAZIO
   ============================================================= */
.ca-skel { background: var(--white); border: 1px solid var(--gray-mid); border-radius: var(--radius); overflow: hidden; }
/* tem que casar com .ca-card__ph, senao a pagina salta quando os cards chegam */
.ca-skel__ph { aspect-ratio: 1/1; background: var(--gray-mid); }
.ca-skel__b { padding: 19px 20px 24px; }
.ca-skel__l { height: 12px; border-radius: 999px; background: var(--gray-mid); margin-bottom: 10px; }
.ca-skel__l:nth-child(2) { width: 82%; }
.ca-skel__l:nth-child(3) { width: 54%; }
.ca-skel, .ca-skel__ph, .ca-skel__l { animation: ca-pulso 1.4s ease-in-out infinite; }
@keyframes ca-pulso { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .ca-skel, .ca-skel__ph, .ca-skel__l { animation: none; }
}

.vazio {
  text-align: center; padding: 72px 24px; background: var(--white);
  border: 1px solid var(--gray-mid); border-radius: var(--radius);
}
.vazio .icon-badge { margin: 0 auto 20px; width: 52px; height: 52px; }
.vazio__t { font-family: var(--sora); font-size: 19px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.vazio__d { font-size: 14.5px; color: var(--text-muted); max-width: 440px; margin: 0 auto 24px; line-height: 1.65; }
.vazio__row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =============================================================
   BARRA DE SOLICITAÇÃO (cesta)
   ============================================================= */
.cesta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--navy-dark); border-top: 1px solid rgba(255,200,0,0.28);
  box-shadow: 0 -12px 34px rgba(33,28,48,0.28);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.cesta.is-on { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .cesta { transition: none; } }
.cesta__in {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cesta__sum { flex: 1; min-width: 210px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cesta__k {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
}
.cesta__n {
  font-family: var(--sora); font-size: 14.5px; font-weight: 600;
  color: rgba(255,255,255,0.86); font-variant-numeric: tabular-nums;
}
.cesta__tot {
  font-family: var(--sora); font-size: 21px; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.cesta__tot small {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,200,0,0.6);
}
.cesta__acts { display: flex; align-items: center; gap: 12px; }
.cesta__clear {
  background: none; border: none; cursor: pointer; font-family: var(--sora);
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.5);
  text-decoration: underline; text-underline-offset: 3px; padding: 8px;
}
.cesta__clear:hover { color: var(--white); }
.cesta__go { background: #25D366; color: #06331A; }
.cesta__go:hover { background: #3FE07B; }
.cesta__go svg { width: 19px; height: 19px; fill: currentColor; }

/* =============================================================
   RESPONSIVO
   ============================================================= */
@media (max-width: 1000px) {
  .ca-grid { grid-template-columns: repeat(2, 1fr); }
  .ca-bar__row { flex-wrap: wrap; }
  .ca-search { flex: 1 1 100%; }
  .ca-cont { order: 3; }
}
@media (max-width: 700px) {
  .cesta__in { padding: 12px 16px; gap: 12px; }
  .cesta__sum { min-width: 100%; }
  .cesta__acts { width: 100%; }
  .cesta__go { flex: 1; }
}
@media (max-width: 640px) {
  .ca-hero { padding: 108px 0 44px; }
  .ca-grid { grid-template-columns: 1fr; }
  .ca-bar { top: 78px; }
  .ca-stat { padding-right: 26px; margin-right: 26px; }
  .ca-stat__n { font-size: 25px; }
}

/* =============================================================
   IMPRESSÃO — órgão público imprime para anexar ao processo
   ============================================================= */
@media print {
  .navbar, .ca-bar, .cesta, .footer, .ca-card__act, .ca-hero::after { display: none !important; }
  body { background: #fff; padding-bottom: 0; }
  .ca-hero { background: #fff; padding: 0 0 24px; }
  .ca-hero h1, .ca-hero h1 em { color: #000; }
  .ca-hero p, .ca-stat__l { color: #333; }
  .ca-stat__n { color: #000; }
  .ca-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ca-card { break-inside: avoid; box-shadow: none; }
  .ca-card:hover { transform: none; }
}
