/* Categorized inventory dropdown */
.inventory-dropdown {
  position: relative;
  z-index: 40;
  margin-bottom: 10px;
}

/*
 * The Wheel Items card normally clips its contents.
 * Allow this dropdown to extend over the Win History card.
 */
.inventory-card {
  overflow: visible;
}

.inventory-dropdown-menu {
  overflow: visible;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.inventory-dropdown-menu summary {
  position: relative;
  padding: 11px 36px 11px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.inventory-dropdown-menu summary::-webkit-details-marker {
  display: none;
}

.inventory-dropdown-menu summary::after {
  content: "▾";
  position: absolute;
  top: 10px;
  right: 13px;
  color: var(--primary);
}

.inventory-dropdown-menu[open] summary::after {
  content: "▴";
}

.inventory-dropdown-panel {
  display: block;
  padding: 8px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.inventory-dropdown-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}

.inventory-dropdown-tools button {
  padding: 5px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 0;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
}

.inventory-dropdown-tools span {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.inventory-dropdown-options {
  display: block;
  max-height: 280px;
  padding-right: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.inventory-dropdown-category,
.inventory-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px;
  border-radius: 6px;
  font-size: 11px;
}

.inventory-dropdown-category {
  color: var(--primary);
  font-weight: 850;
}

.inventory-dropdown-category small {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.inventory-dropdown-item {
  cursor: pointer;
}

.inventory-dropdown-item:hover {
  background: var(--surface);
}

.inventory-dropdown-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-dropdown-item small {
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}

.inventory-dropdown-category input,
.inventory-dropdown-item input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--primary);
}

/* Back at the bottom of the dropdown. */
.inventory-dropdown-add {
  display: block;
  width: 100%;
  min-height: 38px;
  margin: 8px 0 0;
  color: var(--on-primary);
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent)
  );
  border: 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 650px) {
  .inventory-dropdown-options {
    max-height: min(330px, 48vh);
  }

  .inventory-dropdown-category,
  .inventory-dropdown-item {
    min-height: 42px;
    font-size: 14px;
  }
}
