/* ═══════════════════════════════════════════
   Searchable Select – RTL-first styles
   ═══════════════════════════════════════════ */

.ss-wrap {
  position: relative;
  width: 100%;
}

.ss-wrap select {
  display: none !important;
}

.ss-wrap .ss-wrap > .ss-trigger,
.ss-wrap .ss-wrap > .ss-dropdown {
  display: none !important;
}

/* ── Trigger button ── */
.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: #f9fafb;
  font-family: inherit;
  font-size: 0.95rem;
  color: inherit;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  text-align: start;
  gap: 8px;
  min-height: 44px;
  line-height: 1.4;
}
.ss-trigger:hover {
  border-color: var(--primary-color, #6366f1);
}
.ss-trigger:focus {
  outline: none;
  border-color: var(--primary-color, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.ss-trigger.ss-open {
  border-color: var(--primary-color, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ss-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9ca3af;
}
.ss-trigger-text.ss-has-value {
  color: inherit;
}

.ss-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #9ca3af;
  transition: transform .2s;
}
.ss-open .ss-arrow {
  transform: rotate(180deg);
}

/* ── Dropdown panel ── */
.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  overflow: hidden;
  animation: ss-slide-in .15s ease-out;
}
@keyframes ss-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Search input ── */
.ss-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.ss-search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #94a3b8;
}
.ss-search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: inherit;
  min-width: 0;
  direction: inherit;
  text-align: start;
}
.ss-search::placeholder {
  color: #cbd5e1;
  direction: inherit;
  text-align: start;
}

/* ── Options list ── */
.ss-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
}
.ss-list::-webkit-scrollbar {
  width: 5px;
}
.ss-list::-webkit-scrollbar-track {
  background: transparent;
}
.ss-list::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

/* ── Item ── */
.ss-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .12s;
}
.ss-item:hover,
.ss-item.ss-item--active {
  background: #f1f5f9;
}
.ss-item.ss-item--selected {
  background: rgba(99, 102, 241, 0.06);
  color: var(--primary-color, #6366f1);
  font-weight: 600;
}
.ss-item.ss-item--selected::after {
  content: '✓';
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color, #6366f1);
}

.ss-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-item-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ── No results ── */
.ss-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ── Mobile adjustments ── */
@media (max-width: 576px) {
  .ss-trigger {
    padding: 12px 14px;
    font-size: 1rem;
  }
  .ss-list {
    max-height: 180px;
  }
}
