/* Comparison Table Module */

.comparison-table-section {
	width: 100%;
}

.comparison-table {
	--gap: 0;
	--col-radius: 18px;
	--table-radius: 28px;
	--table-padding: 0 30px;
	--data-col-count: 3;

	position: relative;
	display: grid;
	grid-template-columns: minmax(140px, max-content) repeat(var(--data-col-count), minmax(0, 1fr));
	column-gap: var(--gap);
	row-gap: 0;
	padding: var(--table-padding);
	background-color: rgba(255, 255, 255, 0.15);
	border-radius: var(--table-radius);
	align-items: stretch;
	width: 100%;
	box-sizing: border-box;
}

/* Column backgrounds — sit behind cells, span all rows */
.comparison-table .col-bg {
	z-index: 0;
	border-radius: var(--col-radius);
	pointer-events: none;
}

.comparison-table .col-bg.labels-bg {
	background-color: transparent;
	-webkit-backdrop-filter: blur(0px);
	backdrop-filter: blur(0px);
	border-radius: 0;

	@media (max-width: 767px) {
		& {
			background: rgb(52 106 176);
			background: linear-gradient(90deg, rgb(52 106 176), rgb(52 106 176 / 80%));
			-webkit-backdrop-filter: blur(3px);
			backdrop-filter: blur(3px);
		}
	}
}

.comparison-table .col-bg.data-bg {
	--outer-offset: 40px;
	--top-bottom: -20px;

	position: relative;
	background-image: linear-gradient(
		to bottom,
		var(--col-color-top, #0a2768),
		var(--col-color-bottom, #2660b4)
	);
	top: var(--top-bottom);
	bottom: var(--top-bottom);
	height: calc(100% + var(--outer-offset));
	margin-left: 6px;
	margin-right: 6px;

	&:nth-child(2) {
		margin-left: 0;
	}

	&:nth-child(3) {
		margin-right: 0;
	}

	@media (max-width: 767px) {
		& {
			margin: 0 !important;
		}
	}
}

/* Cells — sit on top of column backgrounds */
.comparison-table .cell {
	position: relative;
	z-index: 1;
	padding: 20px 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 70px;
	line-height: 1.25;
	word-break: break-word;
	box-sizing: border-box;
}

.comparison-table .cell .cell-value {
	display: block;
}

.comparison-table .cell.data-cell {
	color: #fff;
}

.comparison-table .cell.labels-cell {
	color: #fff;
	font-weight: 600;
	text-align: left;
	justify-content: flex-start;
	padding-left: 18px;
	padding-right: 20px;

	@media (min-width: 768px) {
		& {
			font-weight: 700;
			font-size: clamp(1.05rem, 1.6vw, 1.4rem);
		}
	}
}

/* Header row */
.comparison-table .cell.header {
	font-weight: 700;
	font-size: clamp(1.05rem, 1.6vw, 1.4rem);
	padding-top: 30px;
	padding-bottom: 30px;
	min-height: 90px;
}

/* Row dividers — bottom border on all cells except last row */
.comparison-table .cell.data-cell:not(.is-last-row) {
	border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.comparison-table .cell.labels-cell:not(.is-last-row) {
	border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

/* Mobile — horizontal scroll with sticky labels column */
@media (max-width: 767px) {
	.comparison-table {
		--table-padding: 0;
		--gap: 0;
		--table-radius: 10px;

		grid-template-columns: minmax(110px, 28vw) repeat(var(--data-col-count), minmax(180px, 50vw));
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		-ms-overflow-style: none;
		scrollbar-width: none;
		overflow: -moz-scrollbars-none;
		overscroll-behavior: none;

		&::-webkit-scrollbar,
		&::-moz-scrollbar {
			width: 0px;
			background: transparent;
			display: none;
		}
	}

	.comparison-table .col-bg.labels-bg,
	.comparison-table .cell.labels-cell {
		position: sticky;
		left: 0;
	}

	.comparison-table .col-bg.labels-bg {
		z-index: 2;
	}

	.comparison-table .cell.labels-cell {
		z-index: 3;
	}

	.comparison-table .cell.header {
		font-size: 1.05rem;
		padding-top: 22px;
		padding-bottom: 22px;
		min-height: 70px;
	}

	.comparison-table .cell {
		padding: 16px 14px;
	}

	.comparison-table .cell.labels-cell {
		padding-left: 18px;
		padding-right: 12px;
	}
}
