/* Canonical PrintDesk selector table contract.
 *
 * Apply only to top-level object selectors:
 *   <table data-pd-selector>
 *
 * The JavaScript companion owns column geometry through a <colgroup>.
 * Page-specific code keeps responsibility for sorting, filtering and actions.
 */

table[data-pd-selector] {
    width: 100%;
    min-width: 0;
    table-layout: fixed !important;
}

table[data-pd-selector] th,
table[data-pd-selector] td {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: none !important;
}

table[data-pd-selector] thead th {
    width: auto !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table[data-pd-selector] tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table[data-pd-selector] .pd-selector-col-primary {
    white-space: normal;
}

table[data-pd-selector] .pd-selector-primary-content,
table[data-pd-selector] .wh-product-name-clamp,
table[data-pd-selector] .whship-composition {
    display: -webkit-box;
    overflow: hidden;
    max-height: calc(var(--pd-selector-lines, 3) * 1.25em);
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--pd-selector-lines, 3);
    line-clamp: var(--pd-selector-lines, 3);
}

table[data-pd-selector] .pd-selector-col-media {
    text-align: center;
}

table[data-pd-selector] thead th[data-key],
table[data-pd-selector] thead th.wh-selector-sortable {
    padding-right: 24px !important;
}

table[data-pd-selector] thead th[data-key]::after {
    content: "↕";
    position: absolute;
    right: 5px;
    top: 50%;
    width: 12px;
    transform: translateY(-50%);
    color: var(--muted, #6b7280);
    opacity: .65;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}

table[data-pd-selector] thead th[data-key][data-sort="asc"]::after {
    content: "▲";
    color: var(--accent, #185abd);
    opacity: 1;
}

table[data-pd-selector] thead th[data-key][data-sort="desc"]::after {
    content: "▼";
    color: var(--accent, #185abd);
    opacity: 1;
}

table[data-pd-selector] thead th.wh-selector-sortable > .wh-selector-sort-indicator {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    width: 12px !important;
    min-width: 12px !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    flex: none !important;
}

table[data-pd-selector] thead th.wh-selector-sortable > .wh-selector-sort-indicator.is-idle {
    color: var(--muted, #6b7280);
    opacity: .65;
}

table[data-pd-selector] .wh-product-header-content {
    min-width: 0;
}

table[data-pd-selector] .wh-product-header-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table[data-pd-selector] .wh-product-header-icons,
table[data-pd-selector] .wh-sync-icon {
    flex: 0 0 auto;
}
