.filter-bar {
  overflow-y: visible;
  position: relative;
}

.filter-bar-search *,
.filter-bar-dropdown * {
  box-sizing: border-box;
}

.filter-bar-dropdown {
  display: inline-block;
  margin-left: .5em;
  padding: .5em;
  position: relative;
}

.filter-bar-dropdown-input {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.filter-bar-dropdown-listbox ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

[data-opens-dropdown] {
  align-items: center;
  display: flex;
  padding: 2px 10px;
}

[data-opens-dropdown] span:first-of-type {
  margin-right: .5em;
}

.filter-bar-dropdown-listbox a {
  display: block;
  margin-top: 2px;
  min-width: 100%;
  padding: 2px 10px;
  text-align: left;
  white-space: nowrap;
}

.filter-bar-dropdown-input:focus + [data-opens-dropdown],
.filter-bar-dropdown-listbox a:focus {
  background: var(--color-first);
  outline: none;
}

:checked + label .expanded-text {
  display: inline;
}

:checked + label .collapsed-text {
  display: none;
}

.filter-bar-dropdown-input:not(:checked) + label .expanded-text {
  display: none;
}

.filter-bar-dropdown-input:not(:checked) + label .collapsed-text {
  display: inline;
}

.filter-bar-dropdown-listbox {
  background-color: rgb(255 255 255 / 80%);
  display: none;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 2;
}

:checked ~ .filter-bar-dropdown-listbox {
  display: block;
}

.filter-bar-search {
  align-items: center;
  display: flex;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(calc(100% - 78px), -50%);
  transition: transform .2s ease-in-out;
  white-space: nowrap;
  width: 100%;
}

.filter-bar-search.open {
  transform: translate(0, -50%);
}

.filter-bar-search-input {
  border: 0;
  flex-grow: 1;
  padding: 10px;
}

.filter-bar-search-label {
  display: flex;
  left: .25em;
  position: absolute;
  top: .25em;
  white-space: nowrap;
}
