/**
 * Products list — table layout (column alignment, scrollX head/body sync)
 */

#scrollable-container #product_table,
#productListTable .business-table-pane #product_table,
#scrollable-container .dataTables_scrollHead #product_table,
#scrollable-container .dataTables_scrollBody #product_table {
    width: 100% !important;
    min-width: 88rem;
    table-layout: auto !important;
    border-collapse: collapse !important;
}

#scrollable-container #product_table_wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

#scrollable-container #product_table_wrapper .dataTables_scroll {
    width: 100% !important;
    clear: both;
}

#scrollable-container #product_table_wrapper .dataTables_scrollHead {
    overflow: hidden !important;
}

#scrollable-container #product_table_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

#scrollable-container #product_table thead th,
#scrollable-container #product_table tbody td,
#scrollable-container #product_table tfoot td,
#productListTable .business-table-pane #product_table thead th,
#productListTable .business-table-pane #product_table tbody td,
#productListTable .business-table-pane #product_table tfoot td,
#scrollable-container .dataTables_scrollHead #product_table thead th,
#scrollable-container .dataTables_scrollBody #product_table tbody td,
#scrollable-container .dataTables_scrollFoot #product_table tfoot td {
    display: table-cell !important;
    position: static !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

#scrollable-container #product_table thead th,
#productListTable .business-table-pane #product_table thead th {
    white-space: nowrap !important;
}

/* Checkbox */
#scrollable-container #product_table .product-col-checkbox,
#productListTable .business-table-pane #product_table .product-col-checkbox,
#scrollable-container .dataTables_scrollHead #product_table .product-col-checkbox,
#scrollable-container .dataTables_scrollBody #product_table .product-col-checkbox {
    min-width: 2.75rem !important;
    width: 2.75rem !important;
    max-width: 3.25rem !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Image */
#scrollable-container #product_table .product-col-image,
#productListTable .business-table-pane #product_table .product-col-image,
#scrollable-container .dataTables_scrollHead #product_table .product-col-image,
#scrollable-container .dataTables_scrollBody #product_table .product-col-image {
    min-width: 4.5rem !important;
    width: 4.5rem !important;
    max-width: 5.5rem !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Action */
#scrollable-container #product_table .product-col-action,
#productListTable .business-table-pane #product_table .product-col-action,
#scrollable-container .dataTables_scrollHead #product_table .product-col-action,
#scrollable-container .dataTables_scrollBody #product_table .product-col-action {
    min-width: 8.5rem !important;
    width: 8.5rem !important;
    max-width: none !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Product name */
#scrollable-container #product_table .product-col-name,
#productListTable .business-table-pane #product_table .product-col-name,
#scrollable-container .dataTables_scrollHead #product_table .product-col-name,
#scrollable-container .dataTables_scrollBody #product_table .product-col-name {
    min-width: 16rem !important;
    white-space: normal !important;
}

/* Locations */
#scrollable-container #product_table .product-col-location,
#productListTable .business-table-pane #product_table .product-col-location,
#scrollable-container .dataTables_scrollHead #product_table .product-col-location,
#scrollable-container .dataTables_scrollBody #product_table .product-col-location {
    min-width: 11rem !important;
    white-space: normal !important;
}

/* Prices */
#scrollable-container #product_table .product-col-purchase-price,
#scrollable-container #product_table .product-col-selling-price,
#productListTable .business-table-pane #product_table .product-col-purchase-price,
#productListTable .business-table-pane #product_table .product-col-selling-price,
#scrollable-container .dataTables_scrollHead #product_table .product-col-purchase-price,
#scrollable-container .dataTables_scrollHead #product_table .product-col-selling-price,
#scrollable-container .dataTables_scrollBody #product_table .product-col-purchase-price,
#scrollable-container .dataTables_scrollBody #product_table .product-col-selling-price {
    min-width: 9rem !important;
    white-space: nowrap !important;
}

/* Stock, type, category, brand, tax, sku */
#scrollable-container #product_table .product-col-stock,
#scrollable-container #product_table .product-col-type,
#scrollable-container #product_table .product-col-category,
#scrollable-container #product_table .product-col-brand,
#scrollable-container #product_table .product-col-tax,
#scrollable-container #product_table .product-col-sku,
#productListTable .business-table-pane #product_table .product-col-stock,
#productListTable .business-table-pane #product_table .product-col-type,
#productListTable .business-table-pane #product_table .product-col-category,
#productListTable .business-table-pane #product_table .product-col-brand,
#productListTable .business-table-pane #product_table .product-col-tax,
#productListTable .business-table-pane #product_table .product-col-sku,
#scrollable-container .dataTables_scrollHead #product_table .product-col-stock,
#scrollable-container .dataTables_scrollHead #product_table .product-col-type,
#scrollable-container .dataTables_scrollHead #product_table .product-col-category,
#scrollable-container .dataTables_scrollHead #product_table .product-col-brand,
#scrollable-container .dataTables_scrollHead #product_table .product-col-tax,
#scrollable-container .dataTables_scrollHead #product_table .product-col-sku,
#scrollable-container .dataTables_scrollBody #product_table .product-col-stock,
#scrollable-container .dataTables_scrollBody #product_table .product-col-type,
#scrollable-container .dataTables_scrollBody #product_table .product-col-category,
#scrollable-container .dataTables_scrollBody #product_table .product-col-brand,
#scrollable-container .dataTables_scrollBody #product_table .product-col-tax,
#scrollable-container .dataTables_scrollBody #product_table .product-col-sku {
    min-width: 8rem !important;
    white-space: nowrap !important;
}

#scrollable-container #product_table .product-col-stock,
#productListTable .business-table-pane #product_table .product-col-stock {
    text-align: center !important;
}

/* Custom fields */
#scrollable-container #product_table .product-col-custom,
#productListTable .business-table-pane #product_table .product-col-custom,
#scrollable-container .dataTables_scrollHead #product_table .product-col-custom,
#scrollable-container .dataTables_scrollBody #product_table .product-col-custom {
    min-width: 8rem !important;
    white-space: normal !important;
}

/* SKU / barcode column — full width for 13-digit codes (e.g. EAN) */
#scrollable-container #product_table .product-col-sku,
#productListTable .business-table-pane #product_table .product-col-sku,
#scrollable-container .dataTables_scrollHead #product_table .product-col-sku,
#scrollable-container .dataTables_scrollBody #product_table .product-col-sku,
.business-table-pane #product_table .product-col-sku,
.business-table-pane #product_table thead th.bt-col-ref,
.business-table-pane #product_table tbody td.bt-col-ref {
    min-width: 11rem !important;
    width: 11rem !important;
    max-width: 14rem !important;
    white-space: nowrap !important;
}

/* All Products — nested table shell inside tabbed card */
#productListPage.business-table-card--tabbed > .business-table-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#productListPage .business-table-tabs {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#productListPage .business-table-tabs > .tab-content {
    flex: 1 1 auto;
    min-height: 0;
}

#productListPage .business-table-tabs > .tab-content > .tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

#productListPage #productListTable.accounting-transactions-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#productListPage #productListTable .business-table-body--flat {
    flex: 1 1 auto;
    min-height: 0;
}

#productListPage #productListTable .business-table-hscroll-zone {
    flex: 1 1 auto;
    min-height: 0;
}

#productListPage #productListTable .business-table-pane {
    flex: 1 1 auto;
    min-height: 0;
}

#productListPage #productListTable .accounting-transactions-table-toolbar,
#productListPage #productListTable .business-table-footer {
    flex-shrink: 0;
}

#productListPage #productListTable .business-table-scroll-top,
#productListPage #productListTable .business-table-scroll-bottom {
    flex-shrink: 0;
}

/* One clear-filters control — outer card button is wired in JS */
#productListPage #productListTable .accounting-transactions-table-toolbar .business-table-clear-filters-btn {
    display: none;
}
