/* Horizontal scroll wrapper */
.wpps-list-table-scroll-container {
	position: relative;
	width: 100%;
}

/* Full-width list table when horizontal scroll is disabled — columns split evenly. */
body.wpps-acc-no-h-scroll #wpbody-content .wrap {
	max-width: 100%;
}

body.wpps-acc-no-h-scroll .wp-list-table.widefat {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
}

body.wpps-acc-no-h-scroll .wp-list-table.widefat th,
body.wpps-acc-no-h-scroll .wp-list-table.widefat td {
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

body.wpps-acc-no-h-scroll .wp-list-table.widefat th.check-column,
body.wpps-acc-no-h-scroll .wp-list-table.widefat td.check-column {
	width: 2.2em;
	max-width: 2.2em;
	min-width: 2.2em;
}

body.wpps-acc-no-h-scroll .wp-list-table.widefat .column-primary .row-title,
body.wpps-acc-no-h-scroll .wp-list-table.widefat .column-title .row-title {
	white-space: normal;
}

/* Prevent layout jump: hide unwrapped table until moved into the scroll wrapper. */
body.wpps-acc-h-scroll .wrap .wp-list-table.widefat {
	display: none;
}

body.wpps-acc-h-scroll #wpps-list-table-wrapper .wp-list-table.widefat {
	display: table;
}

#wpps-list-table-wrapper {
	position: relative;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden !important;
	width: 100%;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	scrollbar-gutter: stable;
}

.wpps-list-table-scroll-shadow {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 16px;
	width: 30px;
	background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 10;
}

.wpps-list-table-scroll-container.has-scroll .wpps-list-table-scroll-shadow {
	opacity: 1;
}

#wpps-list-table-wrapper .wp-list-table.widefat {
	border: none;
	box-shadow: none;
	margin: 0;
	display: table;
	table-layout: auto;
	width: auto;
	min-width: 100%;
}

#wpps-list-table-wrapper .wp-list-table th:not(.column-cb):not(.check-column),
#wpps-list-table-wrapper .wp-list-table td:not(.column-cb):not(.check-column) {
	min-width: 150px;
}

#wpps-list-table-wrapper::-webkit-scrollbar {
	height: 16px;
}

#wpps-list-table-wrapper::-webkit-scrollbar-track {
	background: linear-gradient(to bottom, #fafbfc, #f1f3f5);
	border-top: 1px solid #e1e4e8;
	border-bottom: 1px solid #e1e4e8;
}

#wpps-list-table-wrapper::-webkit-scrollbar-thumb {
	background: linear-gradient(to bottom, #d0d7de, #a8b2bc);
	border: 1px solid #8c959f;
	border-radius: 6px;
}

#wpps-list-table-wrapper::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(to bottom, #b8c2cc, #9099a3);
}

/* Sticky header row */
.wp-list-table.wpps-acc-freeze-header-row > thead {
	position: relative;
	z-index: 4;
	will-change: transform;
}

.wp-list-table.wpps-acc-freeze-header-row > thead > tr > th,
.wp-list-table.wpps-acc-freeze-header-row > thead > tr > td {
	background: #fff;
	position: relative;
	z-index: 5;
}

#wpps-list-table-wrapper > table.wpps-acc-freeze-header-row > thead {
	position: relative;
	z-index: 4;
	will-change: transform;
}

#wpps-list-table-wrapper > table.wpps-acc-freeze-header-row > thead > tr > .wpps-acc-frozen {
	z-index: 6;
}

/* Frozen columns */
#wpps-list-table-wrapper > table > thead > tr > .wpps-acc-frozen,
#wpps-list-table-wrapper > table > tbody > tr > .wpps-acc-frozen,
#wpps-list-table-wrapper > table > tfoot > tr > .wpps-acc-frozen {
	position: sticky;
	z-index: 2;
}

#wpps-list-table-wrapper > table > thead > tr > .wpps-acc-frozen,
#wpps-list-table-wrapper > table > tfoot > tr > .wpps-acc-frozen {
	z-index: 3;
	background: #fff;
}

#wpps-list-table-wrapper > table > tbody > tr:nth-child(odd) > .wpps-acc-frozen {
	background: #f6f7f7;
}

#wpps-list-table-wrapper > table > tbody > tr:nth-child(even) > .wpps-acc-frozen {
	background: #fff;
}

#wpps-list-table-wrapper > table > thead > tr > .wpps-acc-last-frozen,
#wpps-list-table-wrapper > table > tbody > tr > .wpps-acc-last-frozen,
#wpps-list-table-wrapper > table > tfoot > tr > .wpps-acc-last-frozen {
	border-right: 1px solid #c3c4c7;
}
