/**
 * Mobile specification comparison — premium, restrained winner emphasis.
 *
 * @package NewTechPrice
 */

.ntp-compare-spec-winner {
	background: linear-gradient(
		120deg,
		rgb(240 253 244 / 0.35),
		rgb(236 253 245 / 0.22)
	);
	box-shadow: inset 2px 0 0 0 rgb(16 185 129 / 0.22);
}

[data-theme='dark'] .ntp-compare-spec-winner {
	background: linear-gradient(
		120deg,
		rgb(6 78 59 / 0.2),
		rgb(2 44 34 / 0.12)
	);
	box-shadow: inset 2px 0 0 0 rgb(52 211 153 / 0.2);
}

/* Full-width spec table on sm+; fluid min-width above phone triple mode */
.ntp-mobile-compare-spec {
	min-width: min(100%, 36rem);
}

/**
 * Three-device comparisons under 640px: exactly two device columns visible;
 * third is swapped via pair tabs + horizontal swipe (no page-level horizontal overflow).
 */
@media (max-width: 639px) {
	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-mobile-compare-spec,
	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-compare-metrics {
		min-width: 0;
		width: 100%;
		table-layout: fixed;
	}

	/* Contain scroll to the compare module — no document sideways drift */
	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-compare-spec-scroll {
		overflow-x: hidden;
		overflow-y: visible;
		overscroll-behavior-x: contain;
		touch-action: pan-y;
	}

	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-mobile-compare-spec th:first-child,
	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-mobile-compare-spec td:first-child {
		width: 32%;
		min-width: 0;
		max-width: 10rem;
	}

	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-mobile-compare-spec th[data-ntp-compare-dcol],
	.ntp-compare--triple.ntp-compare-mobile-narrow .ntp-mobile-compare-spec td[data-ntp-compare-dcol] {
		min-width: 0;
		width: 34%;
		vertical-align: top;
		word-break: break-word;
	}

	.ntp-compare--triple.ntp-compare-mobile-narrow.ntp-compare-pair--01 [data-ntp-compare-dcol='2'],
	.ntp-compare--triple.ntp-compare-mobile-narrow.ntp-compare-pair--12 [data-ntp-compare-dcol='0'],
	.ntp-compare--triple.ntp-compare-mobile-narrow.ntp-compare-pair--02 [data-ntp-compare-dcol='1'] {
		display: none !important;
	}

	/* Pair picker: scroll-snap for fast thumb access */
	.ntp-compare-mobile-pair-tabs .no-scrollbar {
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 0.25rem;
	}

	.ntp-compare-mobile-pair-tabs [data-ntp-compare-pair] {
		scroll-snap-align: start;
	}
}
