/*
 * jquery-custom-select — CSS
 * BEM: custom-select / custom-select__opener / custom-select__panel / custom-select__option
 */

/* ---- Wrapper ------------------------------------------------ */
.custom-select {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  user-select: none;
  -webkit-user-select: none;
}

/* Hide the original <select> */
.custom-select__select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---- Opener ------------------------------------------------- */
.custom-select__opener {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--color-gray-border, #e5e7eb);
  border-radius: var(--radius-full, 9999px);
  background: #fff;
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-family, inherit);
  font-weight: 500;
  color: var(--color-black, #111827);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  min-width: 12rem;
  line-height: 1.4;
  outline: none;
}

/* Chevron via pseudo */
.custom-select__opener::after {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--color-gray-text, #6b7280);
  border-bottom: 2px solid var(--color-gray-text, #6b7280);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.custom-select--opened .custom-select__opener {
  border-color: var(--color-green, #6b7c5a);
  box-shadow: 0 0 0 3px rgba(107, 124, 90, 0.12);
}

.custom-select--opened .custom-select__opener::after {
  transform: rotate(225deg) translateY(-2px);
}

/* ---- Panel -------------------------------------------------- */
.custom-select__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1.5px solid var(--color-gray-border, #e5e7eb);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
}

/* ---- Search input ------------------------------------------ */
.custom-select__search {
  display: block;
  width: 100%;
  padding: 0.5rem 0.875rem;
  border: none;
  border-bottom: 1.5px solid var(--color-gray-border, #e5e7eb);
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-family, inherit);
  outline: none;
  color: var(--color-black, #111827);
  box-sizing: border-box;
}

/* ---- Options list ------------------------------------------ */
.custom-select__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 240px;
  overflow-y: auto;
}

.custom-select__option {
  padding: 0.55rem 1rem;
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-family, inherit);
  color: var(--color-black, #111827);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.custom-select__option:hover {
  background: var(--color-beige, #f9f7f3);
  color: var(--color-green, #6b7c5a);
}

.custom-select__option.is-selected {
  background: var(--color-beige, #f9f7f3);
  color: var(--color-green, #6b7c5a);
  font-weight: 600;
}

.custom-select__option.is-disabled {
  color: var(--color-gray-text, #9ca3af);
  cursor: default;
  pointer-events: none;
}

/* ---- Scrollbar styling ------------------------------------- */
.custom-select__list::-webkit-scrollbar { width: 4px; }
.custom-select__list::-webkit-scrollbar-track { background: transparent; }
.custom-select__list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
