/* Iluproff compare (module compare). Colours: child theme variables, fallbacks for safety. */

/* ---------- Card: heart and compare in one white pill (top right of the photo) ---------- */
.wd-product.wd-hover-standard .wd-buttons.wd-pos-r-t {
	border-radius: 999px;
}

.wd-product .wd-buttons .wd-wishlist-btn {
	order: -1;
}

/* Divider between the two: the heart comes after compare in the markup but is shown first (order: -1), so the line
   goes on top of the compare icon, not of the heart. */
.wd-product .wd-buttons:has(.wd-wishlist-btn) .wd-compare-btn {
	border-top: 1px solid rgb(1 37 97 / 8%);
}

.wd-product .wd-buttons .wd-compare-btn > a.added {
	color: var(--ilu-navy, #012561);
}

/* Woodmart hides the card compare icon up to 1024px (only the heart stays); we compare on phones too. */
@media (max-width: 1024px) {
	.wd-product .wd-buttons .wd-compare-btn {
		display: flex;
	}
}

/* ---------- Product page: «Lisa lemmikutesse» and «Lisa võrdlusse» in one row ---------- */
.summary-inner > .wd-wishlist-btn,
.summary-inner > .wd-compare-btn {
	display: inline-flex;
	vertical-align: middle;
	margin-block-end: 14px;
}

.summary-inner > .wd-wishlist-btn + .wd-compare-btn {
	margin-inline-start: 24px;
}

.summary-inner > .wd-compare-btn + .ilu-product-question,
.summary-inner > .wd-wishlist-btn + .ilu-product-question {
	display: block;
}

.summary-inner > .wd-compare-btn > a,
.summary-inner > .wd-wishlist-btn > a {
	font-weight: 600;
}

.summary-inner > .wd-compare-btn.wd-action-btn > a.added {
	color: var(--ilu-navy, #012561);
	text-decoration: underline;
	text-decoration-color: rgb(1 37 97 / 30%);
	text-underline-offset: 4px;
}

/* ---------- Header on the phone: compare icon between the phone and the heart, always shown ---------- */
.whb-ilucomparemobile {
	display: flex;
}

/* One more icon on narrow phones: tighter icons and a slightly smaller logo, so the menu button stays on screen. */
@media (max-width: 420px) {
	.whb-column_mobile4 .wd-tools-element > a {
		padding-inline: 4px;
	}

	.whb-column_mobile4 .wd-tools-element:last-child > a {
		padding-inline-end: 0;
	}

	/* The header builder sets max-width inline, the child theme a fixed width. */
	.whb-ilulogomobile img {
		width: min(112px, 27vw) !important;
	}
}

/* ---------- Notice after «Lisa võrdlusse» ---------- */
.ilu-cmp-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100050;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: start;
	gap: 10px 14px;
	width: min(460px, calc(100vw - 32px));
	padding: 16px 12px 16px 16px;
	border-radius: 12px;
	background: #fff;
	color: var(--ilu-ink, #121212);
	box-shadow: 0 18px 44px rgb(1 37 97 / 18%), 0 2px 8px rgb(1 37 97 / 8%);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1), visibility .25s;
}

.ilu-cmp-toast.is-shown {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.ilu-cmp-toast-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ilu-navy, #012561) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.ilu-cmp-toast.is-separate .ilu-cmp-toast-icon {
	background-color: #8a5a00;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}

.ilu-cmp-toast-body strong {
	display: block;
	font-size: 14px;
	line-height: 1.3;
}

.ilu-cmp-toast-body p {
	margin: 3px 0 0;
	color: var(--ilu-muted, #6b6b73);
	font-size: 13px;
	line-height: 1.4;
}

.ilu-cmp-toast-cta {
	grid-column: 2;
	justify-self: start;
	padding: 9px 14px;
	border-radius: 8px;
	background: var(--ilu-navy, #012561);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.ilu-cmp-toast-cta:hover,
.ilu-cmp-toast-cta:focus-visible {
	background: #0a3a8c;
	color: #fff;
}

.ilu-cmp-toast .ilu-cmp-toast-close {
	grid-row: 1;
	grid-column: 3;
	width: 32px;
	height: 32px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--ilu-muted, #6b6b73);
	font-size: 22px;
	line-height: 1;
}

.ilu-cmp-toast .ilu-cmp-toast-close:hover,
.ilu-cmp-toast .ilu-cmp-toast-close:focus-visible {
	background: #f1f2f6;
	color: var(--ilu-ink, #121212);
}

@media (max-width: 768px) {
	.ilu-cmp-toast {
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		left: 12px;
		width: auto;
	}

	/* Above the sticky «Lisa ostukorvi» bar on the product page. */
	body:has(.wd-sticky-btn.wd-sticky-btn-shown) .ilu-cmp-toast {
		bottom: calc(var(--wd-sticky-btn-height, 68px) + 12px + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Compare page ---------- */
.ilu-cmp {
	--ilu-cmp-label: 190px;
	--ilu-cmp-col: 236px;
	margin: 0 0 48px;
	transition: opacity .2s ease;
}

.ilu-cmp.is-loading {
	opacity: .45;
	pointer-events: none;
}

.ilu-cmp-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 12px;
	padding: 2px 0 6px;
	overflow-x: auto;
	scrollbar-width: none;
}

.ilu-cmp-tabs::-webkit-scrollbar {
	display: none;
}

.ilu-cmp-tab {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	padding: 9px 14px 9px 16px;
	border: 1px solid var(--ilu-line, #e6e6ea);
	border-radius: 999px;
	background: #fff;
	color: var(--ilu-ink, #121212);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.ilu-cmp-tab:hover {
	border-color: var(--ilu-navy, #012561);
	color: var(--ilu-navy, #012561);
}

.ilu-cmp-tab.is-active {
	border-color: var(--ilu-navy, #012561);
	background: var(--ilu-navy, #012561);
	color: #fff;
}

.ilu-cmp-tab-count {
	min-width: 22px;
	padding: 2px 6px;
	border-radius: 999px;
	background: #eef1f7;
	color: var(--ilu-navy, #012561);
	font-size: 12px;
	text-align: center;
}

.ilu-cmp-tab.is-active .ilu-cmp-tab-count {
	background: rgb(255 255 255 / 18%);
	color: #fff;
}

.ilu-cmp-group[hidden] {
	display: none !important;
}

.ilu-cmp-group + .ilu-cmp-group {
	margin-top: 40px;
}

.ilu-cmp-note {
	margin: 0 0 26px;
	color: var(--ilu-muted, #6b6b73);
	font-size: 14px;
}

.ilu-cmp-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin: 0 0 14px;
}

.ilu-cmp-title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
}

.ilu-cmp-sub {
	margin-inline-start: 6px;
	color: var(--ilu-muted, #6b6b73);
	font-size: 15px;
	font-weight: 400;
}

.ilu-cmp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	font-size: 14px;
}

.ilu-cmp .ilu-cmp-more,
.ilu-cmp .ilu-cmp-clear {
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ilu-navy, #012561);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-decoration-color: rgb(1 37 97 / 25%);
	text-underline-offset: 4px;
}

.ilu-cmp .ilu-cmp-clear {
	color: var(--ilu-muted, #6b6b73);
	text-decoration-color: rgb(0 0 0 / 15%);
}

.ilu-cmp .ilu-cmp-more:hover,
.ilu-cmp .ilu-cmp-clear:hover {
	background: none;
	color: var(--ilu-navy, #012561);
	text-decoration-color: currentColor;
}

.ilu-cmp-more::before {
	content: "+ ";
}

.ilu-cmp-tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 24px;
	margin: 0 0 10px;
}

.ilu-cmp-diff {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ilu-cmp-diff input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--ilu-navy, #012561);
}

.ilu-cmp-hint {
	display: none;
	color: var(--ilu-muted, #6b6b73);
	font-size: 12px;
}

/* Table: labels column stays in place, product columns scroll sideways. */
.ilu-cmp-scroll {
	overflow-x: auto;
	border: 1px solid var(--ilu-line, #e6e6ea);
	border-radius: 12px;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
}

.ilu-cmp-scroll:focus-visible {
	outline: 2px solid var(--ilu-navy, #012561);
	outline-offset: 2px;
}

.ilu-cmp-table {
	width: 100%;
	min-width: calc(var(--ilu-cmp-label) + var(--ilu-cmp-cols, 2) * var(--ilu-cmp-col));
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	font-size: 14px;
}

.ilu-cmp-table th,
.ilu-cmp-table td {
	padding: 14px 18px;
	border: 0;
	border-bottom: 1px solid var(--ilu-line, #e6e6ea);
	vertical-align: top;
	text-align: start;
}

.ilu-cmp-table tbody tr:last-child > * {
	border-bottom: 0;
}

.ilu-cmp-table thead > tr > * {
	scroll-snap-align: start;
}

.ilu-cmp-table .ilu-cmp-corner,
.ilu-cmp-table tbody th {
	position: sticky;
	left: 0;
	z-index: 1;
	width: var(--ilu-cmp-label);
	background: #f7f8fb;
	border-inline-end: 1px solid var(--ilu-line, #e6e6ea);
	color: var(--ilu-muted, #6b6b73);
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
}

.ilu-cmp-table tbody td {
	color: var(--ilu-ink, #121212);
	text-align: center;
	overflow-wrap: anywhere;
}

.ilu-cmp-table tbody tr:hover > td {
	background: #fbfbfd;
}

.ilu-cmp-group.is-diff tr[data-same] {
	display: none;
}

/* Caption line with the row name: phones only (see the ≤ 600px block). */
.ilu-cmp-table .ilu-cmp-cap {
	display: none;
}

.ilu-cmp-none {
	color: #b4b4bb;
}

.ilu-cmp-table a {
	color: inherit;
}

.ilu-cmp-table tbody a:hover {
	color: var(--ilu-navy, #012561);
}

.ilu-cmp-shade {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.ilu-cmp-shade i {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%);
}

.ilu-cmp-stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.ilu-cmp-stock::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #1f8a4c;
}

.ilu-cmp-stock.is-outofstock::before {
	background: #b4b4bb;
}

.ilu-cmp-stock.is-onbackorder::before {
	background: #c58a00;
}

.ilu-cmp-best {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 2px 7px;
	border-radius: 999px;
	background: #e7f4ec;
	color: #17693a;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	vertical-align: 1px;
}

/* Product cell. */
.ilu-cmp-prod,
.ilu-cmp-single-card {
	position: relative;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.ilu-cmp-table .ilu-cmp-prod {
	text-align: center;
}

.ilu-cmp-table thead .ilu-cmp-prod {
	padding-top: 18px;
	padding-bottom: 18px;
	background: #fff;
}

.ilu-cmp-img {
	display: block;
	max-width: 200px;
	margin: 0 auto 12px;
	border-radius: 8px;
	overflow: hidden;
	background: #f7f8fb;
}

.ilu-cmp-img img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
}

.ilu-cmp .ilu-cmp-name {
	display: -webkit-box;
	text-transform: none;
	min-height: 2.8em;
	overflow: hidden;
	color: var(--ilu-ink, #121212);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.ilu-cmp-name:hover {
	color: var(--ilu-navy, #012561);
}

.ilu-cmp-prod .price,
.ilu-cmp-single-card .price {
	margin: 8px 0 12px;
	color: var(--ilu-ink, #121212);
	font-size: 17px;
	font-weight: 700;
}

.ilu-cmp .ilu-cmp-cart a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 260px;
	min-height: 40px;
	margin: 0 auto;
	padding: 8px 10px;
	border-radius: 8px;
	background: var(--ilu-navy, #012561);
	color: #fff;
	font-size: 12px;
	white-space: normal;
}

.ilu-cmp .ilu-cmp-cart a:hover,
.ilu-cmp .ilu-cmp-cart a:focus-visible {
	background: #0a3a8c;
	color: #fff;
}

.ilu-cmp .ilu-cmp-cart .added_to_cart {
	display: block;
	margin-top: 8px;
	background: none;
	color: var(--ilu-navy, #012561);
	min-height: 0;
}

.ilu-cmp .ilu-cmp-choose {
	border-radius: 8px;
	background: var(--ilu-navy, #012561);
	color: #fff;
}

.ilu-cmp .ilu-cmp-choose:hover,
.ilu-cmp .ilu-cmp-choose:focus-visible {
	background: #0a3a8c;
	color: #fff;
}

.ilu-cmp .ilu-cmp-x {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 32px;
	height: 32px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 92%);
	box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
	color: var(--ilu-ink, #121212);
	cursor: pointer;
}

.ilu-cmp-x span::before,
.ilu-cmp-x span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 13px;
	height: 1.6px;
	border-radius: 1px;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}

.ilu-cmp-x span::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.ilu-cmp .ilu-cmp-x:hover,
.ilu-cmp .ilu-cmp-x:focus-visible {
	background: var(--ilu-navy, #012561);
	color: #fff;
}

/* One product in a group: «nothing to compare». */
.ilu-cmp-single {
	display: grid;
	grid-template-columns: 236px 1fr;
	align-items: center;
	gap: 32px;
	padding: 24px;
	border: 1px solid var(--ilu-line, #e6e6ea);
	border-radius: 12px;
}

.ilu-cmp-single-title {
	margin: 0 0 8px;
	color: var(--ilu-ink, #121212);
	font-size: 18px;
	font-weight: 700;
}

.ilu-cmp-single-text p {
	max-width: 46ch;
	color: var(--ilu-muted, #6b6b73);
}

.ilu-cmp-choose {
	margin-top: 6px;
}

.ilu-cmp-empty {
	padding-block: 40px;
}

/* Wider screens: more room for the products. */
@media (min-width: 1280px) {
	.ilu-cmp {
		--ilu-cmp-col: 260px;
	}
}

@media (max-width: 768px) {
	.ilu-cmp {
		--ilu-cmp-label: 104px;
		--ilu-cmp-col: 158px;
	}

	.ilu-cmp-title {
		font-size: 19px;
	}

	.ilu-cmp-head {
		align-items: flex-start;
		flex-direction: column;
	}

	.ilu-cmp-hint {
		display: inline;
	}

	.ilu-cmp-tools {
		flex-wrap: wrap;
	}

	.ilu-cmp-table th,
	.ilu-cmp-table td {
		padding: 11px 10px;
	}

	.ilu-cmp-table .ilu-cmp-corner,
	.ilu-cmp-table tbody th {
		font-size: 12px;
		hyphens: auto;
	}

	.ilu-cmp-table thead .ilu-cmp-prod {
		padding: 12px 10px 14px;
	}

	.ilu-cmp-name {
		font-size: 13px;
	}

	.ilu-cmp-prod .price {
		font-size: 15px;
	}

	.ilu-cmp .ilu-cmp-x {
		top: 6px;
		right: 6px;
		width: 28px;
		height: 28px;
	}

	.ilu-cmp-single {
		grid-template-columns: 1fr;
		gap: 18px;
		padding: 16px;
	}

	.ilu-cmp-single-card {
		max-width: 220px;
	}
}

/*
 * Phones: no label column (it took a third of the screen). Each row name is a caption line above the values and
 * stays in place while the products scroll. Columns are half the screen: two products are fully visible, from the
 * third one the next column peeks out on the right.
 */
@media (max-width: 600px) {
	.ilu-cmp {
		--ilu-cmp-label: 0px;
		--ilu-cmp-col: max(136px, calc((100vw - 56px) / 2));
	}

	.ilu-cmp-table .ilu-cmp-corner {
		display: none;
	}

	/* The caption line above replaces the row header (a hidden cell would still take a column in the grid). */
	.ilu-cmp-table tbody th {
		display: none;
	}

	.ilu-cmp-table tbody .ilu-cmp-cap {
		display: table-row;
	}

	.ilu-cmp-table .ilu-cmp-cap > td {
		padding: 10px 10px 0;
		border-bottom: 0;
		background: none;
		text-align: start;
	}

	.ilu-cmp-table tbody tr.ilu-cmp-cap:hover > td {
		background: none;
	}

	.ilu-cmp-cap span {
		position: sticky;
		left: 10px;
		color: var(--ilu-muted, #6b6b73);
		font-size: 11px;
		font-weight: 600;
		letter-spacing: .02em;
	}

	.ilu-cmp-table tbody tr:not(.ilu-cmp-cap) > td {
		padding: 4px 8px 10px;
		font-size: 13px;
	}

	.ilu-cmp-table thead .ilu-cmp-prod {
		padding: 10px 8px 12px;
	}

	.ilu-cmp-img {
		max-width: 92px;
		margin-bottom: 8px;
	}

	.ilu-cmp .ilu-cmp-name {
		min-height: 0;
		font-size: 12.5px;
		line-height: 1.35;
	}

	.ilu-cmp-prod .price {
		margin: 6px 0 8px;
		font-size: 14px;
	}

	.ilu-cmp-prod .ilu-b2b-note {
		display: block;
		margin: 6px 0 8px;
		font-size: 11.5px;
		line-height: 1.35;
	}

	.ilu-cmp .ilu-cmp-cart a {
		min-height: 32px;
		padding: 6px 8px;
		border-radius: 6px;
		font-size: 11px;
		line-height: 1.2;
	}

	.ilu-cmp .ilu-cmp-x {
		top: 4px;
		right: 4px;
		width: 26px;
		height: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ilu-cmp-toast,
	.ilu-cmp,
	.ilu-cmp-tab {
		transition: none;
	}
}
