/**
 * NicLen Portfolio – floating comparison and truck buttons at the bottom right of every page
 * (NicLen_Portfolio_Floating_Bar). Round button with blue count badge:
 * a light streak runs around the rim of one button (the truck while it is visible, otherwise the comparison).
 * A button opens its label and fills blue only on hover / keyboard focus and for a few seconds after a product
 * was added (selection.js puts is-added on its counter); it does not open periodically.
 *
 * 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-floating-bar.css.
 */

/* Registered so the rim angle can be animated and the fill colour transitioned. */
@property --nl-fb-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

@property --nl-fb-bg {
	syntax: "<color>";
	initial-value: #fff;
	inherits: false;
}

.nl-portfolio.nl-floating-bar {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999;
	display: flex;
	flex-direction: column;
	align-items: flex-end; /* An opened label widens its button to the left. */
	gap: 12px;
}

/* Each button is hidden while its list is empty; selection.js keeps data-count up to date. */
.nl-portfolio .nl-floating-bar__button:has(.nl-floating-bar__count[data-count="0"]) {
	display: none;
}

.nl-portfolio .nl-floating-bar__button,
.nl-portfolio .nl-floating-bar__button:visited {
	position: relative;
	display: flex;
	border-radius: var(--nl-r-pill);
	box-shadow: 0 6px 20px rgba(22, 22, 63, 0.16);
	text-decoration: none;
}

/* The visible pill; clips the label while it slides. The count badge sits outside it. */
.nl-portfolio .nl-floating-bar__face {
	--nl-fb-bg: #fff;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: 56px;
	padding: 0 14px;
	overflow: hidden;
	border: 1px solid var(--nl-line);
	border-radius: var(--nl-r-pill);
	background: var(--nl-fb-bg);
	color: var(--nl-navy);
	transition: --nl-fb-bg 0.3s ease, color 0.3s ease;
}

.nl-portfolio .nl-floating-bar__face svg {
	flex: none;
	width: 26px;
	height: 26px;
}

.nl-portfolio .nl-floating-bar__text {
	max-width: 0;
	margin-left: 0;
	overflow: hidden;
	opacity: 0;
	white-space: nowrap;
	font-family: var(--nl-font-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	transition: max-width 0.4s ease, margin-left 0.4s ease, opacity 0.3s ease;
}

/*
 * The button with the light rim: the truck, or the comparison when no truck button is visible (empty or not
 * rendered). :where() keeps the specificity at that of the base rule above, which it follows and so overrides.
 */
.nl-portfolio .nl-floating-bar__face:where(.nl-floating-bar__button--truck *, .nl-floating-bar:not(:has(.nl-floating-bar__button--truck [data-count]:not([data-count="0"]))) .nl-floating-bar__button--compare *) {
	padding: 0 13px; /* 2px rim instead of 1px border, same 56px size. */
	border: 2px solid transparent;
	background:
		linear-gradient(var(--nl-fb-bg), var(--nl-fb-bg)) padding-box,
		conic-gradient(from var(--nl-fb-angle), var(--nl-line) 0%, var(--nl-action) 8%, #fff 14%, var(--nl-action) 20%, var(--nl-line) 28%) border-box;
	animation: nl-fb-rim 3s linear infinite;
}

@keyframes nl-fb-rim {
	to {
		--nl-fb-angle: 360deg;
	}
}

/* Open: hover, keyboard focus, or a product was just added. */
.nl-portfolio .nl-floating-bar__button:is(:hover, :focus-visible, :has(.is-added)) .nl-floating-bar__face {
	--nl-fb-bg: var(--nl-action);
	color: #fff;
}

.nl-portfolio .nl-floating-bar__button:is(:hover, :focus-visible, :has(.is-added)) .nl-floating-bar__text {
	max-width: 180px;
	margin-left: 8px;
	opacity: 1;
}

/* For screen readers only; the count follows. */
.nl-portfolio .nl-floating-bar__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.nl-portfolio .nl-floating-bar__count {
	position: absolute;
	top: -4px;
	right: -4px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border: 2px solid #fff;
	border-radius: var(--nl-r-pill);
	background: var(--nl-action);
	font-family: var(--nl-font-text);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

@media (max-width: 767px) {
	.nl-portfolio.nl-floating-bar {
		right: 16px;
		bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nl-portfolio .nl-floating-bar__face:where(.nl-floating-bar__button--truck *, .nl-floating-bar:not(:has(.nl-floating-bar__button--truck [data-count]:not([data-count="0"]))) .nl-floating-bar__button--compare *) {
		animation: none;
	}
}
