@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --vermelho: #bf0811;
  --vermelho-escuro: #8c060d;
  --vermelho-fundo: #fbebec;
  --preto: #1a1414;
  --texto: #2b2727;
  --texto-suave: #6b6464;
  --creme: #fffae3;
  --cinza-claro: #f0eeee;
  --cinza-borda: #e2dede;
  --branco: #ffffff;
  --sombra: 0 2px 10px rgba(28,24,24,.08);
  --sombra-forte: 0 8px 30px rgba(28,24,24,.18);
  --raio: 10px;
  --font-display: 'Oswald', sans-serif;
  --font-base: 'Inter', sans-serif;
  --barra-altura: 56px;
}
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0; font-family: var(--font-base); color: var(--texto);
  background: var(--cinza-claro); -webkit-font-smoothing: antialiased;
  padding-bottom: 86px;
}
img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor:pointer; }
a{ color: var(--vermelho); }

/* ---------- Topbar ---------- */
.topbar{
  position: sticky; top:0; z-index: 40; background: var(--preto);
  color:#fff; display:flex; align-items:center; gap:10px;
  padding: 10px 14px; height: var(--barra-altura);
}
.topbar img.logo{ height: 30px; width:auto; }
.topbar .titulo{ font-family: var(--font-display); font-weight:600; font-size: 14px; letter-spacing:.03em; line-height:1.15; }
.topbar .titulo small{ display:block; font-family: var(--font-base); font-weight:400; font-size:11px; color:#cfc7c7; }
.topbar .contagem{ margin-left:auto; font-size:12px; background: var(--vermelho); padding:5px 10px; border-radius: 100px; font-weight:600; white-space:nowrap; }

/* ---------- Hero ---------- */
.hero{ background: var(--preto); color:#fff; padding: 6px 16px 18px; text-align:center; }
.hero .evento{ font-family: var(--font-display); font-size: clamp(22px, 6vw, 30px); font-weight:700; letter-spacing:.02em; margin:0 0 6px; }
.hero .datas{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; font-size:13px; }
.hero .datas span{ background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18); border-radius:100px; padding:5px 12px; }
.hero .datas b{ color:#fff; }
.btn-pdf-catalogo{
  display:inline-flex; align-items:center; gap:7px;
  background: var(--vermelho); color:#fff; text-decoration:none;
  font-size:13.5px; font-weight:700;
  padding:9px 16px; border-radius:100px;
  margin:2px 0 12px;
}
.btn-pdf-catalogo:active{ background: var(--vermelho-escuro); }

/* ---------- Controles ---------- */
.controles{
  position: sticky; top: var(--barra-altura); z-index:30; background:#fff;
  border-bottom:1px solid var(--cinza-borda); box-shadow: var(--sombra);
  padding:10px 12px; display:flex; flex-direction:column; gap:8px;
}
.segmentado{ display:flex; background: var(--cinza-claro); border-radius:100px; padding:3px; gap:3px; }
.segmentado button{ flex:1; border:none; background:transparent; padding:8px 6px; border-radius:100px; font-family: var(--font-display); font-size:13px; font-weight:600; letter-spacing:.02em; color: var(--texto-suave); transition:.15s; }
.segmentado button.ativo{ background: var(--vermelho); color:#fff; box-shadow: var(--sombra); }
.linha-busca{ display:flex; gap:8px; }
.busca-wrap{ flex:1; position:relative; }
.busca-wrap input{ width:100%; padding:10px 12px 10px 34px; border:1px solid var(--cinza-borda); border-radius: var(--raio); font-size:14px; font-family: inherit; background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6464' stroke-width='2'><circle cx='6.5' cy='6.5' r='5'/><line x1='10.2' y1='10.2' x2='15' y2='15'/></svg>") no-repeat 10px center; }
.btn-filtro{ border:1px solid var(--cinza-borda); background:#fff; border-radius: var(--raio); padding:10px 12px; font-size:13px; font-weight:600; display:flex; align-items:center; gap:6px; white-space:nowrap; }
.btn-filtro .bolinha{ background: var(--vermelho); color:#fff; border-radius:100px; font-size:11px; min-width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; padding:0 4px; }

.chips-ativos{ display:flex; gap:6px; flex-wrap:wrap; padding: 0 12px; }
.chips-ativos:empty{ display:none; }
.chip{ background: var(--vermelho-fundo); color: var(--vermelho-escuro); border:1px solid #f0d3d6; border-radius:100px; font-size:12px; font-weight:600; padding:5px 8px 5px 10px; display:inline-flex; align-items:center; gap:6px; }
.chip button{ border:none; background:transparent; color:inherit; font-size:14px; line-height:1; padding:0; }
.chip.limpar{ background: var(--preto); color:#fff; border-color: var(--preto); }

.resultado-info{ padding:12px 14px 0; font-size:13px; color: var(--texto-suave); }
.resultado-info b{ color: var(--texto); }

/* ---------- Grid ---------- */
.grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap:12px; padding:10px 12px 20px; }
@media (min-width: 640px){ .grid{ grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px){ .grid{ grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px){ .grid{ grid-template-columns: repeat(5, 1fr); } }

.card{ background:#fff; border-radius: var(--raio); overflow:hidden; box-shadow: var(--sombra); display:flex; flex-direction:column; position:relative; transition: transform .12s; }
.card:active{ transform: scale(.98); }
.card .foto-wrap{ position:relative; aspect-ratio: 4/3; background: var(--cinza-claro); overflow:hidden; }
.card .foto-wrap img{ width:100%; height:100%; object-fit:contain; }

/* Número do lote — faixa separada acima da foto, com bastante destaque */
.card .lote-tag-bar{
  margin:0;
  background: var(--vermelho);
  color:#fff;
  font-family: var(--font-display);
  font-weight:700;
  font-size:23px;
  line-height:1;
  padding:11px 12px;
  display:flex;
  align-items:baseline;
  gap:7px;
  letter-spacing:.02em;
}
.card .lote-tag-bar small{ font-size:10.5px; font-family: var(--font-base); font-weight:600; letter-spacing:.06em; text-transform:uppercase; opacity:.85; }

.card .fav{ position:absolute; top:6px; right:6px; width:30px; height:30px; background: rgba(255,255,255,.92); border:none; border-radius:100px; display:flex; align-items:center; justify-content:center; box-shadow: var(--sombra); }
.card .fav svg{ width:16px; height:16px; stroke:var(--vermelho); fill:none; stroke-width:2; }
.card .fav.ativo svg{ fill: var(--vermelho); }

/* Selos no card */
.card .selos-card{ position:absolute; bottom:5px; left:5px; display:flex; gap:5px; flex-wrap:wrap; max-width:calc(100% - 10px); }
.card .selos-card img{ width:36px; height:36px; object-fit:contain; background:#fff; border-radius:50%; padding:3px; box-shadow:0 1px 4px rgba(0,0,0,.35); }

.card .corpo{ padding:9px 10px 11px; display:flex; flex-direction:column; gap:4px; flex:1; }
.card .nome{ font-family: var(--font-display); font-weight:700; font-size:15px; line-height:1.2; color: var(--texto); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card .tat{ font-size:11px; color: var(--texto-suave); }
.card .badges{ display:flex; gap:4px; flex-wrap:wrap; margin-top:2px; }
.card .badge{ font-size:10px; font-weight:600; background: var(--cinza-claro); color: var(--texto-suave); padding:2px 6px; border-radius:4px; }
.card .badge.status-prenhe{ background:#eaf3ea; color:#2f6b35; }
.card .badge.status-parida{ background:#e9eef7; color:#2d4f8f; }
.card .badge.status-vazia{ background:#f5efe2; color:#8a6a26; }
.card .metrica{ font-size:11px; color: var(--texto-suave); margin-top:auto; padding-top:4px; }
.card .metrica b{ color: var(--texto); }

.sem-resultado{ grid-column: 1 / -1; text-align:center; padding: 50px 20px; color: var(--texto-suave); font-size:14px; }
.sem-resultado button{ margin-top:10px; background:var(--vermelho); color:#fff; border:none; padding:9px 16px; border-radius:100px; font-weight:600; font-size:13px; }

/* ---------- FAB ---------- */
.fab-lista{ position:fixed; right:16px; bottom:16px; z-index:35; background: var(--vermelho); color:#fff; border:none; border-radius:100px; padding:13px 18px; font-weight:700; font-size:14px; box-shadow: var(--sombra-forte); display:flex; align-items:center; gap:8px; transform: translateY(120%); transition: transform .25s ease; }
.fab-lista.visivel{ transform: translateY(0); }
.fab-lista .n{ background:#fff; color: var(--vermelho); border-radius:100px; min-width:20px; height:20px; display:flex; align-items:center; justify-content:center; font-size:12px; padding:0 5px; }

/* ---------- Overlay / Painel ---------- */
.overlay{ position:fixed; inset:0; z-index:50; background: rgba(20,16,16,.5); display:none; }
.overlay.aberto{ display:block; }
.painel{ position:absolute; right:0; top:0; bottom:0; width:100%; max-width:430px; background:#fff; display:flex; flex-direction:column; box-shadow: -8px 0 30px rgba(0,0,0,.25); animation: entra-direita .22s ease; }
@keyframes entra-direita{ from{ transform:translateX(100%);} to{ transform:translateX(0);} }
.painel.de-baixo{ top:auto; left:0; right:0; max-width:none; max-height: 88vh; border-radius: 18px 18px 0 0; animation: entra-baixo .22s ease; }
@keyframes entra-baixo{ from{ transform:translateY(100%);} to{ transform:translateY(0);} }

.painel-cabecalho{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--cinza-borda); }
.painel-cabecalho h2{ font-family: var(--font-display); font-size:17px; margin:0; font-weight:600; }
.painel-cabecalho .fechar{ border:none; background: var(--cinza-claro); width:32px; height:32px; border-radius:100px; font-size:16px; line-height:1; color:var(--texto); }
.painel-corpo{ padding: 4px 16px 16px; overflow-y:auto; flex:1; }
.painel-rodape{ padding:12px 16px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--cinza-borda); display:flex; gap:10px; }

.grupo-filtro{ padding:14px 0; border-bottom:1px solid var(--cinza-borda); }
.grupo-filtro:last-child{ border-bottom:none; }
.grupo-filtro h3{ font-size:12px; text-transform:uppercase; letter-spacing:.06em; color: var(--texto-suave); margin:0 0 10px; font-weight:700; }
.grupo-filtro h4{ font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--vermelho-escuro); margin:8px 0 6px; font-weight:700; }
.opcoes-chip{ display:flex; flex-wrap:wrap; gap:7px; }
.opcao-chip{ border:1px solid var(--cinza-borda); background:#fff; padding:7px 12px; border-radius:100px; font-size:12.5px; font-weight:600; color: var(--texto); }
.opcao-chip.sel{ background: var(--vermelho); border-color: var(--vermelho); color:#fff; }
.linha-range{ display:flex; align-items:center; gap:10px; font-size:13px; }
.linha-range input[type=range]{ flex:1; accent-color: var(--vermelho); }
.linha-range .valor{ font-weight:700; min-width:64px; text-align:right; font-variant-numeric: tabular-nums; }
select{ width:100%; padding:10px 12px; border:1px solid var(--cinza-borda); border-radius: var(--raio); font-size:14px; font-family:inherit; background:#fff; }
.grupo-filtro input[type="text"]{ width:100%; padding:10px 12px; border:1px solid var(--cinza-borda); border-radius: var(--raio); font-size:14px; font-family:inherit; background:#fff; }
.toggle-linha{ display:flex; align-items:center; justify-content:space-between; padding:9px 0; font-size:13.5px; font-weight:600; }
.btn-primario{ flex:1; background: var(--vermelho); color:#fff; border:none; padding:13px; border-radius: var(--raio); font-weight:700; font-size:14px; }
.btn-secundario{ flex:1; background:#fff; color: var(--texto); border:1px solid var(--cinza-borda); padding:13px; border-radius: var(--raio); font-weight:700; font-size:14px; }
.btn-outline-vermelho{ background:#fff; color:var(--vermelho); border:1.5px solid var(--vermelho); padding:12px; border-radius:var(--raio); font-weight:700; font-size:13.5px; }

/* ---------- Selos no painel filtros ---------- */
.opcoes-chip-selo{ display:flex; flex-wrap:wrap; gap:10px; }
.opcao-selo{ border:2px solid transparent; border-radius:8px; padding:4px; cursor:pointer; background:transparent; transition:.12s; }
.opcao-selo img{ width:60px; height:60px; object-fit:contain; }
.opcao-selo.sel{ border-color: var(--vermelho); background: var(--vermelho-fundo); }

/* Filtro DEP — grid de seletores TOP% */
.dep-grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.dep-item label{ font-size:11.5px; font-weight:600; color:var(--texto); display:block; margin-bottom:3px; }
.dep-item select{ padding:7px 8px; font-size:12px; }

/* ---------- Lista selecionados ---------- */
.item-selecionado{ display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--cinza-borda); align-items:center; }
.item-selecionado img{ width:54px; height:54px; object-fit:cover; border-radius:6px; }
.item-selecionado .info{ flex:1; min-width:0; }
.item-selecionado .info .n{ font-weight:600; font-size:13px; }
.item-selecionado .info .t{ font-size:11.5px; color:var(--texto-suave); }
.item-selecionado .remover{ border:none; background:none; color:var(--texto-suave); font-size:18px; padding:6px; }
.lista-vazia{ text-align:center; padding:40px 10px; color:var(--texto-suave); font-size:13.5px; }

/* ---------- Detalhe ---------- */
.detalhe{ position:fixed; inset:0; z-index:60; background:#fff; display:none; flex-direction:column; overflow-y:auto; }
.detalhe.aberto{ display:flex; }
.detalhe-topo{ position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:10px; padding:12px 14px; background: rgba(28,24,24,.55); backdrop-filter: blur(4px); }
.detalhe-topo.solido{ background: var(--preto); }
.detalhe-topo button{ width:36px; height:36px; border-radius:100px; border:none; background: rgba(255,255,255,.92); display:flex; align-items:center; justify-content:center; }
.detalhe-topo .voltar svg{ width:18px; height:18px; }
.detalhe-topo .espaco{ flex:1; }
.detalhe-foto{ width:100%; aspect-ratio: 4/3; background:var(--preto); }
.detalhe-foto img{ width:100%; height:100%; object-fit:cover; }
.detalhe-conteudo{ padding:16px; }

/* Número do lote — destaque no detalhe */
.detalhe-faixa-lote{
  display:inline-flex; align-items:baseline; gap:6px;
  background: var(--vermelho); color:#fff;
  font-family: var(--font-display); font-weight:700;
  padding:5px 14px; border-radius:6px; margin-bottom:10px;
}
.detalhe-faixa-lote .lote-n{ font-size:22px; line-height:1; }
.detalhe-faixa-lote .lote-l{ font-size:12px; opacity:.85; }

.detalhe-nome{ font-family: var(--font-display); font-size: clamp(20px,5.5vw,26px); font-weight:700; margin:0 0 4px; line-height:1.15; }
.detalhe-sub{ color:var(--texto-suave); font-size:13px; margin-bottom:14px; }
.detalhe-badges{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.badge{ font-size:10px; font-weight:600; background: var(--cinza-claro); color: var(--texto-suave); padding:2px 8px; border-radius:4px; }
.badge.status-prenhe{ background:#eaf3ea; color:#2f6b35; }
.badge.status-parida{ background:#e9eef7; color:#2d4f8f; }
.badge.status-vazia{ background:#f5efe2; color:#8a6a26; }

/* Selos no detalhe — pills compactos lado a lado */
.selos-detalhe{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; align-items:center; }
.selos-detalhe .selo-item{ display:flex; align-items:center; justify-content:center; background:var(--cinza-claro); border-radius:16px; padding:10px; }
.selos-detalhe .selo-item img{ width:88px; height:88px; object-fit:contain; }

.detalhe-acoes{ display:flex; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
.btn-acao{ flex:1; min-width:150px; display:flex; align-items:center; justify-content:center; gap:8px; padding:13px; border-radius: var(--raio); font-weight:700; font-size:13.5px; border:none; text-decoration:none; }
.btn-acao svg{ width:17px; height:17px; }
.btn-acao.pdf{ background:#fff; color:var(--texto); border:1.5px solid var(--cinza-borda); }
.btn-acao.fav{ background: var(--cinza-claro); color:var(--texto); flex:0 0 auto; min-width:0; padding:13px 16px; }
.btn-acao.fav.ativo{ background: var(--vermelho-fundo); color: var(--vermelho-escuro); }

/* Vídeo embed — ocupa largura total, quebrando o padding do conteúdo */
.video-embed-wrap{ position:relative; width:calc(100% + 32px); margin-left:-16px; aspect-ratio:16/9; background:#000; margin-bottom:20px; overflow:hidden; }
.video-embed-wrap iframe{ position:absolute; top:0; left:0; width:100%; height:100%; border:0; }

.bloco{ margin-bottom:20px; }
.bloco h3{ font-family: var(--font-display); font-size:13px; text-transform:uppercase; letter-spacing:.06em; color: var(--vermelho-escuro); margin:0 0 10px; border-bottom:2px solid var(--vermelho-fundo); padding-bottom:6px; }
.grade-fatos{ display:grid; grid-template-columns: repeat(2,1fr); gap:10px; }
.fato{ background: var(--cinza-claro); border-radius:8px; padding:9px 10px; }
.fato .l{ font-size:10.5px; color:var(--texto-suave); text-transform:uppercase; letter-spacing:.04em; }
.fato .v{ font-size:14px; font-weight:700; margin-top:2px; }

.pedigree{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.pedigree .lado h4{ font-size:11px; text-transform:uppercase; color:var(--texto-suave); margin:0 0 6px; letter-spacing:.04em; }
.pedigree .geracao{ background:var(--cinza-claro); border-radius:8px; padding:8px 10px; margin-bottom:6px; font-size:12.5px; }
.pedigree .geracao.pai-mae{ background: var(--vermelho-fundo); color: var(--vermelho-escuro); font-weight:700; }
.pedigree .geracao .et{ display:block; font-size:9.5px; opacity:.75; text-transform:uppercase; letter-spacing:.04em; }
.link-pedigree{ border:none; background:none; padding:0; margin:0; font:inherit; font-weight:inherit; color:inherit; text-decoration:underline; text-underline-offset:3px; cursor:pointer; text-align:left; }

.tabela-genetica{ width:100%; border-collapse:collapse; font-size:12.5px; }
.tabela-genetica th{ text-align:left; font-size:10.5px; text-transform:uppercase; color:var(--texto-suave); padding:6px 8px; border-bottom:1px solid var(--cinza-borda); }
.tabela-genetica td{ padding:7px 8px; border-bottom:1px solid var(--cinza-borda); }
.tabela-genetica .deca-verde{ color:#1f7a38; font-weight:700; }
.tabela-genetica thead tr:first-child th{ background:var(--cinza-claro); font-size:11px; font-weight:700; letter-spacing:.03em; padding:7px 8px; color:var(--texto); }
.tabelas-wrap{ display:flex; flex-direction:column; gap:14px; }
.tabelas-wrap > div{ overflow-x:auto; border:1px solid var(--cinza-borda); border-radius:8px; }

/* Bloco PAD — diferenciado */
.bloco-pad{ background: var(--creme); border:1px solid #f0e8b0; border-radius:10px; padding:14px; margin-bottom:20px; }
.bloco-pad .pad-titulo{ font-family: var(--font-display); font-size:12px; text-transform:uppercase; letter-spacing:.07em; color:#7a6a20; margin:0 0 4px; font-weight:700; }
.bloco-pad .pad-subtitulo{ font-size:11.5px; color:#8a7430; margin:0 0 12px; font-style:italic; }
.bloco-pad .tabelas-wrap > div{ border-color:#e8dfa0; background:#fefdf5; }

.comentario{ background: var(--creme); border:1px solid #f3eccb; border-radius:8px; padding:14px; font-size:13.5px; line-height:1.65; white-space:pre-line; }
.comentario a{ font-weight:600; }

@media (min-width: 760px){
  .detalhe-conteudo{ max-width:760px; margin:0 auto; }
  .detalhe-foto{ max-width:760px; margin-left:auto; margin-right:auto; }
  .tabelas-wrap{ flex-direction:row; }
  .tabelas-wrap > div{ flex:1; }
  .dep-grid{ grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Toast ---------- */
.toast{ position:fixed; left:50%; bottom:90px; transform:translateX(-50%) translateY(20px); background: var(--preto); color:#fff; padding:11px 18px; border-radius:100px; font-size:13px; font-weight:600; z-index:80; opacity:0; transition:.2s; box-shadow: var(--sombra-forte); }
.toast.mostra{ opacity:1; transform:translateX(-50%) translateY(0); }

#printable{ position:fixed; left:-9999px; top:0; width:480px; background:#fff; }

/* ---------- Nota USBeef sem imagem (2 e 3) — mesma família visual do opcao-selo ---------- */
.opcao-selo.texto{ display:flex; flex-direction:column; align-items:center; justify-content:center; }
.opcao-selo.texto .num-nota{ width:60px; height:60px; display:flex; align-items:center; justify-content:center; background: var(--cinza-claro); border-radius:8px; font-family: var(--font-display); font-weight:700; font-size:26px; color: var(--texto-suave); }
.opcao-selo.texto.sel .num-nota{ background: var(--vermelho); color:#fff; }

/* ---------- Badges de avaliação (nota USBeef / quality beef) no card e no detalhe ---------- */
.badge.nota{ background:#eef1e8; color:#4a6b2a; }
.badge.all-profit{ background:#1c2f52; color:#fff; }
.badge.quality-se{ background: var(--vermelho-fundo); color: var(--vermelho-escuro); }
.badge.quality-ch{ background:#f5efe2; color:#8a6a26; }
.selo-dia{ height:18px; width:auto; display:inline-block; vertical-align:middle; border-radius:3px; }
.detalhe-badges .selo-dia{ height:22px; }

/* ---------- Rodapé de patrocinadores ---------- */
.rodape-patrocinadores{ padding: 22px 12px 30px; text-align:center; }
.rodape-patrocinadores img{ max-width:100%; height:auto; margin:0 auto; }
