/**
 * Flavors Scroll Progress - fixed reading-progress indicator.
 *
 * Four styles share one wrapper: top bar, bottom bar, circular ring, side rail.
 * Per-instance values (colors, thickness, size, offset, z-index) arrive as CSS
 * custom properties written by Elementor control `selectors`; this file stays
 * static and cacheable. Progress itself is applied by JS as a transform
 * (bars/rail) or stroke-dashoffset (ring) - no layout thrash, GPU friendly.
 */

.flavor-scroll-progress {
	--fsp-color: #6366f1;
	--fsp-track: rgba(99, 102, 241, 0.15);
	--fsp-thickness: 4px;
	--fsp-size: 64px;
	--fsp-offset: 24px;
	--fsp-circle-bg: #ffffff;
	--fsp-z: 9990;
}

/* ------------------------------------------------------------ Bars & rail */

.fsp--top-bar .fsp-track,
.fsp--bottom-bar .fsp-track,
.fsp--rail .fsp-track {
	position: fixed;
	z-index: var(--fsp-z);
	background: var(--fsp-track);
	pointer-events: none;
}

.fsp--top-bar .fsp-track,
.fsp--bottom-bar .fsp-track {
	left: 0;
	right: 0;
	height: var(--fsp-thickness);
}

.fsp--top-bar .fsp-track {
	top: 0;
}

.fsp--bottom-bar .fsp-track {
	bottom: 0;
}

.fsp--rail .fsp-track {
	top: var(--fsp-offset);
	bottom: var(--fsp-offset);
	width: var(--fsp-thickness);
	border-radius: calc(var(--fsp-thickness) / 2);
	overflow: hidden;
}

.fsp--rail-right .fsp-track {
	right: var(--fsp-offset);
}

.fsp--rail-left .fsp-track {
	left: var(--fsp-offset);
}

.fsp--top-bar .fsp-bar,
.fsp--bottom-bar .fsp-bar,
.fsp--rail .fsp-bar {
	width: 100%;
	height: 100%;
	background: var(--fsp-color);
	transform: scaleX(0);
	transform-origin: left center;
	will-change: transform;
}

.fsp--rail .fsp-bar {
	transform: scaleY(0);
	transform-origin: center top;
	border-radius: inherit;
}

/* ------------------------------------------------------------------ Circle */

.fsp--circle .fsp-circle {
	position: fixed;
	bottom: var(--fsp-offset);
	z-index: var(--fsp-z);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fsp-size);
	height: var(--fsp-size);
	border-radius: 50%;
	background: var(--fsp-circle-bg);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.fsp--bottom-right .fsp-circle {
	right: var(--fsp-offset);
}

.fsp--bottom-left .fsp-circle {
	left: var(--fsp-offset);
}

.fsp--circle .fsp-circle[data-totop] {
	cursor: pointer;
}

.fsp--circle .fsp-circle[data-totop]:focus-visible {
	outline: 2px solid var(--fsp-color);
	outline-offset: 3px;
}

.fsp-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.fsp-ring-track {
	stroke: var(--fsp-track);
	stroke-width: 4;
}

.fsp-ring-bar {
	stroke: var(--fsp-color);
	stroke-width: 4;
	stroke-linecap: round;
	stroke-dasharray: 100;
	stroke-dashoffset: 100;
	will-change: stroke-dashoffset;
}

.fsp-percent {
	position: relative;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: #1d2327;
	font-variant-numeric: tabular-nums;
}

/* Chevron drawn with borders - no icon font dependency. */
.fsp-arrow {
	position: relative;
	width: 12px;
	height: 12px;
	border-top: 2px solid var(--fsp-color);
	border-left: 2px solid var(--fsp-color);
	transform: rotate(45deg) translate(2px, 2px);
}

/* --------------------------------------------------------------- Modifiers */

@media (max-width: 767px) {
	.fsp--hide-mobile {
		display: none;
	}
}

/*
 * Editor preview: keep the indicator inside the widget's own canvas slot so it
 * doesn't fight the editor chrome with position: fixed.
 */
.elementor-editor-active .flavor-scroll-progress .fsp-track,
.elementor-editor-active .flavor-scroll-progress .fsp-circle,
.fsp--editor-static .fsp-track,
.fsp--editor-static .fsp-circle {
	position: relative;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
}

.elementor-editor-active .fsp--top-bar .fsp-track,
.elementor-editor-active .fsp--bottom-bar .fsp-track,
.fsp--editor-static.fsp--top-bar .fsp-track,
.fsp--editor-static.fsp--bottom-bar .fsp-track {
	width: 100%;
}

.elementor-editor-active .fsp--rail .fsp-track,
.fsp--editor-static.fsp--rail .fsp-track {
	height: 160px;
	margin: 0 auto;
}

.elementor-editor-active .fsp--circle .fsp-circle,
.fsp--editor-static.fsp--circle .fsp-circle {
	margin: 0 auto;
}
