﻿.filter-select {
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.filter-select.is-open {
  z-index: 1200;
}

.filter-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.filter-select-value {
  display: none;
}

.filter-dropdown {
  position: absolute;
  z-index: 1201;
  left: 0;
  top: calc(100% + 6px);
  display: none;
  width: 100%;
  min-height: 151px;
  box-sizing: border-box;
  padding: 5px;
  gap: 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .20);
  box-shadow: 0 20px 44px rgba(8, 18, 32, .22);
  backdrop-filter: blur(18px);
}

.filter-select.is-open .filter-dropdown {
  display: flex;
}

.filter-dropdown-list {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(322px, calc(100vh - 220px));
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.filter-dropdown-list::-webkit-scrollbar {
  display: none;
}

.filter-search,
.filter-option,
.filter-empty {
  width: 100%;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 15px;
  color: var(--cream, #f5f0df);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  backdrop-filter: blur(22px);
}

.filter-search {
  justify-content: space-between;
  gap: 10px;
  padding-right: 5px;
  background: #616C7C;
  color: white;
  cursor: text;
}

.filter-search input {
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.filter-search input::placeholder {
  color: rgba(190, 165, 117, .92);
  opacity: 1;
}

.filter-search-icon {
  width: 24px;
  height: 24px;
  min-height: 0;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #626d7d;
  color: white;
  font-size: 14px;
  line-height: 1;
}

.filter-option {
  background: #616c7c;
  cursor: pointer;
}

.filter-option.is-selected {
  background: var(--navy, #12233b);
}

.filter-option:hover,
.filter-option:focus-visible {
  background: rgba(255, 255, 255, .29);
  color: white;
  outline: none;
}

.filter-option[hidden],
.filter-empty[hidden] {
  display: none;
}

.filter-empty {
  justify-content: center;
  background: rgba(18, 35, 59, .42);
  color: rgba(245, 240, 223, .76);
  pointer-events: none;
}

.filter-scrollbar {
  position: relative;
  width: 5px;
  flex: 0 0 5px;
  align-self: stretch;
  min-height: 151px;
  border-radius: 30px;
  background: rgba(255, 255, 255, .20);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.filter-scrollbar[hidden] {
  display: none;
}

.filter-scrollbar.is-dragging {
  cursor: grabbing;
}

.filter-scrollbar-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 28px;
  border-radius: 30px;
  background: var(--gold, #bea575);
  pointer-events: auto;
  will-change: transform, height;
}

.fit-field.filter-select {
  min-height: 88px;
}

.fit-field.filter-select select {
  top: auto;
  height: 63px;
}

.fit-field.filter-select .filter-select-value {
  height: 63px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.fit-field.filter-select.is-open .filter-select-value {
  background: rgba(255, 255, 255, .24);
}

.fit-field.filter-select .filter-dropdown {
  top: calc(100% + 8px);
}

@media (max-width: 760px) {
  .filter-dropdown {
    top: calc(100% + 5px);
    min-height: 132px;
  }

  .filter-dropdown-list {
    max-height: min(294px, calc(100vh - 150px));
  }

  .filter-scrollbar {
    min-height: 132px;
  }

  .fit-field.filter-select {
    min-height: 75px;
  }

  .fit-field.filter-select select,
  .fit-field.filter-select .filter-select-value {
    height: 50px;
  }
}

/* Keep selected values inside filter controls. */
.filter-select .filter-select-value {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.filter-select .filter-select-value[title] {
  cursor: inherit;
}
