.wrapper {
  position: relative;
}

.inputWrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--field-height);
  padding: 0 var(--field-padding-x);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.inputWrapOpen,
.inputWrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.searchIcon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.input {
  flex: 1;
  padding: var(--field-padding-y) 0;
  font-size: var(--field-font-size);
  line-height: 1.4;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
}

.input::placeholder {
  color: var(--text-muted);
}

.clearBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.clearBtn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.chevronOpen {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.12);
  z-index: 10;
  list-style: none;
  padding: 6px;
  animation: dropdownIn 0.15s ease;
}

/* Prefer for selects inside overflow-clipped modals — expands parent instead of clipping. */
.dropdownInFlow {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  max-height: min(50vh, 400px);
  margin-top: 6px;
  z-index: auto;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.option {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  font-size: var(--field-font-size);
  text-align: start;
  color: var(--text-primary);
  border-radius: 8px;
  transition: background 0.15s;
}

.option:hover {
  background: rgba(var(--primary-rgb) / 0.08);
}

.optionSelected {
  background: rgba(var(--primary-rgb) / 0.12);
  color: var(--primary);
  font-weight: 500;
}

.optionEn {
  font-weight: 500;
  text-align: start;
}

.optionEn[dir='rtl'] {
  text-align: right;
}

.optionSep {
  color: var(--text-muted);
}

.optionFa {
  font-family: var(--font-ui);
  font-weight: 500;
  direction: rtl;
  text-align: right;
}

.noResults {
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
