/* WCP Compare Products — v2 (zelfstandige CSS, Bootstrap-vrij, v2-tokens).
   Vervangt de oude _compare_products.scss (Bootstrap-variabelen, alleen bruikbaar
   met de legacy shared SCSS-build); legacy shops die die build nog gebruiken
   negeren dit bestand. */

/* ── Vergelijk-knop in de productloop ──────────────────────────────────────
   Rendert binnen .wcp-loop-thumb (position: relative, zie loop.css), dus
   absoluut gepositioneerd linksonder op de productafbeelding. */
.wcp-compare-btn {
	position: absolute;
	bottom: 0.5rem;
	left: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.25rem 0.5rem;
	font-size: 0.7rem;
	font-weight: var(--wcp-font-weight-semibold);
	line-height: 1;
	background-color: rgba(255, 255, 255, 0.92);
	color: var(--wcp-color-text);
	border: var(--wcp-border-width) solid var(--wcp-color-border);
	border-radius: var(--wcp-radius-sm);
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.wcp-compare-btn__icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='3' width='14' height='1' rx='0.5' fill='%23212529'/%3E%3Crect x='7.5' y='4' width='1' height='9' rx='0.5' fill='%23212529'/%3E%3Crect x='5' y='13' width='6' height='1' rx='0.5' fill='%23212529'/%3E%3Crect x='2' y='4' width='0.75' height='4' rx='0.375' fill='%23212529'/%3E%3Crect x='13.25' y='4' width='0.75' height='4' rx='0.375' fill='%23212529'/%3E%3Cpath d='M1 8 Q3 11 5 8 Z' fill='%23212529'/%3E%3Cpath d='M11 8 Q13 11 15 8 Z' fill='%23212529'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	transition: opacity 0.15s ease;
}
.wcp-compare-btn:hover {
	background-color: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.wcp-compare-btn.active {
	background-color: var(--wcp-color-primary);
	border-color: var(--wcp-color-primary);
	color: #fff;
}
.wcp-compare-btn.active .wcp-compare-btn__icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='3' width='14' height='1' rx='0.5' fill='white'/%3E%3Crect x='7.5' y='4' width='1' height='9' rx='0.5' fill='white'/%3E%3Crect x='5' y='13' width='6' height='1' rx='0.5' fill='white'/%3E%3Crect x='2' y='4' width='0.75' height='4' rx='0.375' fill='white'/%3E%3Crect x='13.25' y='4' width='0.75' height='4' rx='0.375' fill='white'/%3E%3Cpath d='M1 8 Q3 11 5 8 Z' fill='white'/%3E%3Cpath d='M11 8 Q13 11 15 8 Z' fill='white'/%3E%3C/svg%3E");
}
.wcp-compare-btn.active:hover {
	filter: brightness(1.1);
}

/* ── Zwevende balk: tab (mobiel) + kaart (altijd vanaf 48rem) ──────────── */
.wcp-compare-bar.hidden .wcp-compare-bar__tab,
.wcp-compare-bar.hidden .wcp-compare-bar__card {
	opacity: 0 !important;
	pointer-events: none !important;
}
.wcp-compare-bar.below-footer .wcp-compare-bar__tab,
.wcp-compare-bar.below-footer .wcp-compare-bar__card {
	opacity: 0 !important;
	pointer-events: none !important;
}

.wcp-compare-bar__tab {
	position: fixed;
	left: 0;
	top: 50%;
	z-index: var(--wcp-z-floating);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	background-color: var(--wcp-color-primary);
	color: #fff;
	border: none;
	border-radius: 0 var(--wcp-radius) var(--wcp-radius) 0;
	padding: 0.85rem 0.5rem;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	opacity: 1;
	transform: translateY(-50%) translateX(0);
	pointer-events: auto;
	transition: opacity 0.25s ease, transform 0.25s ease, filter 0.15s ease;
}
.wcp-compare-bar.is-open .wcp-compare-bar__tab {
	opacity: 0;
	transform: translateY(-50%) translateX(-100%);
	pointer-events: none;
}
.wcp-compare-bar__tab:hover {
	filter: brightness(0.9);
}
@media (min-width: 48rem) {
	.wcp-compare-bar__tab {
		display: none !important;
	}
}

.wcp-compare-bar__tab-label {
	font-size: 0.7rem;
	font-weight: var(--wcp-font-weight-semibold);
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	letter-spacing: 0.03em;
	white-space: nowrap;
}
.wcp-compare-bar__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.2rem;
	height: 1.2rem;
	font-size: 0.65rem;
	font-weight: var(--wcp-font-weight-bold);
	background-color: #fff;
	color: var(--wcp-color-primary);
	border-radius: 50%;
	flex-shrink: 0;
}

/* Kaart onderin */
.wcp-compare-bar__card {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: var(--wcp-z-floating);
	display: flex;
	flex-direction: column;
	width: 300px;
	background-color: var(--wcp-color-surface);
	border: var(--wcp-border-width) solid var(--wcp-color-border);
	border-radius: var(--wcp-radius);
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
	padding: 0.75rem;
	opacity: 0;
	transform: translateY(0.75rem);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.wcp-compare-bar.is-open .wcp-compare-bar__card {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
@media (min-width: 48rem) {
	.wcp-compare-bar__card {
		opacity: 1;
		transform: translateY(0);
		pointer-events: auto;
	}
}
@media (max-width: 36rem) {
	.wcp-compare-bar__card {
		right: 0.5rem;
		bottom: 0.5rem;
		left: 0.5rem;
		width: auto;
	}
}

.wcp-compare-bar__card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.6rem;
}
.wcp-compare-bar__title {
	font-weight: var(--wcp-font-weight-semibold);
	font-size: var(--wcp-font-size-sm);
}
.wcp-compare-bar__products {
	display: flex;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
}
.wcp-compare-bar__card-footer {
	display: flex;
	gap: 0.4rem;
}
.wcp-compare-bar__cta {
	flex: 1 1 auto;
}
.wcp-compare-bar__clear {
	flex-shrink: 0;
	border: 0;
	background: transparent;
	color: var(--wcp-color-muted);
	font-size: var(--wcp-font-size-sm);
	cursor: pointer;
	padding: 0 0.25rem;
}
.wcp-compare-bar__clear:hover {
	color: var(--wcp-color-text);
	text-decoration: underline;
}

.wcp-compare-bar__item {
	position: relative;
	flex: 1;
	aspect-ratio: 1;
	border-radius: var(--wcp-radius-sm);
	overflow: hidden;
	border: var(--wcp-border-width) solid var(--wcp-color-border);
	background-color: var(--wcp-color-surface);
	display: flex;
	align-items: center;
	justify-content: center;
}
.wcp-compare-bar__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.wcp-compare-bar__name {
	font-size: 0.6rem;
	padding: 0.15rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
	line-height: 1.2;
}
.wcp-compare-bar__remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	background-color: rgba(255, 255, 255, 0.9);
	border: 0;
	border-radius: 50%;
	padding: 0;
	font-size: 0;
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.15s ease;
}
.wcp-compare-bar__remove::before,
.wcp-compare-bar__remove::after {
	content: "";
	position: absolute;
	left: 3px;
	right: 3px;
	top: 50%;
	height: 1.5px;
	background: var(--wcp-color-text);
}
.wcp-compare-bar__remove::before { transform: rotate(45deg); }
.wcp-compare-bar__remove::after { transform: rotate(-45deg); }
.wcp-compare-bar__item:hover .wcp-compare-bar__remove {
	opacity: 1;
}
.wcp-compare-bar__item--empty {
	border-style: dashed;
	background-color: transparent;
	opacity: 0.35;
}
.wcp-compare-bar__placeholder {
	display: block;
	width: 16px;
	height: 16px;
	border: 2px dashed var(--wcp-color-border);
	border-radius: 50%;
}

/* ── Vergelijkmodal (native <dialog>, zie wcp-ui.css dialog.wcp-dialog) ─── */
#wcp-compare-modal.wcp-dialog {
	width: var(--wcp-compare-modal-width, min(900px, calc(100% - 2rem)));
	max-width: calc(100% - 2rem);
}
.wcp-compare-modal__body {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0;
}

.wcp-compare-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
}
.wcp-compare-loading .svg-icon__loading {
	width: 1.75rem;
	height: 1.75rem;
	animation: wcp-compare-spin 0.8s linear infinite;
}
@keyframes wcp-compare-spin {
	to { transform: rotate(360deg); }
}

.wcp-compare-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.wcp-compare-table {
	width: auto;
	table-layout: fixed;
	border-collapse: collapse;
}
.wcp-compare-table th,
.wcp-compare-table td {
	border: 0;
	border-bottom: var(--wcp-border-width) solid var(--wcp-color-border);
	vertical-align: middle;
	padding: 0.4rem 0.75rem;
	line-height: 1.3;
}
.wcp-compare-table tbody tr {
	transition: background-color 0.12s ease;
}
.wcp-compare-table tbody tr:hover td {
	background-color: color-mix(in srgb, var(--wcp-color-primary) 4%, transparent);
}
.wcp-compare-table tbody tr:last-child td {
	border-bottom: 0;
}
.wcp-compare-table thead th {
	border-bottom: 2px solid var(--wcp-color-border);
	text-align: center;
	background-color: var(--wcp-color-surface);
	padding: 0.85rem 0.75rem 0.65rem;
}

.wcp-compare-label-col {
	position: sticky;
	left: 0;
	z-index: 2;
	width: 100px;
	min-width: 80px;
	background-color: var(--wcp-color-surface);
	border-right: var(--wcp-border-width) solid var(--wcp-color-border);
}
.wcp-compare-table tbody tr:hover .wcp-compare-label-col {
	background-color: var(--wcp-color-surface-alt);
}
.wcp-compare-table thead .wcp-compare-label-col {
	z-index: 3;
	background-color: transparent;
	border-right: 0;
}
.wcp-compare-row-label {
	font-size: 0.7rem;
	font-weight: var(--wcp-font-weight-semibold);
	color: var(--wcp-color-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.wcp-compare-product-col {
	width: 200px;
	text-align: center;
	vertical-align: top;
	height: 1px;
}
.wcp-compare-th-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	height: 100%;
	padding-bottom: 0.15rem;
}
.wcp-compare-th-inner .wcp-compare-th-btn {
	margin-top: auto;
}
.wcp-compare-th-image img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	object-position: center;
	display: block;
	background-color: var(--wcp-color-surface);
	border: var(--wcp-border-width) solid var(--wcp-color-border);
	border-radius: var(--wcp-radius-sm);
	padding: 0.2rem;
	transition: box-shadow 0.15s ease;
}
.wcp-compare-th-image img:hover {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.wcp-compare-th-name {
	font-size: 0.75rem;
	font-weight: var(--wcp-font-weight-semibold);
	line-height: 1.3;
	color: var(--wcp-color-text);
}
.wcp-compare-th-btn {
	white-space: nowrap;
	font-size: 0.7rem;
	padding: 0.2rem 0.5rem;
}
.wcp-compare-row-price td:not(.wcp-compare-label-col) {
	font-size: 0.9rem;
	font-weight: var(--wcp-font-weight-bold);
	color: var(--wcp-color-primary);
	text-align: center;
}
.wcp-compare-table tbody tr td:not(.wcp-compare-label-col) {
	text-align: center;
	font-size: 0.8rem;
	line-height: 1.2;
	color: var(--wcp-color-text);
}
