/* Shared dropdown geometry. Native selects still determine layout and form data. */
.searchable-select {
  position: relative;
  display: inline-grid;
  vertical-align: middle;
  min-width: 0;
  max-width: 100%;
}

.searchable-select[hidden] { display: none !important; }
.searchable-select > select.searchable-select-source {
  visibility: hidden;
  pointer-events: none;
  max-width: 100%;
  min-width: 0;
}

.form-group > .searchable-select,
.form-shell .searchable-select,
.catalogue-filter-fields .searchable-select,
.catalogue-linking-filter .searchable-select,
.catalogue-inbox-filters .searchable-select,
.our-products-list .searchable-select,
.catalogue-quick-edit-fields .searchable-select {
  width: 100%;
}

.searchable-select > input.searchable-select-input[type="text"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding-right: 32px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23545454' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.searchable-select-input:disabled {
  color: var(--grey-500);
  background-color: var(--grey-100);
  cursor: not-allowed;
}

[data-theme="dark"] .searchable-select > input.searchable-select-input[type="text"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23bec6d1' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
}

.searchable-select > .searchable-select-clear {
  position: absolute;
  inset: 1px 1px 1px auto;
  width: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--grey-600);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.searchable-select-popup {
  position: fixed;
  inset: auto;
  z-index: 1200;
  margin: 0;
  padding: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-300) var(--grey-50);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: var(--white);
  color: var(--black);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.4;
}

.searchable-select-popup[hidden] { display: none; }
.searchable-select-option {
  padding: 8px 10px;
  min-height: var(--control-height);
  border-radius: 3px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.searchable-select-option[aria-selected="true"] { font-weight: 500; background: var(--grey-100); }
.searchable-select-option.is-highlighted,
.searchable-select-option:hover { background: var(--grey-150); }
.searchable-select-option[aria-disabled="true"] { color: var(--grey-500); cursor: not-allowed; background: transparent; }
.searchable-select-group,
.searchable-select-status { padding: 8px 10px; color: var(--grey-600); }
.searchable-select-group { font-weight: 500; font-size: 11px; }
.searchable-select-clear:focus-visible { outline: 2px solid var(--black); outline-offset: -3px; }

/* Legacy pages place sections directly in content instead of a page-stack. */
.content > :is(.workspace-block, .section-card, .section-panel) + :is(.workspace-block, .section-card, .section-panel) {
  margin-top: var(--section-gap);
}

.form-shell label { color: var(--grey-600); }

@media (max-width: 768px) {
  :root { --control-height: 44px; }
  .button, .btn, .action-btn { min-height: var(--control-height); }
  .button.icon, .btn-icon { width: var(--control-height); height: var(--control-height); }
  .searchable-select { width: 100%; }
  .searchable-select > input.searchable-select-input { font-size: 16px; min-height: var(--control-height); }
  .searchable-select-popup { font-size: 16px; }
  .searchable-select-option { min-height: 44px; }
  .searchable-select > .searchable-select-clear { width: 42px; }
  :is(.workspace-block, .section-card, .section-panel) > form > .page-actions {
    align-items: stretch;
  }
  :is(.workspace-block, .section-card, .section-panel) > form > .page-actions > .button {
    width: 100%;
    white-space: normal;
  }
  #bulk-mode-toggle {
    width: var(--control-height);
    height: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
  }
}
