/* ---- WCPT batched filter Apply controls -------------------------- *
 *
 * Companion CSS for the wcpt-batch-filter module. Lives at the top
 * of .wcpt-navigation, visible only when a filter is dirty.
 */

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-controls {
	display: flex;
	gap: 8px;
	padding: 8px 12px;
	margin: 0 0 12px 0;
	background: #f4f5f7;
	border-bottom: 1px solid #e0e0e0;
	position: sticky;
	top: 0;
	z-index: 5;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-apply,
[data-wcpt-table-id] .wcpt-navigation .tvc-batch-clear {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #ccd0d6;
	border-radius: 4px;
	background: #fff;
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-apply {
	/* Apply is the primary action when there are pending changes. */
	background: #0d1f3a;
	border-color: #0d1f3a;
	color: #fff;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-apply:hover:not(:disabled) {
	background: #08152a;
	border-color: #08152a;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-apply:disabled {
	background: #d9dce1;
	border-color: #d9dce1;
	color: #7a7d83;
	cursor: not-allowed;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-apply.is-dirty {
	/* Pulse subtly to draw attention when there are unapplied changes. */
	box-shadow: 0 0 0 0 rgba(13, 31, 58, 0.4);
	animation: tvc-batch-pulse 1.6s ease-out infinite;
}

@keyframes tvc-batch-pulse {
	0%   { box-shadow: 0 0 0 0   rgba(13, 31, 58, 0.4); }
	70%  { box-shadow: 0 0 0 6px rgba(13, 31, 58, 0); }
	100% { box-shadow: 0 0 0 0   rgba(13, 31, 58, 0); }
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-clear:hover {
	background: #f7f8fa;
	border-color: #aab0b8;
}

[data-wcpt-table-id] .wcpt-navigation .tvc-batch-count {
	margin-left: 4px;
	font-size: 12px;
	font-weight: 400;
	opacity: 0.85;
}

/* Phone view: stack the buttons vertically (sidebar is narrower). */
[data-wcpt-table-id] .wcpt-table-scroll-wrapper-outer.wcpt-device-phone ~ * .tvc-batch-controls,
[data-wcpt-table-id] .wcpt-nav-modal .tvc-batch-controls {
	flex-direction: column;
}
