/* Orizon custom select — shared across portal, admin, and public forms */

.orizon-select {
  position: relative;
  width: 100%;
}

.orizon-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.orizon-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8125rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.orizon-select-trigger:hover {
  border-color: rgba(0, 102, 255, 0.35);
  background: #fff;
}

.orizon-select.open {
  z-index: 40;
}

.orizon-select.open .orizon-select-trigger,
.orizon-select-trigger:focus-visible {
  outline: none;
  border-color: #0066ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.orizon-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orizon-select-value.is-placeholder {
  color: #64748b;
  font-weight: 400;
}

.orizon-select-chevron {
  width: 1.125rem;
  height: 1.125rem;
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.orizon-select.open .orizon-select-chevron {
  transform: rotate(180deg);
  color: #0066ff;
}

.orizon-select-dropdown {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  animation: orizon-select-in 0.16s ease;
}

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

.orizon-select-list {
  list-style: none;
  margin: 0;
  padding: 0.375rem;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.orizon-select-trigger,
.orizon-select-option {
  touch-action: manipulation;
}

.orizon-select-option {
  padding: 0.75rem 0.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.orizon-select-option:hover {
  background: #f1f5f9;
}

.orizon-select-option.selected {
  background: rgba(0, 102, 255, 0.08);
  color: #0066ff;
  font-weight: 600;
}

.orizon-select-option[aria-selected="true"] {
  background: rgba(0, 102, 255, 0.08);
  color: #0066ff;
  font-weight: 600;
}

/* Compact — toolbar / market sort */
.orizon-select-compact .orizon-select-trigger,
.orizon-select-inline .orizon-select-trigger {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 8px;
  border-width: 1px;
  background: #fff;
}

.orizon-select-inline {
  width: auto;
  min-width: 5.5rem;
}

.orizon-select-inline .orizon-select-dropdown {
  min-width: 100%;
  width: max-content;
  max-width: 280px;
}

/* Admin modal fields */
.admin-field .orizon-select-trigger,
.portal-form .orizon-select-trigger {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border-width: 1px;
  background: #fff;
}

.admin-modal-compact .orizon-select-trigger {
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  border-radius: 7px;
}

/* Public auth forms inside input-wrap */
.input-wrap .orizon-select {
  flex: 1;
  min-width: 0;
}

.input-wrap .orizon-select-trigger {
  border: none;
  background: transparent;
  padding: 0.8125rem 0.5rem 0.8125rem 2.625rem;
  box-shadow: none;
}

.input-wrap .orizon-select.open .orizon-select-trigger,
.input-wrap .orizon-select-trigger:hover {
  border: none;
  box-shadow: none;
  background: transparent;
}

.input-wrap:has(.orizon-select.open) {
  border-color: #0066ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.06);
}

@media (max-width: 640px) {
  body.orizon-select-sheet-open {
    overflow: hidden;
  }

  .orizon-select-dropdown.orizon-select-sheet {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    border-radius: 16px 16px 0 0;
    max-height: min(70vh, 420px);
    animation: orizon-select-sheet 0.22s ease;
  }

  @keyframes orizon-select-sheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .orizon-select-sheet .orizon-select-list {
    max-height: min(70vh, 420px);
  }

  .orizon-select-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10040;
    animation: orizon-select-fade 0.2s ease;
  }

  @keyframes orizon-select-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.admin-table-wrap .orizon-select.open {
  z-index: 60;
}

.orizon-select-dropdown[style*="fixed"] {
  z-index: 1000;
}
