/* Filtros das listagens (animes, filmes, generos) */
.flt{margin:0 0 1.5rem;display:flex;flex-direction:column;gap:.875rem}
.flt__top{display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-width:0}

/* Ordenar por: pilulas */
.flt__sort{display:flex;gap:.375rem;padding:.35rem;border-radius:1rem;background:var(--wrapper-color);min-width:0;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.flt__sort::-webkit-scrollbar{display:none}
.flt__pill{flex:0 0 auto;position:relative;cursor:pointer}
.flt__pill input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.flt__pill span{display:flex;align-items:center;height:2.5rem;padding:0 1.1rem;border-radius:.75rem;font-size:.875rem;font-weight:600;white-space:nowrap;color:rgba(var(--text-color-rgb),.55);transition:color .2s,background .2s}
.flt__pill:hover span{color:var(--text-color)}
.flt__pill input:checked+span{background:var(--light-color);color:var(--text-color);box-shadow:inset 0 -2px 0 var(--primary-color)}
.flt__pill input:focus-visible+span{outline:2px solid var(--primary-color);outline-offset:-2px}

/* Botao "Filtros" (so no celular) */
.flt__toggle{display:none;align-items:center;gap:.5rem;flex:0 0 auto;height:2.75rem;padding:0 1rem;border-radius:.875rem;background:var(--wrapper-color);color:var(--text-color);font-size:.875rem;font-weight:600;cursor:pointer;border:1px solid rgba(var(--text-color-rgb),.14)}
.flt__toggle[aria-expanded="true"]{border-color:rgba(var(--primary-color-rgb),.6);background:rgba(var(--primary-color-rgb),.12)}
.flt__badge{display:inline-grid;place-items:center;min-width:1.25rem;height:1.25rem;padding:0 .3rem;border-radius:99px;background:var(--primary-color);color:#fff;font-size:.6875rem;font-weight:700}

/* Painel de filtros */
.flt__panel{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.75rem;padding:.875rem;border-radius:1rem;background:var(--wrapper-color)}
.flt__field{display:flex;flex-direction:column;gap:.35rem;min-width:0;flex:1 1 11rem;max-width:16rem}
.flt__field>span{font-size:.6875rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:rgba(var(--text-color-rgb),.55)}
.flt__field select{appearance:none;-webkit-appearance:none;width:100%;height:2.75rem;padding:0 2.25rem 0 .875rem;border-radius:.75rem;border:1px solid transparent;background:var(--light-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center/1rem;color:var(--text-color);font-size:.875rem;font-weight:500;cursor:pointer;transition:border-color .2s,background-color .2s}
.flt__field select:hover{border-color:rgba(var(--primary-color-rgb),.5)}
.flt__field select:focus-visible{outline:2px solid var(--primary-color);outline-offset:1px}
.flt__field select option{background:var(--light-color);color:var(--text-color)}
.flt__actions{display:flex;align-items:center;gap:.75rem;margin-left:auto}
.flt__apply{height:2.75rem;padding:0 1.25rem;border-radius:.75rem;background:var(--primary-color);color:#fff;font-size:.875rem;font-weight:700;cursor:pointer}
.flt__apply:hover{filter:brightness(1.1)}
.flt__clear{font-size:.875rem;font-weight:600;color:rgba(var(--text-color-rgb),.7);text-decoration:underline;text-underline-offset:3px}
.flt__clear:hover{color:var(--text-color)}

/* Total + filtros ativos */
.flt__meta{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.flt__count{font-size:.875rem;font-weight:600;color:rgba(var(--text-color-rgb),.7);margin-right:.25rem}
.flt__chip{display:inline-flex;align-items:center;gap:.5rem;height:2rem;padding:0 .5rem 0 .875rem;border-radius:99px;background:rgba(var(--primary-color-rgb),.16);border:1px solid rgba(var(--primary-color-rgb),.45);color:var(--text-color);font-size:.8125rem;font-weight:600;transition:background .2s}
.flt__chip i{font-style:normal;display:grid;place-items:center;width:1.25rem;height:1.25rem;border-radius:50%;background:rgba(255,255,255,.14);line-height:1;font-size:.9375rem}
.flt__chip:hover{background:rgba(var(--primary-color-rgb),.3)}
.flt__chip--clear{background:transparent;border-color:rgba(var(--text-color-rgb),.2);color:rgba(var(--text-color-rgb),.75);padding:0 .875rem}

/* Celular: painel recolhido atras do botao "Filtros" */
@media (max-width:767px){
  .flt--js .flt__toggle{display:inline-flex}
  .flt--js .flt__panel{display:none}
  .flt--js.is-open .flt__panel{display:flex;flex-direction:column;align-items:stretch}
  .flt--js.is-open .flt__field{max-width:none;flex-basis:auto}
  .flt__actions{margin-left:0;justify-content:space-between}
  .flt__apply{flex:1}
  .flt__pill span{height:2.75rem}
  /* ordenacao em uma linha so, rolando de lado (esmaece a ponta); botao Filtros embaixo */
  .flt__top{flex-direction:column;align-items:stretch}
  .flt__sort{padding-right:2.5rem;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 2.5rem),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 2.5rem),transparent)}
  .flt--js .flt__toggle{justify-content:center}
  /* sem JS: painel sempre aberto em coluna */
  .flt:not(.flt--js) .flt__panel{flex-direction:column;align-items:stretch}
  .flt:not(.flt--js) .flt__field{max-width:none;flex-basis:auto}
}
/* Com JS o botao "Aplicar" some no desktop (aplica ao escolher) */
@media (min-width:768px){ .flt--js .flt__apply{display:none} }
.flt.is-loading{opacity:.6;pointer-events:none;transition:opacity .2s}

.flt__empty{margin:0;padding:1rem 1.25rem;border-radius:1rem;background:var(--wrapper-color);font-size:.9375rem;color:rgba(var(--text-color-rgb),.8)}
.flt__empty a{color:var(--primary-color);font-weight:700;text-decoration:underline}
