.bbd-pill-filters__list {
  display: flex;
  flex-direction: row;
  gap: var(--grid-gutter);
  padding-block-start: calc(0.5 * var(--spacing));
}

.bbd-pill-filters__item {
  display: flex;
  flex-shrink: 0;
}

.bbd-pill-filters__input {
  position: absolute;
  opacity: 0;
}

.bbd-pill-filters__count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  width: 21px;
  border-radius: 50%;
  background-color: rgb(var(--color-foreground));
  color: rgb(var(--color-white));
  font-size: 1.3rem;
  opacity: 0;
}

.bbd-pill-filters__filter {
  position: relative;
  padding: calc(0.25 * var(--spacing)) calc(0.75 * var(--spacing));
  border-radius: 40px;
  border: 1px solid rgb(var(--color-button));
  background-color: rgb(var(--color-button));
  color: rgb(var(--color-button-text));
  font-size: 1.4rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease-in-out,
    background-color 0.2s ease-in-out,
    color 0.2s ease-in-out;

  &.active,
  &:has(> .bbd-pill-filters__input:checked) {
    color: rgb(var(--color-foreground));
    border-color: rgb(var(--color-foreground));

    .bbd-pill-filters__count {
      opacity: 1;
    }
  }

  &:has(> .bbd-pill-filters__input:disabled) {
    cursor: not-allowed;
    filter: grayscale(1);
  }

  &:not(:has(> .bbd-pill-filters__input:disabled)):hover,
  &:not(:has(> .bbd-pill-filters__input:disabled)):focus-visible {
    border-color: rgb(var(--color-foreground));
  }
}

@media screen and (min-width: 750px) {
  .bbd-pill-filters__filter {
    padding: calc(0.5 * var(--spacing)) calc(1 * var(--spacing));
    font-size: 1.6rem;
  }
}
