/*
 * Review "Jump to" bar and H2 anchors (see includes/display/jump-to.php, assets/js/jump-to.js).
 * --spr-jump-top: height of the fixed admin bar + sticky site header (set by JS).
 * --spr-jump-h:   height of the bar itself (set by JS).
 */
:root {
	--spr-jump-top: 0px;
	--spr-jump-h: 56px;
}

/* Anchored headings and boxes land below the sticky header and the bar. */
.spr-jump-anchors h2[id],
.spr-jump-anchors #verdict,
.spr-jump-anchors #alternatives {
	scroll-margin-top: calc(var(--spr-jump-top) + var(--spr-jump-h) + 16px);
}

.spr-jump-wrap {
	margin: 0 0 24px;
	min-height: var(--spr-jump-h);
}

.spr-jump {
	position: relative;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	font-size: 15px;
	line-height: 1.3;
}

.spr-jump.is-fixed {
	position: fixed;
	top: var(--spr-jump-top);
	border-radius: 0 0 12px 12px;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.spr-jump__label {
	flex: none;
	font-weight: 600;
	color: #64748b;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.spr-jump__list {
	display: flex;
	flex: 1 1 auto;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.spr-jump__list::-webkit-scrollbar {
	display: none;
}

.spr-jump__list li {
	margin: 0;
	padding: 0;
	flex: none;
}

.spr-jump__link {
	display: block;
	padding: 6px 12px;
	border-radius: 999px;
	color: #334155;
	text-decoration: none;
	white-space: nowrap;
	font-weight: 500;
}

.spr-jump__link:hover,
.spr-jump__link:focus-visible {
	background: #f1f5f9;
	color: #0f172a;
}

.spr-jump__link[aria-current="true"] {
	background: #0f766e;
	color: #fff;
}

.spr-jump__toggle {
	display: none;
}

/* Mobile: a slim "Sections" button that opens the list. */
@media (max-width: 781px) {
	.spr-jump {
		flex-wrap: wrap;
		padding: 6px 8px;
		gap: 0;
	}

	.spr-jump__label {
		display: none;
	}

	.spr-jump__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: 100%;
		padding: 8px 10px;
		border: 0;
		background: transparent;
		color: #0f172a;
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}

	.spr-jump__current {
		font-weight: 500;
		color: #0f766e;
	}

	.spr-jump__current::after {
		content: "";
		display: inline-block;
		width: 8px;
		height: 8px;
		margin-left: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-3px) rotate(45deg);
		transition: transform 0.15s ease;
	}

	.spr-jump.is-open .spr-jump__current::after {
		transform: translateY(1px) rotate(-135deg);
	}

	/* Without JS the list stays visible. */
	.spr-jump.has-js .spr-jump__list {
		display: none;
	}

	.spr-jump.has-js.is-open .spr-jump__list {
		display: flex;
	}

	.spr-jump__list {
		flex-direction: column;
		width: 100%;
		padding: 4px 0;
		overflow: visible;
	}

	.spr-jump__link {
		border-radius: 8px;
		padding: 10px 12px;
	}

	.spr-jump.is-fixed {
		border-radius: 0 0 10px 10px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.spr-jump) {
		scroll-behavior: smooth;
	}
}

/* Call to action on the right of the bar (affiliate link; see includes/display/affiliate-cta.php). */
.spr-jump__cta {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 7px 14px;
	border-radius: 999px;
	background: #16a34a;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgba(22, 163, 74, 0.25);
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.spr-jump__cta:hover,
.spr-jump__cta:focus-visible {
	background: #15803d;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 6px 14px rgba(22, 163, 74, 0.25);
}

.spr-jump__cta-price {
	padding-left: 8px;
	border-left: 1px solid rgba(255, 255, 255, 0.4);
	font-weight: 600;
	opacity: 0.9;
}

@media (max-width: 1100px) {
	.spr-jump__cta-price {
		display: none;
	}
}

/* Mobile: the button sits on the right of the "Sections" toggle row. */
@media (max-width: 781px) {
	.spr-jump__toggle {
		flex: 1 1 0%;
		width: auto;
		min-width: 0;
		padding-right: 4px;
	}

	.spr-jump__current {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.spr-jump__cta {
		order: 2;
		margin-left: 8px;
		padding: 7px 12px;
		font-size: 13px;
	}

	.spr-jump__list {
		order: 3;
	}
}

/* "More" menu: sections that do not fit on one row (see assets/js/jump-to.js). */
.spr-jump.is-tight .spr-jump__label {
	display: none;
}

.spr-jump__more {
	position: relative;
	flex: none;
}

.spr-jump__more[hidden] {
	display: none;
}

.spr-jump__more-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #334155;
	font: inherit;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
}

.spr-jump__more-btn::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.15s ease;
}

.spr-jump__more.is-open .spr-jump__more-btn::after {
	transform: translateY(1px) rotate(-135deg);
}

.spr-jump__more-btn:hover,
.spr-jump__more-btn:focus-visible {
	background: #f1f5f9;
	color: #0f172a;
}

.spr-jump__more-btn.is-current {
	background: #0f766e;
	color: #fff;
}

.spr-jump__more-list {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 45;
	min-width: 190px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.spr-jump__more.is-open .spr-jump__more-list {
	display: block;
}

.spr-jump__more-list li {
	margin: 0;
	padding: 0;
}

.spr-jump__more-list .spr-jump__link {
	border-radius: 8px;
	padding: 8px 12px;
}

@media (max-width: 781px) {
	.spr-jump__more {
		display: none;
	}
}

/* When sections are in the More menu, keep "More" right after the last visible section. */
@media (min-width: 782px) {
	.spr-jump.is-tight .spr-jump__list {
		flex: 0 1 auto;
	}
}
