/* Dropdown tùy chỉnh (js/select.js) — dùng chung cho site công ty và admin.
   Màu lấy từ biến: --cs-accent (viền khi mở, dấu tích), --cs-radius (bo góc), --cs-hover (nền mục đang trỏ). */

/* Không có JS: vẫn bỏ mũi tên mặc định, thay bằng mũi tên cùng kiểu */
select[data-select] {
  appearance: none; -webkit-appearance: none;
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A6185' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}

.cs { position: relative; width: 100%; }
.cs-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }

.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cs-trigger:hover { border-color: #9AA1C4; }
.cs.is-open .cs-trigger { border-color: var(--cs-accent); box-shadow: 0 0 0 3px var(--cs-ring); }
.cs-trigger[aria-invalid="true"] { border-color: #C0262D; }
.cs-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chevron { display: flex; flex: none; color: #5A6185; transition: transform .18s ease; }
.cs.is-open .cs-chevron { transform: rotate(180deg); }

.cs-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  margin: 0; padding: 6px; list-style: none;
  max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  background: #FFFFFF; color: #0E1330;
  border: 1px solid #E3E6F0; border-radius: var(--cs-radius);
  box-shadow: 0 12px 32px rgba(14, 19, 48, .16), 0 2px 6px rgba(14, 19, 48, .06);
  transform-origin: top center;
  animation: cs-in .14s ease-out;
}
.cs.is-up .cs-list { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.cs-list:focus { outline: none; }
.cs-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; padding: 8px 12px; border-radius: calc(var(--cs-radius) * .6);
  font-size: 14px; cursor: pointer; user-select: none;
}
.cs-option.is-active { background: var(--cs-hover); }
.cs-option[aria-selected="true"] { font-weight: 600; color: var(--cs-accent-ink); }
.cs-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.cs-check { display: flex; flex: none; color: var(--cs-accent-ink); visibility: hidden; }
.cs-option[aria-selected="true"] .cs-check { visibility: visible; }

@keyframes cs-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.cs.is-up .cs-list { animation-name: cs-in-up; }
@keyframes cs-in-up { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cs-list { animation: none; }
  .cs-chevron, .cs-trigger { transition: none; }
}
