/**
 * Site-wide “back to top”. One control in footer.php.
 * Sits above the header (z-index 9999) and under the cookie bar.
 * On phones it stays above the landing sticky bar (WhatsApp / call).
 */

.tr-back-to-top {
	position: fixed;
	z-index: 80;
	inset-inline-end: 16px;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	margin: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: 1px solid #CCB05C;
	border-radius: 0;
	background: #1D1D1D;
	color: #CCB05C;
	font-family: Oswald, sans-serif;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	-webkit-tap-highlight-color: transparent;
}

.tr-back-to-top[hidden] {
	display: none !important;
}

.tr-back-to-top::before {
	content: "";
	width: 12px;
	height: 12px;
	border-top: 2px solid #CCB05C;
	border-inline-end: 2px solid #CCB05C;
	transform: translateY(3px) rotate(-45deg);
}

.tr-back-to-top:hover,
.tr-back-to-top:focus-visible {
	background: #272727;
	color: #CCB05C;
	outline: 2px solid #CCB05C;
	outline-offset: 3px;
}

/* Full-width mobile sticky (WhatsApp / call / price) lives on the bottom edge. */
@media (max-width: 980px) {
	body:has(.sticky) .tr-back-to-top,
	body:has(.stickybalk) .tr-back-to-top {
		bottom: calc(132px + env(safe-area-inset-bottom, 0px));
	}
}

/* Cookie bar is full width. Lift the control so it does not cover Akkoord. */
body:has(#toprenovatie-cookie-notice.is-visible) .tr-back-to-top {
	bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 980px) {
	body:has(#toprenovatie-cookie-notice.is-visible) .tr-back-to-top {
		bottom: calc(168px + env(safe-area-inset-bottom, 0px));
	}

	body:has(.sticky):has(#toprenovatie-cookie-notice.is-visible) .tr-back-to-top,
	body:has(.stickybalk):has(#toprenovatie-cookie-notice.is-visible) .tr-back-to-top {
		bottom: calc(248px + env(safe-area-inset-bottom, 0px));
	}
}

@media print {
	.tr-back-to-top {
		display: none !important;
	}
}
