/* Lists can be rendered while hidden or in a narrow panel. A saved pixel
   width must never leave a half-empty page when the panel becomes wider. */
.list-panel > .table-wrap > table,
.table-wrap > table:has(> colgroup > col[data-resizable-table-column]) {
  min-width: max(100%, 520px);
}

@media (min-width: 701px) {
  .table-wrap > table.catalog-list-table[data-sort-key="products:catalog:dishes"] {
    min-width: 0;
  }
  table[data-sort-key="products:catalog:dishes"].catalog-list-table th.catalog-header-sortable {
    position: relative;
    padding-inline: 5px 14px;
  }
  table[data-sort-key="products:catalog:dishes"] .dish-list-heading {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  table[data-sort-key="products:catalog:dishes"] .catalog-name-header {
    display: flex;
    min-width: 0;
  }
  table[data-sort-key="products:catalog:dishes"] .catalog-name-header > span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  table[data-sort-key="products:catalog:dishes"] .catalog-sort-arrow {
    right: 5px;
  }
  table[data-sort-key="products:catalog:dishes"].catalog-list-table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  table[data-sort-key="products:catalog:dishes"] .product-row > td {
    padding-inline: 4px;
  }
  .table-wrap > table.dish-list-measuring[data-sort-key="products:catalog:dishes"] {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 0 !important;
  }
  .dish-list-measuring[data-sort-key="products:catalog:dishes"] :is(col, th, td) {
    width: auto !important;
    min-width: 0 !important;
  }
  .dish-list-measuring[data-sort-key="products:catalog:dishes"] .dish-list-heading {
    position: absolute;
    width: max-content;
  }
  .dish-list-measuring[data-sort-key="products:catalog:dishes"] .catalog-tree-product {
    width: max-content;
    max-width: none;
  }
}
