/*
 * RewardRace Floating "Scroll to Top" Widget
 * Palette aligned with the RewardRace design system (base.css):
 *   - Brand purple:  #573FD3  (button, gradient with #8B73FF)
 *   - Deep ink:      #0B0A14  (tooltip surface)
 * Deliberately purple so it reads as the brand accent and stays distinct
 * from the green WhatsApp button — never looks like a duplicate.
 */

.rrew-scrolltop,
.rrew-scrolltop * {
	box-sizing: border-box;
}

.rrew-scrolltop {
	--rrew-st-offset-bottom: 28px;
	--rrew-st-offset-side: 28px;
	--rrew-st-bg: #573FD3;

	position: fixed;
	bottom: var(--rrew-st-offset-bottom);
	/* Sits just below the WhatsApp button (z-index 9998) so the primary chat
	 * action always wins if anything ever overlaps. */
	z-index: 9997;
	font-family: var(--rr-font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.4;

	/* Hidden until the visitor scrolls past the threshold. */
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.85);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.3s ease;
}

.rrew-scrolltop.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.rrew-scrolltop > * {
	pointer-events: auto;
}

.rrew-scrolltop--bottom-right {
	right: var(--rrew-st-offset-side);
}

.rrew-scrolltop--bottom-left {
	left: var(--rrew-st-offset-side);
}

/* -------------------------------------------------------------------------
 * Button
 * ---------------------------------------------------------------------- */
.rrew-scrolltop__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background-color: #573FD3;
	background-image: linear-gradient(160deg, #8B73FF 0%, #573FD3 100%);
	color: #FFFFFF;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: 0 8px 32px rgba(87, 63, 211, 0.26);
	transition: transform 0.25s ease, background-color 0.25s ease, background-image 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.rrew-scrolltop__btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 0 0 1px rgba(87, 63, 211, 0.30), 0 16px 48px rgba(87, 63, 211, 0.30);
}

.rrew-scrolltop__btn:active {
	transform: translateY(-1px) scale(0.97);
}

.rrew-scrolltop__btn:focus {
	outline: none;
}

.rrew-scrolltop__btn:focus-visible {
	outline: 3px solid rgba(87, 63, 211, 0.5);
	outline-offset: 4px;
}

/* -------------------------------------------------------------------------
 * Icon
 * ---------------------------------------------------------------------- */
.rrew-scrolltop__icon {
	position: relative;
	z-index: 1;
	display: inline-flex;
	width: 22px;
	height: 22px;
	color: inherit;
	transition: transform 0.25s ease;
}

.rrew-scrolltop__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* base.css forces Plus Jakarta Sans (!important) on every rrew-* descendant.
 * Restore the icon font when a builder overrides the built-in arrow with a
 * Font Awesome / Elementor icon, so the glyph renders instead of a blank box.
 * The default inline SVG ignores font-family, so it is unaffected. */
.rrew-scrolltop__icon i.fab,
.rrew-scrolltop__icon i[class*="fa-brands"] {
	font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
}
.rrew-scrolltop__icon i.fa,
.rrew-scrolltop__icon i.fas,
.rrew-scrolltop__icon i.far,
.rrew-scrolltop__icon i.fal,
.rrew-scrolltop__icon i.fad,
.rrew-scrolltop__icon i[class*="fa-solid"],
.rrew-scrolltop__icon i[class*="fa-regular"],
.rrew-scrolltop__icon i[class*="fa-light"],
.rrew-scrolltop__icon i[class*="fa-duotone"] {
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
}
.rrew-scrolltop__icon i[class*="eicon"] {
	font-family: "eicons" !important;
}

.rrew-scrolltop__btn:hover .rrew-scrolltop__icon {
	transform: translateY(-2px);
}

/* -------------------------------------------------------------------------
 * Tooltip
 * ---------------------------------------------------------------------- */
.rrew-scrolltop__tooltip {
	position: absolute;
	bottom: 50%;
	transform: translateY(50%);
	padding: 10px 14px;
	border: 1px solid rgba(87, 63, 211, 0.30);
	border-radius: 12px;
	background-color: #0B0A14;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	box-shadow: 0 12px 30px rgba(11, 10, 20, 0.35);
}

.rrew-scrolltop--bottom-right .rrew-scrolltop__tooltip {
	right: calc(100% + 14px);
	transform: translate(8px, 50%);
}

.rrew-scrolltop--bottom-left .rrew-scrolltop__tooltip {
	left: calc(100% + 14px);
	transform: translate(-8px, 50%);
}

.rrew-scrolltop__tooltip::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 8px;
	height: 8px;
	background-color: inherit;
	border: inherit;
	border-width: 0 1px 1px 0;
	transform: translateY(-50%) rotate(-45deg);
}

.rrew-scrolltop--bottom-right .rrew-scrolltop__tooltip::after {
	right: -5px;
}

.rrew-scrolltop--bottom-left .rrew-scrolltop__tooltip::after {
	left: -5px;
	transform: translateY(-50%) rotate(135deg);
}

.rrew-scrolltop__btn:hover + .rrew-scrolltop__tooltip,
.rrew-scrolltop:hover .rrew-scrolltop__tooltip {
	opacity: 1;
}

.rrew-scrolltop--bottom-right:hover .rrew-scrolltop__tooltip,
.rrew-scrolltop--bottom-left:hover .rrew-scrolltop__tooltip {
	transform: translate(0, 50%);
}

/* -------------------------------------------------------------------------
 * Responsive visibility
 * ---------------------------------------------------------------------- */
@media ( max-width: 480px ) {
	.rrew-scrolltop__tooltip {
		display: none;
	}
}

@media ( max-width: 1024px ) {
	.rrew-scrolltop--hide-tablet {
		display: none;
	}
}

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

@media ( min-width: 1025px ) {
	.rrew-scrolltop--hide-desktop {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------------- */
@media ( prefers-reduced-motion: reduce ) {
	.rrew-scrolltop,
	.rrew-scrolltop__btn,
	.rrew-scrolltop__icon,
	.rrew-scrolltop__tooltip {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Site-rendered wrapper (when injected via Site Parts)
 * Holds only the position:fixed button. Keep the wrapper out of normal flow
 * (width/height 0) so it never adds page height — otherwise the empty,
 * transparent Elementor section would reveal the body background as a blank
 * strip below the footer. The fixed button still positions against the viewport.
 * ---------------------------------------------------------------------- */
.rrew-site-scroll_top {
	position: fixed;
	bottom: 0;
	right: 0;
	width: 0;
	height: 0;
	z-index: 9997;
}

.rrew-site-scroll_top .elementor-section,
.rrew-site-scroll_top .elementor-container,
.rrew-site-scroll_top .elementor-column,
.rrew-site-scroll_top .elementor-widget-wrap,
.rrew-site-scroll_top .elementor-element,
.rrew-site-scroll_top .e-con,
.rrew-site-scroll_top .e-con-inner {
	background: transparent !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
}
