/* ── Listbox component styles ── */

.rlb-listbox-demo {
  margin-bottom: 2rem;
}

.rlb-listbox-description {
  color: var(--text-color);
  font-size: var(--font-size-small);
  margin-bottom: 0.5rem;
}

/* Container */
.rlb-listbox {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-color);
  padding: 0.25rem 0;
  max-width: 320px;
}

.rlb-listbox:focus {
  outline: 3px solid var(--focus-color);
  outline-offset: 2px;
}

/* Options */
.rlb-listbox__option {
  position: relative;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--text-color);
  line-height: 1.4;
  user-select: none;
  transition: background-color var(--transition-duration);
}

.rlb-listbox__option::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
}

/* Focused option */
.rlb-listbox__option.listbox__option--focused {
  outline: 2px solid var(--focus-color);
  outline-offset: -2px;
  background-color: var(--surface-muted);
}

/* Selected state: checkmark indicator (not color alone) */
.rlb-listbox__option[aria-selected="true"] {
  background-color: var(--surface-muted);
  font-weight: 600;
}

.rlb-listbox__option[aria-selected="true"]::before {
  content: "\2713";
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Combined focused + selected */
.rlb-listbox__option.listbox__option--focused[aria-selected="true"] {
  background-color: var(--surface-subtle);
  outline: 2px solid var(--focus-color);
  outline-offset: -2px;
}

/* Disabled option */
.rlb-listbox__option[aria-disabled="true"] {
  color: var(--text-color-faint);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Hover (non-disabled only) */
.rlb-listbox__option:not([aria-disabled="true"]):hover {
  background-color: var(--surface-muted);
}

.rlb-listbox__option.listbox__option--focused:not([aria-disabled="true"]):hover {
  background-color: var(--surface-muted);
}
