/* Kuiba Price Compare: product page block */
.kpc {
	--kpc-accent: #8c0014;
	--kpc-text: #111;
	--kpc-muted: #606060;
	--kpc-line: #e5e5e5;
	--kpc-tint: #f7f5f5;
	--kpc-diff: #fff4dc;
	--kpc-green: #0f834d;
	box-sizing: border-box;
	clear: both;
	/* Same box as the theme's product sections (.related.products, .upsells.products). */
	max-width: var(--kpc-max, calc(1170px + 5.2325em));
	margin: 48px auto;
	padding: 0 1em;
	color: var(--kpc-text);
	/* Below the fold: skip its layout until it is near the viewport. */
	content-visibility: auto;
	contain-intrinsic-size: auto 760px;
}

@media (min-width: 993px) {
	.kpc {
		padding: 0 2.617924em;
	}
}

.kpc__head {
	margin-bottom: 12px;
}

.kpc .kpc__title {
	margin: 0 0 4px;
	font-size: 24px;
	line-height: 1.25;
}

.kpc__sub {
	margin: 0;
	color: var(--kpc-muted);
	font-size: 14px;
}

/* CSS-only toggles: work before the (delayed) script runs. */
.kpc__toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	opacity: 0;
}

.kpc__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.kpc__chip {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	min-height: 40px;
	padding: 6px 14px;
	border: 1px solid var(--kpc-line);
	border-radius: 999px;
	background: #fff;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
}

.kpc__box {
	position: relative;
	width: 16px;
	height: 16px;
	border: 1px solid #999;
	border-radius: 3px;
	background: #fff;
}

.kpc__toggle--diff:checked ~ .kpc__bar .kpc__chip {
	border-color: var(--kpc-text);
}

.kpc__toggle--diff:checked ~ .kpc__bar .kpc__box {
	border-color: var(--kpc-accent);
	background: var(--kpc-accent);
}

.kpc__toggle--diff:checked ~ .kpc__bar .kpc__box::after {
	position: absolute;
	top: 1px;
	left: 4px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	content: "";
}

.kpc__toggle--diff:focus-visible ~ .kpc__bar .kpc__chip,
.kpc__toggle--all:focus-visible ~ .kpc__more {
	outline: 2px solid var(--kpc-text);
	outline-offset: 2px;
}

.kpc__toggle--diff:checked ~ .kpc__scroll .kpc-same-row {
	display: none;
}

/* Table */
.kpc__scroll:focus-visible {
	outline: 2px solid var(--kpc-text);
	outline-offset: 2px;
}

.kpc .kpc__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	font-size: 14px;
}

.kpc .kpc__table th,
.kpc .kpc__table td {
	padding: 10px 12px;
	border: 0;
	border-top: 1px solid var(--kpc-line);
	background: transparent;
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
}

.kpc .kpc__table thead th,
.kpc .kpc__table thead td {
	padding: 12px;
	border-top: 0;
	font-weight: 400;
}

.kpc .kpc__corner,
.kpc .kpc__table tbody th {
	width: 18%;
}

.kpc .kpc__table tbody th {
	color: var(--kpc-muted);
	font-weight: 400;
}

.kpc .kpc__table .kpc__product--current,
.kpc .kpc__table .kpc__cell--current {
	background: var(--kpc-tint);
}

.kpc .kpc__table .kpc__row:hover > * {
	background: #fafafa;
}

.kpc .kpc__table .kpc__row:hover > .kpc__cell--current {
	background: #efebeb;
}

.kpc .kpc__table td.kpc-diff {
	background: var(--kpc-diff);
	font-weight: 600;
}

.kpc__label-row {
	display: none;
}

/* Product cards */
.kpc__card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
	height: 100%;
}

.kpc__badge,
.kpc__delta {
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
}

.kpc__badge {
	background: var(--kpc-accent);
	color: #fff;
}

.kpc__delta {
	background: #ececec;
	color: #333;
}

.kpc__delta--less {
	background: #e5f3eb;
	color: var(--kpc-green);
}

.kpc__img {
	display: block;
	width: 100%;
	max-width: 140px;
}

.kpc__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
}

.kpc__name {
	display: -webkit-box;
	overflow: hidden;
	color: var(--kpc-text);
	font-weight: 600;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

a.kpc__name:hover {
	text-decoration: underline;
}

.kpc__price {
	font-size: 16px;
	font-weight: 600;
}

.kpc__price del {
	color: var(--kpc-muted);
	font-size: 13px;
	font-weight: 400;
}

.kpc__price ins {
	text-decoration: none;
}

.kpc__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	align-items: center;
	color: var(--kpc-muted);
	font-size: 13px;
}

.kpc__rating {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.kpc__rating .star-rating {
	float: none;
	margin: 0;
	font-size: 12px;
}

.kpc__stock {
	color: var(--kpc-green);
}

.kpc__buy {
	width: 100%;
	margin-top: auto;
}

.kpc .kpc__buy .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 8px 12px;
	font-size: 14px;
	text-align: center;
}

.kpc .kpc__buy .added_to_cart {
	display: block;
	margin-top: 6px;
	font-size: 13px;
}

.kpc .kpc__compare {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	justify-content: flex-start;
	width: auto;
	min-height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--kpc-muted);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.kpc .kpc__compare:hover,
.kpc .kpc__compare[aria-pressed="true"] {
	color: var(--kpc-accent);
}

.kpc__compare-on,
.kpc__compare[aria-pressed="true"] .kpc__compare-off {
	display: none;
}

.kpc__compare[aria-pressed="true"] .kpc__compare-on {
	display: inline;
}

/* Show all specifications */
.kpc__toggle--all:not(:checked) ~ .kpc__scroll .kpc-more {
	display: none;
}

.kpc__more {
	display: block;
	margin-top: 12px;
	padding: 12px;
	border: 1px solid var(--kpc-line);
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
}

.kpc__more:hover {
	border-color: var(--kpc-text);
}

.kpc__more--m,
.kpc__more-hide,
.kpc__toggle--all:checked ~ .kpc__more .kpc__more-show {
	display: none;
}

.kpc__toggle--all:checked ~ .kpc__more .kpc__more-hide {
	display: inline;
}

.kpc__nav {
	display: none;
}

/* Mobile: this product pinned on the left, one model at a time beside it. */
@media (max-width: 768px) {
	.kpc {
		--kpc-w: calc(100vw - 32px);
		margin: 32px auto;
		contain-intrinsic-size: auto 900px;
	}

	.kpc .kpc__title {
		font-size: 20px;
	}

	.kpc__sub {
		font-size: 13px;
	}

	.kpc__nav:not([hidden]) {
		display: flex;
		gap: 4px;
		align-items: center;
		margin-left: auto;
	}

	.kpc__arrow {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid var(--kpc-line);
		background: #fff;
		color: var(--kpc-text);
		cursor: pointer;
	}

	.kpc__arrow:disabled {
		opacity: 0.35;
		cursor: default;
	}

	.kpc__count {
		min-width: 44px;
		font-size: 14px;
		text-align: center;
	}

	.kpc__scroll {
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-left: calc(var(--kpc-w) * 0.42);
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.kpc__scroll::-webkit-scrollbar {
		display: none;
	}

	.kpc .kpc__table {
		width: auto;
		table-layout: auto;
		font-size: 13px;
	}

	/* No label column: each spec gets a caption line above its values, and every value sits in
	   its product's column. (Only one of the two labels is displayed, so screen readers get one.) */
	.kpc .kpc__corner,
	.kpc .kpc__table tbody th {
		display: none;
	}

	.kpc__label-row {
		display: table-row;
	}

	.kpc .kpc__table .kpc__label-row td {
		padding: 10px 0 2px;
		color: var(--kpc-muted);
		font-size: 12px;
	}

	.kpc__label-row span {
		position: sticky;
		left: 10px;
		display: inline-block;
	}

	.kpc .kpc__table .kpc__row td {
		padding: 2px 10px 10px;
		border-top: 0;
	}

	.kpc .kpc__table .kpc__product,
	.kpc .kpc__table .kpc__row td {
		width: calc(var(--kpc-w) * 0.5);
		min-width: calc(var(--kpc-w) * 0.5);
		max-width: calc(var(--kpc-w) * 0.5);
		padding-right: 10px;
		padding-left: 10px;
	}

	.kpc .kpc__table .kpc__product:not(.kpc__product--current) {
		scroll-snap-align: start;
	}

	/* A divider between models, so each column reads as one product with its specs under it. */
	.kpc .kpc__table .kpc__product + .kpc__product,
	.kpc .kpc__table .kpc__row td + td {
		border-left: 1px solid var(--kpc-line);
	}

	.kpc .kpc__table .kpc__product--current,
	.kpc .kpc__table .kpc__row .kpc__cell--current {
		position: sticky;
		left: 0;
		z-index: 1;
		width: calc(var(--kpc-w) * 0.42);
		min-width: calc(var(--kpc-w) * 0.42);
		max-width: calc(var(--kpc-w) * 0.42);
		box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.2);
	}

	.kpc__img {
		max-width: 80px;
	}

	.kpc__price {
		font-size: 15px;
	}

	.kpc__meta {
		font-size: 12px;
	}

	.kpc__toggle--all:not(:checked) ~ .kpc__scroll .kpc-more-m {
		display: none;
	}

	.kpc__more--m {
		display: block;
	}
}
