.custom-select-wrap,
.custom-check-wrap {
  position: relative;
}

.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--radius, 8px);
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text, #333);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: #bbb;
}

.custom-select-trigger:focus-visible {
  outline: 2px solid var(--primary, #00a651);
  outline-offset: 2px;
}

.custom-select-arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted, #666);
  border-bottom: 2px solid var(--text-muted, #666);
  transform: rotate(45deg);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-top: -3px;
}

.custom-select-wrap.is-open .custom-select-arrow {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.custom-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 500;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.custom-select-wrap.is-open .custom-select-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-list::-webkit-scrollbar {
  width: 6px;
}

.custom-select-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.custom-select-option {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(4px);
  transition: background 0.15s ease;
}

.custom-select-wrap.is-open .custom-select-option {
  animation: customOptIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.custom-select-wrap.is-open .custom-select-option:nth-child(1) { animation-delay: 0.03s; }
.custom-select-wrap.is-open .custom-select-option:nth-child(2) { animation-delay: 0.06s; }
.custom-select-wrap.is-open .custom-select-option:nth-child(3) { animation-delay: 0.09s; }
.custom-select-wrap.is-open .custom-select-option:nth-child(4) { animation-delay: 0.12s; }
.custom-select-wrap.is-open .custom-select-option:nth-child(5) { animation-delay: 0.15s; }
.custom-select-wrap.is-open .custom-select-option:nth-child(n+6) { animation-delay: 0.18s; }

@keyframes customOptIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: rgba(0, 166, 81, 0.1);
}

.custom-select-option[aria-selected='true'] {
  background: rgba(0, 166, 81, 0.15);
  font-weight: 600;
  color: var(--primary, #00a651);
}

.custom-select-list.is-flipped {
  top: auto;
  bottom: calc(100% + 4px);
}

.custom-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.custom-check-box {
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.custom-check-box svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  transform: scale(0) rotate(-45deg);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.custom-check-wrap.is-checked .custom-check-box {
  background: var(--primary, #00a651);
  border-color: var(--primary, #00a651);
}

.custom-check-wrap.is-checked .custom-check-box svg {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.custom-check-label-text {
  font-size: 0.95rem;
}

.vip-page .custom-select-trigger {
  background: #1a1a1a;
  border-color: #444;
  color: #fff;
}

.vip-page .custom-select-list {
  background: #222;
  border-color: #444;
}

.vip-page .custom-select-option {
  color: #e8e8e8;
}

@media (prefers-reduced-motion: reduce) {
  .custom-select-list,
  .custom-select-arrow,
  .custom-select-option,
  .custom-check-box svg {
    transition: none;
    animation: none;
  }

  .custom-select-wrap.is-open .custom-select-option {
    opacity: 1;
    transform: none;
  }
}
