/* Dropdown tùy biến (js/dropdown.js) – thay giao diện <select> mặc định. <select> gốc ẩn, nút .dd-btn mang class của nó (.input). */
select.dd-native { display: none !important; }

.dd-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; text-align: left; cursor: pointer; }
.dd-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--fb) 40%, var(--line-2)); }
.dd-btn:focus-visible, .dd-btn[aria-expanded="true"] { border-color: var(--fb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fb) 18%, transparent); }
.dd-btn:disabled { cursor: not-allowed; }
.dd-val { flex: 1; min-width: 0; display: grid; }
.dd-val > *, .dd-sizer > * { grid-area: 1 / 1; overflow: hidden; white-space: nowrap; }
.dd-label { text-overflow: ellipsis; }
.dd-sizer { display: grid; height: 0; visibility: hidden; }
.dd-chev { flex: none; color: var(--muted); transition: transform .15s var(--ease); }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); color: var(--fb-text); }

.dd-menu {
  position: fixed; z-index: 1000; max-width: min(420px, calc(100vw - 16px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  font-size: 12.25px; animation: ddIn .12s var(--ease);
}
.dd-menu.up { animation-name: ddInUp; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes ddInUp { from { opacity: 0; transform: translateY(4px); } }
.dd-opt { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--text); cursor: pointer; }
.dd-opt.nested { padding-left: 16px; }
.dd-opt-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-opt.active { background: var(--hover); }
.dd-opt[aria-selected="true"] { background: var(--fb-tint); color: var(--fb-text); font-weight: 600; }
.dd-opt[aria-selected="true"].active { background: color-mix(in srgb, var(--fb) 24%, transparent); }
.dd-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dd-tick { flex: none; color: var(--fb-text); }
.dd-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dd-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--line); }
