/* Lookup surfaces use surux.fields.css, including popout spacing and action alignment. */

/* One field surface: reserve only the action lanes that are currently visible. */
.surux-picker-unified .surux-picker-surface {
  --surux-picker-clear-space: 0px;
  --surux-picker-menu-space: 0px;
  --surux-picker-trailing-space: 0px;
}
.surux-picker-unified .surux-picker-surface:has(> [data-surux-picker-clear]:not([hidden])) {
  --surux-picker-clear-space: 32px;
}
.surux-picker-unified .surux-picker-surface:has(> [data-surux-picker-actions-trigger]:not([hidden])) {
  --surux-picker-menu-space: 32px;
}
.surux-picker-unified .surux-picker-surface:has(> .surux-picker-trailing-action > :not([hidden])) {
  --surux-picker-trailing-space: 44px;
}
.surux-picker-unified .surux-picker-surface > [data-surux-picker-input] {
  padding-left: .75rem;
  padding-right: calc(.5rem + var(--surux-picker-clear-space) + var(--surux-picker-menu-space) + var(--surux-picker-trailing-space));
}
.surux-picker-unified .surux-picker-surface > .surux-picker-floating-label {
  max-width: calc(100% - 1.75rem - var(--surux-picker-clear-space) - var(--surux-picker-menu-space) - var(--surux-picker-trailing-space));
  margin-right: calc(1rem + var(--surux-picker-clear-space) + var(--surux-picker-menu-space) + var(--surux-picker-trailing-space));
}
.surux-picker-unified .surux-picker-surface > .surux-picker-action {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  grid-area: auto;
  width: 44px;
  height: 44px;
}
.surux-picker-unified .surux-picker-surface > .surux-picker-action > i {
  font-size: .85rem;
}
.surux-picker-unified .surux-picker-surface > .surux-picker-clear {
  right: var(--surux-picker-menu-space);
}
.surux-picker-unified .surux-picker-surface > .surux-picker-actions-trigger,
.surux-picker-unified .surux-picker-shell:has(.surux-input:disabled) .surux-picker-surface > .surux-picker-actions-trigger {
  right: 0;
  color: var(--surux-muted);
  background: transparent;
  cursor: pointer;
}
.surux-picker-unified .surux-picker-surface > .surux-picker-actions-trigger:hover,
.surux-picker-unified .surux-picker-surface > .surux-picker-actions-trigger:focus-visible {
  color: var(--surux-text);
  background: color-mix(in srgb, var(--surux-primary) 12%, transparent);
}

/* The native top layer retains DOM ancestry for bindings and modal focus traps.
   Without popover support, the menu expands in flow rather than being clipped. */
.surux-picker-actions-menu {
  position: relative;
  width: max-content;
  max-width: 100%;
  max-height: 18rem;
  overflow: auto;
  overscroll-behavior: contain;
  margin: .35rem 0 0 auto;
  padding: .25rem;
  border: var(--surux-border-width) solid var(--surux-border);
  border-radius: var(--surux-radius-field);
  background: var(--surux-surface);
  color: var(--surux-text);
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .24);
}
.surux-picker-actions-menu:popover-open {
  position: fixed;
  inset: auto;
  max-width: calc(100vw - 16px);
  margin: 0;
}
.surux-picker-menu-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 0;
  border-radius: .375rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.surux-picker-menu-item > i { flex: 0 0 1rem; text-align: center; }
.surux-picker-menu-item:hover,
.surux-picker-menu-item:focus-visible {
  background: color-mix(in srgb, var(--surux-primary) 14%, var(--surux-surface));
  color: var(--surux-text);
}
.surux-picker-menu-item:focus-visible {
  outline: 2px solid var(--surux-primary);
  outline-offset: -2px;
}
.surux-picker-actions-menu[hidden],
.surux-picker-menu-item[hidden] { display: none !important; }

/* Trailing slot actions share the picker surface and its visible action lanes. */
.surux-picker-unified .surux-picker-surface > .surux-picker-trailing-action {
  position: absolute;
  right: calc(var(--surux-picker-clear-space) + var(--surux-picker-menu-space));
  top: 50%;
  transform: translateY(-50%);
}
.surux-picker-trailing-action > .surux-picker-action {
  position: static;
  transform: none;
}

/* Band chip. One scope picker in header band tools. The list, search and hydration stay this picker's. */
.surux-picker-band {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}
.surux-band-tools .surux-picker-band,
.surux-band-top > .surux-picker-band { align-self: center; }
.surux-picker-band .surux-control-field { margin: 0; }
.surux-picker-band .surux-picker-band-trigger {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: auto;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 .9rem 0 .85rem;
  border-radius: 999px;
  box-shadow: none;
  color: var(--surux-text);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  text-align: start;
}
.surux-picker-band .surux-picker-band-trigger:disabled { cursor: not-allowed; }
.surux-picker-band .surux-picker-band-trigger::after { content: none; }
.surux-picker-band-kicker {
  flex: 0 0 auto;
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.surux-picker-band-value {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 650;
}
.surux-picker-band-trigger > .fa-chevron-down {
  flex: 0 0 auto;
  font-size: .7rem;
  color: var(--bs-secondary-color);
}
.surux-picker-band .surux-picker-results { min-width: min(16rem, calc(100vw - 1rem)); }
.surux-picker-band-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .35rem;
  background: var(--surux-surface);
}
.surux-picker-band-search .surux-picker-input { width: 100%; min-height: 36px; }
.surux-picker-option-tag {
  flex: 0 0 auto;
  margin-left: .4rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--surux-primary);
  background: color-mix(in srgb, var(--surux-primary) 14%, var(--surux-surface));
}
.surux-picker-band-manage {
  border-top: var(--surux-border-width) solid var(--surux-border);
  border-radius: 0;
}
@media (max-width: 575.98px) {
  .surux-picker-band { flex: 1 1 auto; max-width: 100%; }
}

/* Both pickers render these themselves, so the rules live with the other picker styles. */
.surux-multi-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .55rem;
}

.surux-multi-picker-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 4rem;
  padding: .8rem;
  color: var(--surux-muted);
  font-size: .85rem;
}
