/* Shared visual layer for modal-combobox.js opt-in single selects.
   The native select stays form-associated; the generated trigger and listbox are visual only. */
select.b2b-select__native[data-b2b-select-enhanced='true'] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.b2b-select,
.b2b-select__row {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.b2b-select {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.b2b-select__row,
.b2b-select__trigger,
.b2b-select__option {
  display: flex;
  align-items: center;
}
.b2b-select__trigger {
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  box-sizing: border-box;
  margin: 0;
  padding: var(--native-select-py, 9px) var(--native-select-pr, 38px)
    var(--native-select-py, 9px) var(--native-select-pl, 14px);
  border: 1px solid color-mix(in srgb, var(--filter-border) 92%, transparent);
  border-radius: var(--native-select-radius, 10px);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.b2b-select__trigger:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--filter-border));
}
.b2b-select__trigger:focus,
.b2b-select__trigger:focus-visible,
.b2b-select__trigger[aria-expanded='true'] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.b2b-select__trigger:disabled,
.b2b-select__option:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
.b2b-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.b2b-select__value.is-placeholder { color: var(--text-secondary); }
.b2b-select__chevron {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: var(--select-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%236b7280' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")) center / 14px 14px no-repeat;
  pointer-events: none;
  transition: transform 0.15s ease;
}
.b2b-select.is-open .b2b-select__chevron { transform: rotate(180deg); }

.b2b-select__panel {
  display: none;
  flex-direction: column;
  min-width: 0;
  max-width: min(400px, calc(100vw - 16px));
  max-height: min(280px, 70vh);
  padding: 6px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--dropdown-bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-border) 75%, transparent),
    0 16px 48px color-mix(in srgb, #000 16%, transparent),
    0 4px 14px color-mix(in srgb, #000 6%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body > .b2b-select__panel.open {
  right: auto;
  display: flex;
}
.b2b-select__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(260px, 66vh);
  padding: 4px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.b2b-select__option {
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.b2b-select__option:hover:not(:disabled),
.b2b-select__option.is-keyboard-active { background: var(--row-hover); }
.b2b-select__option.is-active {
  background: color-mix(in srgb, var(--accent) 11%, var(--dropdown-bg));
  color: var(--accent);
  font-weight: 600;
}
.b2b-select__option-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.b2b-select__option .proj-modal-dd__preset-check { display: none; }
.b2b-select__group-label {
  padding: 9px 12px 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.b2b-select__error {
  display: block;
  margin-top: 5px;
  color: var(--danger, #d92d20);
  font-size: 12px;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  .b2b-select__trigger,
  .b2b-select__chevron { transition: none; }
}
