/* ==========================================================================
   Product Compare
   ========================================================================== */

/* ── Toggle button (shared base) ───────────────────────────────────────── */

.kw-compare-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 0;
	padding: 0;
	margin: 0;
	line-height: 1;
	background: none;
	border: none;
	border-radius: 50%;
	color: #99A1AF;
	cursor: pointer;
	transition: color 0.2s, transform 0.15s, background-color 0.2s;
}

.kw-compare-btn:hover {
	color: #3b82f6;
	background-color: rgba(59, 130, 246, 0.08);
}

.kw-compare-btn:active {
	transform: scale(0.88);
}

.kw-compare-btn.is-active {
	color: #3b82f6;
	animation: kw-compare-pop 0.35s ease;
}

.kw-compare-btn.is-active .kw-compare-btn__icon {
	fill: rgba(59, 130, 246, 0.15);
}

.kw-compare-btn.is-loading {
	pointer-events: none;
	opacity: 0.5;
}

@keyframes kw-compare-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.25); }
	100% { transform: scale(1); }
}

/* ── Archive / product-card variant (inline in toolbar row) ─────────────── */

.kw-compare-btn--card {
	position: static;
	width: 32px;
	height: 32px;
}

.kw-compare-btn--card .kw-compare-btn__icon {
	width: 16px;
	height: 16px;
}

/* ── Single-product variant (labelled pill) ────────────────────────────── */

.kw-compare-btn--single {
	width: auto;
	height: auto;
	padding: 0.5rem 1rem;
	gap: 0.375rem;
	border-radius: 8px;
	border: 1px solid #dee2e6;
	font-size: 0.8125rem;
	font-weight: 600;
}

.kw-compare-btn--single::after {
	content: attr(aria-label);
}

.kw-compare-btn--single:hover {
	border-color: #3b82f6;
}

.kw-compare-btn--single .kw-compare-btn__icon {
	width: 18px;
	height: 18px;
}

/* ── Header element (icon + count badge) ───────────────────────────────── */

.header-kw-compare-icon {
	list-style: none;
}

#header .header-kw-compare-icon .kw-compare-link,
.header-kw-compare-icon .kw-compare-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #99A1AF;
	line-height: 1;
	transition: color 0.2s;
}

#header .header-kw-compare-icon .kw-compare-link__icon,
.header-kw-compare-icon .kw-compare-link__icon {
	stroke: #99A1AF;
}

#header .header-kw-compare-icon .kw-compare-link:hover,
.header-kw-compare-icon .kw-compare-link:hover {
	color: #3b82f6;
}

#header .header-kw-compare-icon .kw-compare-link:hover .kw-compare-link__icon,
.header-kw-compare-icon .kw-compare-link:hover .kw-compare-link__icon {
	stroke: #3b82f6;
}

.header-kw-compare-icon .kw-compare-link__icon {
	width: 22px;
	height: 22px;
}

.kw-compare-count {
	position: absolute;
	top: -4px;
	right: -4px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1;
	background-color: #3b82f6;
	color: #fff;
	border-radius: 9px;
	pointer-events: none;
}

/* ── Bar ───────────────────────────────────────────────────────────────── */

.kw-compare-bar {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 14px;
	padding-bottom: 30px;
	border-bottom: 1px solid #CFCFCF;
}

.kw-compare-bar--empty {
	display: none;
}

.kw-compare-bar__heading {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.kw-compare-bar__heading-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 2px;
	color: #99A1AF;
}

.kw-compare-bar__heading-text {
	display: flex;
	flex-direction: column;
}

.kw-compare-bar__title {
	margin: 0;
	white-space: nowrap;
	color: #222;
	font-weight: 600;
}

.kw-compare-bar__clear {
	font-size: 13px;
	color: #5C5D60;
	text-decoration: underline;
	white-space: nowrap;
}

.kw-compare-bar__clear:hover {
	color: #222;
}

.kw-compare-bar__pills {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	overflow: auto;
	padding: 2px 0;
}

.kw-compare-bar__pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	border: 1.03px solid #00000030;
	border-radius: 10px;
	background: #fff;
	white-space: nowrap;
}

.kw-compare-bar__pill-title {
	font-size: 15px;
	font-weight: 700;
	color: #5C5D60;
	line-height: 1;
}

.kw-compare-bar__pill-remove {
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	opacity: .7;
}

.kw-compare-bar__pill-remove:hover {
	opacity: 1;
}

.kw-compare-bar__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 10px;
	background: #222;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.kw-compare-bar__btn:hover {
	filter: brightness(.95);
	color: #fff;
}

/* ── Table ─────────────────────────────────────────────────────────────── */

#kw-compare-popup {
	border-radius: 17px;
	margin-bottom: 40px;
}

#kw-compare-popup .kw-compare-table {
	overflow: auto;
}

#kw-compare-popup .kw-compare-table .kw-compare-table__wrap {
	width: fit-content;
}

.kw-compare-table {
	width: 100%;
	margin-top: 24px;
}

.kw-compare-table__loading,
.kw-compare-table__empty {
	padding: 18px;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	background: #fff;
}

.kw-compare-table__products {
	display: grid;
	grid-template-columns: repeat(var(--kw-cols), minmax(220px, 1fr));
	gap: 22px;
	align-items: start;
}

.kw-compare-table__product {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

.kw-compare-table__product-img {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

.kw-compare-table__product-img img {
	width: 100%;
	height: auto;
	display: block;
}

.kw-compare-table__remove {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, .15);
	background: #fff;
	cursor: pointer;
	line-height: 1;
	font-size: 18px;
	opacity: .9;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kw-compare-table__remove::before {
	content: '\00d7';
	font-size: 20px;
	line-height: 1;
	color: #333;
}

.kw-compare-table__remove:hover {
	opacity: 1;
}

.kw-compare-table__title {
	font-weight: 700;
	font-size: 16px;
	color: #39383D;
	text-decoration: none;
	line-height: 1.25;
	text-align: center;
}

.kw-compare-table__title:hover {
	text-decoration: underline;
}

.kw-compare-table__price {
	font-weight: 700;
}

.kw-compare-table__price del {
	opacity: .45;
	margin-left: 6px;
}

.kw-compare-table__price ins {
	text-decoration: none;
}

.kw-compare-table__specs {
	margin-top: 26px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.kw-compare-table__spec-title {
	font-weight: 700;
	color: #111;
	margin-bottom: 10px;
	position: sticky;
	left: 0;
	width: fit-content;
}

.kw-compare-table__spec-values {
	display: grid;
	grid-template-columns: repeat(var(--kw-cols), minmax(220px, 1fr));
	background: #f3f3f3;
	border-radius: 12px;
	gap: 22px;
	width: fit-content;
	min-width: 100%;
}

.kw-compare-table__cell-inner {
	padding: 16px 16px;
	min-height: 48px;
	display: flex;
	align-items: center;
	position: relative;
}

.kw-compare-table__cell-inner:after {
	content: '';
	position: absolute;
	background: #27282A36;
	top: 10px;
	bottom: 10px;
	right: -11px;
	width: 1px;
}

.kw-compare-table__cell:last-child .kw-compare-table__cell-inner:after {
	display: none;
}

/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 849px) {
	.kw-compare-bar {
		border: 1.03px solid #00000030;
		justify-content: space-between;
		border-radius: 10px;
		padding: 5px;
		padding-left: 10px;
	}

	.kw-compare-bar__pills {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kw-compare-btn {
		transition: none;
		animation: none;
	}
}
