/* Sticky table header: on long lists the header row stays under the admin header (50px) while the page scrolls.
   position: sticky only works when no ancestor between the table and the page is a scroll container,
   so each wrapper is opened (overflow visible) only from the width where the table fits without horizontal scroll.
   Below that width the wrapper keeps its horizontal scroll and becomes the header's scroll container: the header
   is then pinned at the wrapper's top (top: 0), because 50px there would push it over the first rows. */

body.admin-new-theme.orderList-css #orders > thead > tr > th,
body.admin-new-theme.customerList-css #customers > thead > tr > th,
body.admin-new-theme.supplierOrders-css .supplierOrders-table > thead > tr > th,
body.admin-new-theme.priceListView-css #products-price-table > thead > tr > th,
body.admin-new-theme.showSupplierInvoicesByDates-css .table-show-supplier-invoices-by-dates > thead > tr > th,
body.admin-new-theme.usersList-css .users-list > thead > tr > th
{
    position: sticky;
    top: 50px;
    z-index: 3;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 var(--adm-border);
}

:where(
    body.admin-new-theme.customerList-css #customers,
    body.admin-new-theme.supplierOrders-css .supplierOrders-table,
    body.admin-new-theme.priceListView-css #products-price-table,
    body.admin-new-theme.showSupplierInvoicesByDates-css .table-show-supplier-invoices-by-dates,
    body.admin-new-theme.usersList-css .users-list
) > thead > tr > th
{
    background-color: var(--adm-surface-head);
}

body.admin-new-theme.orderList-css #orders > thead > tr > th
{
    background-color: var(--adm-surface-alt);
}

body.admin-new-theme.orderList-css #orders > thead > tr > th:first-of-type::before
{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    width: 16px;
    background-color: var(--adm-surface);
}

body.admin-new-theme.priceListView-css .plv-shell
{
    overflow: clip;
}

@media (min-width: 992px)
{
    body.admin-new-theme.supplierOrders-css .table-responsive
    {
        overflow: visible;
    }
}

@media (min-width: 1200px)
{
    body.admin-new-theme.priceListView-css .plv-products-table-wrap
    {
        overflow: visible;
    }
}

@media (min-width: 1440px)
{
    body.admin-new-theme.orderList-css .table-order-list
    {
        overflow: visible;
    }
}

@media (min-width: 1600px)
{
    body.admin-new-theme.customerList-css .table-responsive:has(> .table-customer-list),
    body.admin-new-theme.showSupplierInvoicesByDates-css .table-responsive:has(> .table-show-supplier-invoices-by-dates)
    {
        overflow: visible;
    }
}

@media (max-width: 991.98px)
{
    body.admin-new-theme.supplierOrders-css .supplierOrders-table > thead > tr > th
    {
        top: 0;
    }
}

@media (max-width: 1199.98px)
{
    body.admin-new-theme.priceListView-css #products-price-table > thead > tr > th
    {
        top: 0;
    }
}

@media (max-width: 1439.98px)
{
    body.admin-new-theme.orderList-css #orders > thead > tr > th
    {
        top: 0;
    }
}

@media (max-width: 1599.98px)
{
    body.admin-new-theme.customerList-css #customers > thead > tr > th,
    body.admin-new-theme.showSupplierInvoicesByDates-css .table-show-supplier-invoices-by-dates > thead > tr > th
    {
        top: 0;
    }
}
