/* Listas (categoria e busca): filtros. Computador: painel na lateral; celular: folha "Filtrar" (assets/telas/lista.js).
   Usa os tokens do app.css (--azul, --linha, --sombra...). */

/* endereço com filtros: a grade só aparece já filtrada (sem piscar a lista inteira); se o JS falhar, aparece sozinha */
.g3l-filtrando [data-grade], .g3l-filtrando [data-fc-ativos] { visibility: hidden; animation: fc-mostra 0s 1.5s forwards; }
@keyframes fc-mostra { to { visibility: visible; } }

/* ---------------- barra: botão Filtrar ---------------- */
.ferr-filtrar { border: 0; font-family: inherit; color: var(--texto); cursor: pointer; }
.ferr-filtrar .i { width: 18px; height: 18px; color: var(--azul); }
.ferr-filtrar.is-on { box-shadow: inset 0 0 0 2px var(--azul); color: var(--azul); }
.ferr-qtd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--rosa-btn); color: #fff; font-size: 12px; line-height: 1; }
.ferr-qtd[hidden] { display: none; }
.tem-filtros .ferr-disp { display: none; } /* com painel, "Só disponíveis" mora nele (grupo "Mostrar apenas"), junto dos outros filtros */

/* ---------------- filtros aplicados (chips) ---------------- */
.fc-ativos { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; }
.fc-ativos[hidden] { display: none; }
.fc-chip { min-height: 36px; padding: 0 10px 0 14px; background: #E8F4FA; color: var(--azul); box-shadow: inset 0 0 0 1.5px #BFDCEB; cursor: pointer; }
.fc-chip .i { width: 16px; height: 16px; }
.fc-chip:hover { background: #D9EDF7; }
.fc-limpa { flex: none; min-height: 36px; padding: 0 6px; white-space: nowrap; cursor: pointer; }
@media (max-width: 899px) {
	.fc-ativos { overflow-x: auto; scrollbar-width: none; margin: -4px -14px 10px; padding: 2px 14px; overscroll-behavior-x: contain; }
	.fc-ativos::-webkit-scrollbar { display: none; }
}

/* ---------------- painel ---------------- */
.fc-lado { display: none; }
.fc-painel { font-size: 15px; }
.fc-grupo { border-top: 1px solid var(--linha); }
.fc-grupo:first-child { border-top: 0; }
.fc-grupo > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; list-style: none; cursor: pointer; font-weight: 700; color: var(--texto); }
.fc-grupo > summary::-webkit-details-marker { display: none; }
.fc-grupo > summary > span { flex: none; }
.fc-grupo > summary .i { flex: none; width: 18px; height: 18px; margin-left: auto; color: var(--suave); transition: transform .2s; }
.fc-grupo[open] > summary .i { transform: rotate(180deg); }
.fc-resumo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--azul); }
.fc-grupo[open] .fc-resumo { display: none; }
.fc-lista { margin: 0; padding: 0 0 12px; border: 0; min-width: 0; }
.fc-op { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; line-height: 1.25; }
.fc-op input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--azul); cursor: inherit; }
.fc-rot { flex: 1; min-width: 0; }
.fc-n { flex: none; color: var(--suave); font-size: 13px; font-variant-numeric: tabular-nums; }
.fc-op:has(input:checked) .fc-rot { font-weight: 700; color: var(--azul); }
.fc-op.is-zero { cursor: default; color: #8D99A6; } /* zerado: continua à vista (o painel não pula), só não dá para marcar */
.fc-op.is-zero .fc-n { color: #8D99A6; }
.fc-extra { display: none; }
.is-todos .fc-extra, .fc-extra:has(input:checked) { display: flex; }
.fc-mais { min-height: 40px; cursor: pointer; font-size: 14px; }
.fc-faixa { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.fc-faixa label { flex: 1; min-width: 0; display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--suave); }
.fc-faixa input { width: 100%; min-height: 42px; padding: 0 10px; border: 1.5px solid var(--borda-campo); border-radius: var(--r-s); background: #fff; font: 16px var(--fonte); color: var(--texto); }
.fc-ir { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 99px; background: var(--azul); color: #fff; cursor: pointer; }
.fc-ir .i { width: 18px; height: 18px; }
.fc-ir:hover { background: var(--azul-esc); }

/* sem resultado */
.fc-vazio { margin: 8px 0 24px; padding: 28px 18px; border-radius: var(--r); background: #fff; box-shadow: var(--sombra); }
.fc-vazio p { margin: 0; color: var(--suave); }
.fc-vazio b { color: var(--texto); }
.fc-vazio[hidden] { display: none; }

/* ---------------- folha (celular) ---------------- */
.folha-filtros { height: 88dvh; }
.folha-filtros .folha-corpo { padding-top: 4px; padding-bottom: 16px; }
.folha-filtros .fc-op { min-height: 44px; }
.fc-rodape { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--seguro)); border-top: 1px solid var(--linha); background: #fff; }
.fc-limpar { flex: none; background: #fff; color: var(--azul); box-shadow: inset 0 0 0 1.5px var(--linha); cursor: pointer; }
.fc-ver { flex: 1; cursor: pointer; }
.fc-ver b { font-variant-numeric: tabular-nums; }
@media (min-width: 600px) and (max-width: 899px) { .folha-filtros { height: min(88dvh, 760px); } }

/* ---------------- computador: lateral ---------------- */
@media (min-width: 900px) {
	.lista-corpo.tem-filtros { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 24px; align-items: start; }
	.tem-filtros .fc-lado { display: block; position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 4px 16px 8px; border-radius: 16px; background: #fff; box-shadow: var(--sombra); scrollbar-width: thin; }
	.admin-bar .tem-filtros .fc-lado { top: 156px; max-height: calc(100vh - 172px); }
	.fc-titulo { margin: 0; padding: 14px 0 4px; font-size: 18px; color: var(--azul); }
	.tem-filtros .ferr-filtrar { display: none; }
	.tem-filtros .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.fc-op:hover .fc-rot { text-decoration: underline; text-underline-offset: 3px; }
	.fc-op.is-zero:hover .fc-rot { text-decoration: none; }
}
@media (min-width: 1200px) { .tem-filtros .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .tem-filtros .grade { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) { .fc-grupo > summary .i { transition: none; } }

/* card escondido pelo filtro: o .pc tem display: grid, que vencia o [hidden] do navegador (o "Só disponíveis" antigo nem escondia) */
[data-grade] > .pc[hidden] { display: none; }
/* listas longas (Combo Atacado: 110 cards): o navegador só faz layout/pintura dos cards perto da tela; filtrar fica leve */
[data-grade] > .pc { content-visibility: auto; contain-intrinsic-size: auto 300px; }

/* textos da categoria (G3L_Categorias): topo curto sob o título; texto + perguntas frequentes depois da grade */
.tela-cab:has(.tela-intro) { align-items: flex-start; }
.tela-cab:has(.tela-intro) .voltar { margin-top: 2px; }
.tela-intro { margin: 6px 0 0; max-width: 72ch; font-size: 14px; line-height: 1.5; color: var(--suave); }
.tela-intro a { color: var(--azul-link); }
@media (max-width: 599px) { .tela-intro { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } } /* celular: no máximo 3 linhas antes dos produtos */
.cat-seo { display: grid; gap: 20px; margin: 36px 0 8px; padding: 20px 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--sombra); }
.cat-seo h2 { font-size: 21px; color: var(--azul); margin-bottom: 10px; }
.cat-seo-txt { color: #3C4C5B; font-size: 15px; line-height: 1.65; }
.cat-seo-txt p, .cat-seo-txt ul { margin: 0 0 12px; }
.cat-seo-txt > :last-child { margin-bottom: 0; }
.cat-seo-txt h3 { font-size: 17px; color: var(--texto); margin: 16px 0 6px; }
.cat-seo-txt a, .cat-faq details a { color: var(--azul-link); text-underline-offset: 2px; }
.cat-faq h2 { margin-bottom: 4px; }
.cat-faq details { border-bottom: 1px solid var(--linha); }
.cat-faq details:first-of-type { border-top: 1px solid var(--linha); }
.cat-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; font-weight: 700; font-size: 15.5px; color: var(--texto); cursor: pointer; list-style: none; }
.cat-faq summary::-webkit-details-marker { display: none; }
.cat-faq summary .i { width: 20px; height: 20px; color: var(--azul2); transition: transform .2s; }
.cat-faq details[open] summary .i { transform: rotate(180deg); }
.cat-faq summary:hover { color: var(--azul); }
.cat-faq details > div { padding: 0 0 14px; color: #3C4C5B; font-size: 15px; line-height: 1.6; }
.cat-faq details p { margin: 0; }
@media (min-width: 900px) {
	.cat-seo { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; padding: 28px 32px; margin-top: 48px; }
	.cat-seo > :only-child { grid-column: 1 / -1; max-width: 820px; }
	.tela-intro { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .cat-faq summary .i { transition: none; } }
