/**
 * ========================================================
 * TECHSTORE - CUSTOM SELECT COMPONENT STYLES
 * ========================================================
 * Đảm bảo 100% dropdown mở ngay dưới ô chọn và nằm gọn trong container/khung
 */

/* 1. Reset select native */
select {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Ẩn select gốc một cách an toàn mà vẫn giữ form validation & submit */
.custom-select-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  clip: rect(0, 0, 0, 0) !important;
}

/* 2. Wrapper của Custom Select */
.custom-select-wrapper {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* 3. Nút Trigger */
.custom-select-trigger {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.dark .custom-select-trigger {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

.custom-select-trigger:hover,
.custom-select-wrapper.is-open .custom-select-trigger {
  border-color: #dc2626 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.dark .custom-select-trigger:hover,
.dark .custom-select-wrapper.is-open .custom-select-trigger {
  border-color: #ef4444 !important;
  background: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Label text */
.custom-select-label {
  flex: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Chevron arrow */
.custom-select-arrow {
  font-size: 11px !important;
  color: #94a3b8 !important;
  transition: transform 0.2s ease !important;
  flex-shrink: 0 !important;
}

.custom-select-wrapper.is-open .custom-select-arrow {
  transform: rotate(180deg) !important;
  color: #dc2626 !important;
}

/* 4. Dropdown danh sách options */
.custom-select-dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08) !important;
  z-index: 99999 !important;
  padding: 4px !important;
  display: none !important;
  box-sizing: border-box !important;
  animation: customSelectFadeIn 0.15s ease-out !important;
}

.dark .custom-select-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

.custom-select-wrapper.is-open .custom-select-dropdown {
  display: block !important;
}

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

/* 5. Từng item option */
.custom-select-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.dark .custom-select-option {
  color: #cbd5e1 !important;
}

.custom-select-option:hover {
  background: #f1f5f9 !important;
  color: #dc2626 !important;
}

.dark .custom-select-option:hover {
  background: #334155 !important;
  color: #f87171 !important;
}

.custom-select-option.is-selected {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  font-weight: 700 !important;
}

.dark .custom-select-option.is-selected {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #f87171 !important;
}

.custom-select-check {
  font-size: 11px !important;
  color: #dc2626 !important;
  flex-shrink: 0 !important;
}

.dark .custom-select-check {
  color: #f87171 !important;
}

.custom-select-option.is-disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}
