/**
 * "Do góry" button with a scroll progress ring (template-parts/footer/to-top.php,
 * assets/js/modules/to-top.js). Every storefront page.
 *
 * Black disc 56 px with a 1 px gold-dark edge (visible on the black footer too),
 * a 3 px ring (track: gold-light 22 %, progress: gold, from the top, clockwise)
 * and a light gold arrow; golden glint on hover. Above the content and the
 * sticky header, below the overlay and the drawers.
 */
.noja-to-top {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right));
	bottom: max(1rem, env(safe-area-inset-bottom));
	z-index: calc(var(--noja-z-overlay) - 10);
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--noja-black);
	box-shadow: 0 0 0 1px var(--noja-gold-dark);
	color: var(--noja-gold-light);
	cursor: pointer;
	transition:
		opacity var(--noja-duration) var(--noja-ease),
		transform var(--noja-duration) var(--noja-ease),
		box-shadow var(--noja-duration-fast) var(--noja-ease),
		visibility 0s linear 0s;
}

/* 0.14.0: above the cookie banner while it is shown (its height: footer.css, cookie-banner.js). */
html.noja-consent-open .noja-to-top {
	bottom: calc(var(--noja-consent-height, 0px) + 1rem);
}

/* Without JavaScript (display: grid above would beat the UA rule). */
.noja-to-top[hidden] {
	display: none;
}

/* Hidden: faded out, then out of the accessibility tree and the Tab order (inert). */
.noja-to-top[data-state="hidden"] {
	visibility: hidden;
	opacity: 0;
	transform: translateY(0.75rem);
	pointer-events: none;
	transition:
		opacity var(--noja-duration) var(--noja-ease),
		transform var(--noja-duration) var(--noja-ease),
		box-shadow var(--noja-duration-fast) var(--noja-ease),
		visibility 0s linear var(--noja-duration);
}

.noja-to-top:hover {
	box-shadow:
		0 0 0 1px var(--noja-gold),
		0 0 1.125rem color-mix(in srgb, var(--noja-gold-light) 35%, transparent);
}

/*
 * Focus: black ring, light gold ring, black ring - visible on ivory (black
 * 17:1) and on the black footer (light gold 14:1).
 */
.noja-to-top:focus-visible {
	outline: 2px solid var(--noja-gold-light);
	outline-offset: 2px;
	box-shadow:
		0 0 0 1px var(--noja-gold-dark),
		0 0 0 6px var(--noja-black);
}

.noja-to-top svg {
	grid-area: 1 / 1;
	pointer-events: none;
}

.noja-to-top__ring {
	width: 3.5rem;
	height: 3.5rem;
	fill: none;
	stroke-width: 3;
	transform: rotate(-90deg);
}

.noja-to-top__track {
	stroke: color-mix(in srgb, var(--noja-gold-light) 22%, transparent);
}

.noja-to-top__progress {
	stroke: var(--noja-gold);
	stroke-linecap: round;
}

.noja-to-top__arrow {
	width: 1.125rem;
	height: 1.125rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media print {
	.noja-to-top {
		display: none;
	}
}
