/* Tom Select overrides — matches the app's Tailwind/orange theme */

/* Control (the visible input box) */
.ts-wrapper.single .ts-control {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #fff;
  padding: 6px 12px;
  min-height: 38px;
  font-size: 14px;
  color: #374151;
  box-shadow: none;
  cursor: text;
  /* Keep item + input on one line — base CSS uses flex-wrap:wrap which
     causes the cursor to drop below the selected item */
  flex-wrap: nowrap !important;
  overflow: hidden;
}

/* Selected item fills available width, truncates if too long */
.ts-wrapper.single .ts-control .item {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Search input sits inline after the item, collapses to nothing when hidden */
.ts-wrapper.single .ts-control input {
  flex: 0 1 auto;
  min-width: 4px;
}

.ts-wrapper.single .ts-control:hover {
  border-color: #9ca3af;
}

.ts-wrapper.single.focus .ts-control {
  border-color: #FF8000;
  box-shadow: 0 0 0 1px #FF8000;
  outline: none;
}

.ts-wrapper.single .ts-control input::placeholder {
  color: #9ca3af;
}

/* Hide the search cursor when an item is selected and the dropdown is closed */
.ts-wrapper.single.has-items:not(.focus) .ts-control input {
  display: none !important;
}

/* Dropdown panel */
.ts-dropdown {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  font-size: 14px;
  margin-top: 2px;
  z-index: 1000;
}

.ts-dropdown .ts-dropdown-content {
  max-height: 260px;
}

/* Option rows */
.ts-dropdown .option {
  padding: 8px 12px;
  color: #374151;
  cursor: pointer;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background: #f3f4f6;
}

/* Custom product option layout */
.ts-opt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ts-opt-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.ts-opt-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-opt-type {
  font-size: 12px;
  color: #6b7280;
}

.ts-opt-price {
  font-size: 12px;
  font-weight: 600;
  color: #FF8000;
}

/* No results / loading — padding comes from .option, just set the muted color */
.ts-no-results,
.ts-loading-msg {
  color: #9ca3af;
  cursor: default;
}

/* Highlight matched text */
.ts-dropdown .highlight {
  background: transparent;
  color: #FF8000;
  font-weight: 600;
}

/* Wrapper: fill parent, strip every visual decoration the base CSS adds */
.ts-wrapper {
  width: 100%;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
}

/* Dark mode */
.dark .ts-wrapper.single .ts-control {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}

.dark .ts-wrapper.single .ts-control input {
  color: #d1d5db;
}

.dark .ts-wrapper.single .ts-control input::placeholder {
  color: #6b7280;
}

.dark .ts-wrapper.single.focus .ts-control {
  border-color: #FF8000;
  box-shadow: 0 0 0 1px #FF8000;
}

.dark .ts-dropdown {
  background: #374151;
  border-color: #4b5563;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
}

.dark .ts-dropdown .option {
  color: #d1d5db;
}

.dark .ts-dropdown .option:hover,
.dark .ts-dropdown .option.active {
  background: #4b5563;
}

.dark .ts-opt-type {
  color: #9ca3af;
}
