/*
 * Mashin Irani — Desktop "back to top" floating button.
 * Complements the mobile footer's in-card back-to-top (that one shows ≤768px).
 * This floating FAB shows on desktop only (≥901px, the site's own buybar/bnav
 * threshold) and sits in the bottom inline-start corner — the opposite corner
 * from the Gaftino chat FAB (inset-inline-end) — so the two never collide.
 * Tokens come from mi-tokens (mi.css). Loaded via the Novamira sandbox loader.
 */
.mi-totop {
	display: none;
	position: fixed;
	inset-inline-start: var(--space-6, 24px);
	bottom: var(--space-6, 24px);
	z-index: 1140; /* above sticky header (1100), below the chat FAB (1150) and modals (1300) */
	inline-size: 48px;
	block-size: 48px;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 1px solid rgba(224, 197, 143, .35);
	border-radius: 50%;
	background: var(--navy-900, #102134);
	color: var(--gold-300, #e0c58f);
	box-shadow: var(--shadow-e4, 0 16px 32px rgba(16, 33, 52, .22));
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.mi-totop svg {
	inline-size: 22px;
	block-size: 22px;
	fill: none;
	stroke: var(--gold-300, #dfae45); /* explicit (not currentColor): a site-wide button color reset overrides `color`, matching the gaftino svg pattern */
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	display: block;
}

/* Desktop only — hidden until the page is scrolled (JS toggles .is-visible). */
@media (min-width: 901px) {
	.mi-totop {
		display: flex;
		opacity: 0;
		visibility: hidden;
		pointer-events: none; /* never eats clicks while hidden */
		transform: translateY(12px) scale(.94);
		transition: opacity .2s ease, transform .2s ease, visibility .2s, background-color .2s ease, border-color .2s ease;
	}
	.mi-totop.is-visible {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}
	.mi-totop:hover {
		background: var(--navy-800, #112250);
		border-color: rgba(224, 197, 143, .6);
		transform: translateY(-2px);
	}
	.mi-totop:focus-visible {
		outline: 2px solid var(--gold-300, #e0c58f);
		outline-offset: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mi-totop { transition: opacity .001s linear, visibility .001s; }
	.mi-totop:hover { transform: none; }
}
