/* FreshMart POS — cross-platform custom select/dropdown */
.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-native {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  background-image: none !important;
  padding-right: 14px !important;
}

.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.custom-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--muted);
  transition: transform .15s ease, color .15s ease;
}

.custom-select-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-select-trigger.custom-select-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .14);
}

.custom-select-trigger.custom-select-open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.custom-select-menu {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 27, 45, .16), 0 2px 8px rgba(15, 27, 45, .08);
  animation: customSelectIn .11s ease-out;
}

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

.custom-select-option {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  background: var(--surface-2);
}

.custom-select-option.selected {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 650;
}

.custom-select-option.selected:hover,
.custom-select-option.selected:focus-visible {
  background: var(--primary-100);
}

.custom-select-option:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.custom-select-check {
  flex: none;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

/* Toolbar filters should keep the original compact single-row layout.
 * The custom-select wrapper replaces the native <select>, so it needs to
 * inherit the toolbar's fixed filter width instead of the global 100% width.
 */
.toolbar .custom-select,
.label-toolbar .custom-select {
  width: auto;
  min-width: 160px;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .custom-select-menu {
    border-radius: 11px;
  }
  .custom-select-option {
    min-height: 42px;
    padding: 9px 11px;
  }
}
