/**
 * NicLen Portfolio – product comparison [nl_compare] / widget "nl-compare".
 *
 * One table per leaf category. Next to the feature column 3.5 product columns are in view on desktops,
 * 2.5 on tablets and 1.5 on mobiles; more scroll within the table.
 * The column width comes from the group width (container query units). The box always takes the full width;
 * with few products the space after the last column stays white.
 *
 * Breakpoint template: Elementor replaces the placeholders in the media queries with the breakpoints
 * of the site and serves the result from uploads/elementor/css/custom-nl-compare.css.
 */

/* Same fix as nl-category-grid.css: a wrapping flex container would size the widget at its content width,
   and the groups have none (container-type). */
.e-con-inner > .elementor-widget-nl-compare,
.e-con > .elementor-widget-nl-compare {
	width: var(--container-widget-width, 100%);
	--flex-grow: var(--container-widget-flex-grow);
}

.nl-portfolio.nl-compare {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
}

/* Head: title and "5 products". */
.nl-portfolio .nl-compare__head {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nl-portfolio .nl-compare__title {
	font-family: var(--nl-font-heading);
	font-size: 44px;
	font-weight: 900;
	line-height: 1.15;
	color: var(--nl-heading);
}

.nl-portfolio .nl-compare__summary {
	font-size: 15px;
	color: var(--nl-text-muted);
}

.nl-portfolio .nl-compare__group {
	container-type: inline-size;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.nl-portfolio .nl-compare__group-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.nl-portfolio .nl-compare__group-title {
	font-family: var(--nl-font-heading);
	font-size: 22px;
	font-weight: 900;
	line-height: 1.3;
	color: var(--nl-heading);
}

.nl-portfolio .nl-compare__group-sum {
	font-size: 14px;
	color: var(--nl-text-muted);
}

/* A copy of the table's scrollbar above it; only while the table is wider than its box (.has-overflow, set by compare.js). */
.nl-portfolio .nl-compare__scrollbar {
	display: none;
	overflow-x: auto;
	overflow-y: hidden;
}

.nl-portfolio .nl-compare__group.has-overflow .nl-compare__scrollbar {
	display: block;
}

.nl-portfolio .nl-compare__scrollbar-inner {
	height: 1px;
}

/* The box around the table scrolls; it always takes the full width. */
.nl-portfolio .nl-compare__scroll {
	/* Containing block for absolute children (hidden button texts), or they would escape the overflow and widen the page. */
	position: relative;
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--nl-line);
	border-radius: var(--nl-r-m);
}

.nl-portfolio .nl-compare__scroll:focus-visible {
	outline-offset: 2px;
}

.nl-portfolio .nl-compare__table {
	--nl-compare-label: 220px;
	--nl-compare-visible: 3.5;
	/* 100cqi is the group width; 2px for the border of the box. */
	--nl-compare-col: calc((100cqi - 2px - var(--nl-compare-label)) / var(--nl-compare-visible));

	display: grid;
	grid-template-columns: var(--nl-compare-label) repeat(var(--nl-compare-cols), var(--nl-compare-col));
	width: max-content;
}

.nl-portfolio .nl-compare__row {
	display: contents;
}

/* The feature column stays in view while the products scroll. */
.nl-portfolio .nl-compare__corner,
.nl-portfolio .nl-compare__label {
	position: sticky;
	left: 0;
	z-index: 2;
	background: #fff;
	box-shadow: inset -1px 0 0 #eef2f6;
}

.nl-portfolio .nl-compare__corner {
	display: flex;
	align-items: flex-end;
	padding: 20px;
	border-bottom: 1px solid var(--nl-line);
	font-size: 14px;
	font-weight: 600;
	color: var(--nl-text-muted);
}

/* Column head: image with remove button, name, truck button. */
.nl-portfolio .nl-compare__product {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 16px;
	border-left: 1px solid #eef2f6;
	border-bottom: 1px solid var(--nl-line);
	transition: opacity 0.2s ease;
}

.nl-portfolio .nl-compare__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--nl-r-s);
	background: var(--nl-surface);
}

.nl-portfolio .nl-compare__media-link {
	display: block;
	width: 100%;
	height: 100%;
}

.nl-portfolio .nl-compare__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/*
 * Buttons repeat their shape for :hover, :focus and :active, so global button styles of the site
 * (theme, Elementor kit) cannot change it in any state.
 */
.nl-portfolio .nl-compare__remove,
.nl-portfolio .nl-compare__remove:is(:hover, :focus, :active) {
	box-shadow: none;
	transform: none;
	position: absolute;
	top: 4px;
	right: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--nl-r-pill);
	background: #fff;
	color: var(--nl-navy);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.nl-portfolio .nl-compare__remove:hover {
	background: var(--nl-line);
	color: var(--nl-navy);
}

.nl-portfolio .nl-compare__remove svg {
	width: 18px;
	height: 18px;
}

.nl-portfolio .nl-compare__name {
	font-family: var(--nl-font-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.nl-portfolio .nl-compare__name a {
	color: var(--nl-action);
	text-decoration: none;
}

.nl-portfolio .nl-compare__name a:hover {
	color: var(--nl-navy);
	text-decoration: underline;
}

/* Truck: − quantity + │ "Load onto truck" in one blue pill, as on the product card. */
.nl-portfolio .nl-compare__truck {
	display: flex;
	align-items: stretch;
	width: 100%;
	height: 44px;
	margin-top: auto;
	overflow: hidden;
	border-radius: var(--nl-r-pill);
	background: var(--nl-action);
	color: #fff;
}

/* The buttons fill their whole segment on hover; the pill rounds the outer ends. */
.nl-portfolio .nl-compare__step,
.nl-portfolio .nl-compare__step:is(:hover, :focus, :active),
.nl-portfolio .nl-compare__load,
.nl-portfolio .nl-compare__load:is(:hover, :focus, :active) {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transform: none;
	background: transparent;
	font-family: var(--nl-font-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.nl-portfolio .nl-compare__step:hover,
.nl-portfolio .nl-compare__load:hover {
	background: var(--nl-navy);
}

.nl-portfolio .nl-compare__step {
	flex: none;
	width: 32px;
	padding: 0;
}

.nl-portfolio .nl-compare__step:first-child {
	padding-left: 4px;
}

.nl-portfolio .nl-compare__truck svg {
	flex: none;
}

.nl-portfolio .nl-compare__step svg {
	width: 16px;
	height: 16px;
}

.nl-portfolio .nl-compare__quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	font-size: 15px;
	font-weight: 700;
}

/* Stepper: hidden until the product is on the truck, then it slides in from the left. */
.nl-portfolio .nl-compare__stepper {
	display: flex;
	flex: none;
	align-items: stretch;
	max-width: 0;
	overflow: hidden;
	visibility: hidden;
	opacity: 0;
	transition: max-width 0.3s ease, opacity 0.2s ease, visibility 0s 0.3s;
}

.nl-portfolio .nl-compare__product.is-in-truck .nl-compare__stepper {
	max-width: 120px;
	visibility: visible;
	opacity: 1;
	transition: max-width 0.3s ease, opacity 0.2s ease 0.1s, visibility 0s;
}

.nl-portfolio .nl-compare__divider {
	flex: none;
	width: 1px;
	margin: 10px 0;
	background: rgba(255, 255, 255, 0.45);
}

.nl-portfolio .nl-compare__load {
	flex: 1;
	gap: 6px;
	min-width: 0;
	padding: 0 8px;
}

.nl-portfolio .nl-compare__truck-icon {
	display: none;
	width: 20px;
	height: 20px;
}

/* Only the text of the current state shows. */
.nl-portfolio .nl-compare__product.is-in-truck .nl-compare__load-text--add,
.nl-portfolio .nl-compare__product:not(.is-in-truck) .nl-compare__load-text--remove {
	display: none;
}

/* Focus rings inside the pill would be cut off by its overflow. */
.nl-portfolio .nl-compare__truck :focus-visible {
	outline-offset: -4px;
	outline-color: #fff;
}

/* "Add product": a dashed tile at the end of the table that leads to the product archive of the category. */
.nl-portfolio .nl-compare__add {
	display: flex;
	padding: 20px;
	border-left: 1px solid #eef2f6;
	border-bottom: 1px solid var(--nl-line);
}

.nl-portfolio .nl-compare__add-link,
.nl-portfolio .nl-compare__add-link:visited {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 160px;
	padding: 16px;
	border: 2px dashed var(--nl-field);
	border-radius: var(--nl-r-s);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	color: var(--nl-action);
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.nl-portfolio .nl-compare__add-link:hover {
	border-color: var(--nl-action);
	color: var(--nl-navy);
}

.nl-portfolio .nl-compare__add-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--nl-r-pill);
	background: var(--nl-chip);
	color: var(--nl-action);
}

.nl-portfolio .nl-compare__add-icon svg {
	width: 20px;
	height: 20px;
}

/* Rows: label and values, alternately white and light grey. */
.nl-portfolio .nl-compare__label {
	padding: 14px 20px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--nl-navy);
}

.nl-portfolio .nl-compare__cell {
	min-width: 0;
	padding: 14px 16px;
	border-left: 1px solid #eef2f6;
	background: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--nl-navy);
	overflow-wrap: anywhere;
	transition: opacity 0.2s ease;
}

.nl-portfolio .nl-compare__cell[data-empty] {
	font-weight: 400;
	color: var(--nl-text-muted);
}

.nl-portfolio .nl-compare__cell :is(ul, ol) {
	margin: 0;
	padding-left: 1.2em;
}

.nl-portfolio .nl-compare__row--data:nth-child(odd) > * {
	background: #f7f9fb;
}

/* A column on its way out (see compare.js). */
.nl-portfolio .nl-compare__table .is-busy {
	opacity: 0.5;
}

/* Icons in the "Features" row, as on the product page but smaller. */
.nl-portfolio .nl-compare__features {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nl-portfolio .nl-compare__feature {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.nl-portfolio .nl-compare__features.has-labels .nl-compare__feature {
	width: 64px;
}

.nl-portfolio .nl-compare__feature-icon {
	position: relative;
	display: block;
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.nl-portfolio .nl-compare__feature-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
}

/* The value printed onto the icon ("IP65", "2"), as on the product page. */
.nl-portfolio .nl-compare__feature-value {
	position: absolute;
	top: 50%;
	left: 50%;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	color: #000;
	white-space: nowrap;
	transform: translate(-50%, -50%);
}

.nl-portfolio .nl-compare__feature-label {
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	color: var(--nl-text);
}

/* Tooltip: a dark bubble above the icon on hover and keyboard focus. */
.nl-portfolio .nl-compare__tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 3;
	width: max-content;
	max-width: 200px;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--nl-navy);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-align: center;
	color: #fff;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%);
	transition: opacity 0.15s ease, visibility 0.15s ease;
	pointer-events: none;
}

.nl-portfolio .nl-compare__tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -6px;
	border: 6px solid transparent;
	border-top-color: var(--nl-navy);
}

.nl-portfolio .nl-compare__feature-icon:is(:hover, :focus) .nl-compare__tooltip {
	opacity: 1;
	visibility: visible;
}

.nl-portfolio .nl-compare__status:empty {
	display: none;
}

.nl-portfolio .nl-compare__status {
	font-size: 15px;
	font-weight: 600;
	color: var(--nl-navy);
}

/* Empty comparison: only shown with .is-empty. */
.nl-portfolio .nl-compare__empty {
	display: none;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 32px;
	border-radius: var(--nl-r-l);
	background: var(--nl-surface);
	font-size: 16px;
	color: var(--nl-navy);
}

.nl-portfolio.nl-compare.is-empty .nl-compare__empty {
	display: flex;
}

.nl-portfolio.nl-compare.is-empty .nl-compare__summary {
	display: none;
}

.nl-portfolio .nl-compare__cta,
.nl-portfolio .nl-compare__cta:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 32px;
	border-radius: var(--nl-r-pill);
	background: var(--nl-action);
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.nl-portfolio .nl-compare__cta:hover {
	background: var(--nl-navy);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.nl-portfolio .nl-compare__stepper,
	.nl-portfolio .nl-compare__step,
	.nl-portfolio .nl-compare__step:is(:hover, :focus, :active),
	.nl-portfolio .nl-compare__load,
	.nl-portfolio .nl-compare__load:is(:hover, :focus, :active),
	.nl-portfolio .nl-compare__tooltip {
		transition: none;
	}
}

@media (max-width: 1024px) {
	.nl-portfolio .nl-compare__title {
		font-size: 36px;
	}

	.nl-portfolio .nl-compare__table {
		--nl-compare-label: 160px;
		--nl-compare-visible: 2.5;
	}

	/* As in the design, the truck button shows only its icon below the desktop. */
	.nl-portfolio .nl-compare__truck-icon {
		display: block;
	}

	/* Visually hidden, still the accessible name of the button. */
	.nl-portfolio .nl-compare__load-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

@media (max-width: 767px) {
	.nl-portfolio.nl-compare {
		gap: 32px;
	}

	.nl-portfolio .nl-compare__title {
		font-size: 30px;
	}

	.nl-portfolio .nl-compare__group-title {
		font-size: 20px;
	}

	/* No feature column: the label is a line of its own above the values, and stays in view. */
	.nl-portfolio .nl-compare__table {
		--nl-compare-col: calc((100cqi - 2px) / 1.5);

		grid-template-columns: repeat(var(--nl-compare-cols), var(--nl-compare-col));
	}

	.nl-portfolio .nl-compare__corner {
		display: none;
	}

	.nl-portfolio .nl-compare__label {
		grid-column: 1 / -1;
		justify-self: start;
		width: calc(100cqi - 2px);
		padding: 12px 12px 4px;
		box-shadow: none;
		font-size: 13px;
		color: var(--nl-text-muted);
	}

	.nl-portfolio .nl-compare__cell {
		padding: 4px 12px 12px;
	}

	.nl-portfolio .nl-compare__product,
	.nl-portfolio .nl-compare__add {
		padding: 12px;
	}

	.nl-portfolio .nl-compare__name {
		font-size: 15px;
	}

	.nl-portfolio .nl-compare__empty {
		padding: 24px;
	}
}
