/* =========================================================
   AniLog — фильтр по жанрам: дропдаун с чипами
   ========================================================= */

/* ---------- Фильтр по жанрам: дропдаун с чипами ---------- */

.section-head__controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.genre-filter {
  position: relative;
}

/* Тумблер визуально совпадает с соседним select (высота 40px, рамка, фон). */
.genre-filter__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.genre-filter__toggle:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.genre-filter__toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.genre-filter__toggle .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted-2);
  transition: transform 0.2s ease;
}

.genre-filter__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.genre-filter__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: max-content;
  max-width: min(340px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(ellipse 90% 55% at 90% 0%, rgba(139, 92, 246, 0.12), transparent 58%),
    linear-gradient(155deg, rgba(23, 24, 38, 0.98), rgba(10, 11, 19, 0.995));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.genre-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.genre-filter__chip {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted, rgba(255, 255, 255, 0.65));
  font-size: 11.5px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.genre-filter__chip:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text, rgba(255, 255, 255, 0.9));
}

.genre-filter__chip.is-active {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.18);
  color: var(--text, rgba(255, 255, 255, 0.95));
}
