/* ============================================================
   Aranabilir Select Bileşeni (searchable-select)
   Sitedeki tüm <select> alanlarını aranabilir dropdown'a çevirir.
   Orijinal select gizlenir, değeri korunur (form submit bozulmaz).
   ============================================================ */

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

/* Görünen kutu (tetikleyici) */
.ss-control {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem .75rem;
  background: #fff;
  border: 1px solid rgba(30, 27, 38, .15);
  border-radius: .6rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  line-height: 1.3;
}
.ss-control:hover { border-color: rgba(30, 27, 38, .3); }
.ss-wrap.ss-open .ss-control {
  border-color: var(--ss-accent, #9d4b7c);
  box-shadow: 0 0 0 3px rgba(157, 75, 124, .12);
}
.ss-control.ss-disabled {
  background: rgba(30, 27, 38, .04);
  cursor: not-allowed;
  opacity: .7;
}

.ss-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1e1b26;
}
.ss-value.ss-placeholder { color: rgba(30, 27, 38, .4); }

.ss-arrow {
  flex-shrink: 0;
  width: .8rem;
  height: .8rem;
  border-right: 2px solid rgba(30, 27, 38, .4);
  border-bottom: 2px solid rgba(30, 27, 38, .4);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s;
}
.ss-wrap.ss-open .ss-arrow { transform: rotate(-135deg) translateY(2px); }

.ss-clear {
  flex-shrink: 0;
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  color: rgba(30,27,38,.45);
  font-size: 1rem; line-height: 1;
  cursor: pointer;
}
.ss-clear:hover { background: rgba(30,27,38,.08); color: #1e1b26; }
.ss-wrap.ss-has-clear:not(.ss-open) .ss-clear { display: flex; }

/* Açılır panel */
.ss-panel {
  position: absolute;
  z-index: 60;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid rgba(30, 27, 38, .12);
  border-radius: .7rem;
  box-shadow: 0 12px 32px -8px rgba(30, 27, 38, .25);
  overflow: hidden;
  display: none;
  animation: ss-in .12s ease-out;
}
.ss-wrap.ss-open .ss-panel { display: block; }
.ss-wrap.ss-up .ss-panel { top: auto; bottom: calc(100% + 4px); }
@keyframes ss-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Arama kutusu */
.ss-search-box {
  padding: .5rem;
  border-bottom: 1px solid rgba(30, 27, 38, .07);
  position: sticky; top: 0; background: #fff;
}
.ss-search {
  width: 100%;
  padding: .45rem .65rem;
  border: 1px solid rgba(30, 27, 38, .15);
  border-radius: .5rem;
  font-size: .85rem;
  outline: none;
  box-sizing: border-box;
}
.ss-search:focus { border-color: var(--ss-accent, #9d4b7c); }

/* Seçenek listesi */
.ss-options {
  max-height: 15rem;
  overflow-y: auto;
  padding: .25rem;
}
.ss-opt {
  padding: .5rem .65rem;
  border-radius: .45rem;
  cursor: pointer;
  font-size: .875rem;
  color: #1e1b26;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .1s;
}
.ss-opt:hover, .ss-opt.ss-active { background: rgba(157, 75, 124, .1); }
.ss-opt.ss-selected { font-weight: 600; color: var(--ss-accent, #9d4b7c); }
.ss-opt.ss-selected::after { content: " ✓"; }
.ss-opt.ss-hidden { display: none; }
.ss-opt-group {
  padding: .5rem .65rem .25rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(30, 27, 38, .4);
}
.ss-empty {
  padding: .75rem .65rem;
  font-size: .8rem;
  color: rgba(30, 27, 38, .45);
  text-align: center;
}

/* scrollbar ince */
.ss-options::-webkit-scrollbar { width: 8px; }
.ss-options::-webkit-scrollbar-thumb { background: rgba(30,27,38,.15); border-radius: 4px; }

/* Panelin genel "min-width:0" kuralı bu kutuyu sıfıra çökertmesin.
   Dar ekranda yine %100'e düşer, taşma yapmaz. */
.ss-wrap{min-width:min(160px,100%)}
.ss-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
