/* Floating menu — fixed trigger + slide panel on the left */

.floating-menu-root {
	position: fixed;
	top: 44%;
	left: 1rem;
	z-index: 105;
	transform: translateY(-50%);
}

.floating-menu-trigger {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	color: #404040;
	background: linear-gradient(
		160deg,
		rgba(255, 255, 255, 0.44) 0%,
		rgba(255, 255, 255, 0.272) 55%,
		rgba(255, 255, 255, 0.352) 100%
	);
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
	border: 1.5px solid rgba(255, 126, 182, 0.92);
	border-radius: 20px;
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.9),
		inset 0 -1px 1px rgba(255, 255, 255, 0.4),
		0 4px 16px rgba(15, 23, 42, 0.08),
		0 0 14px rgba(255, 126, 182, 0.55);
	cursor: pointer;
	transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.floating-menu-trigger::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(120% 120% at 25% -20%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 62%),
		linear-gradient(115deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4) 52%, rgba(255, 255, 255, 0) 64%);
}

.floating-menu-trigger > * {
	position: relative;
	z-index: 1;
}

.floating-menu-trigger:hover {
	border-color: rgba(255, 126, 182, 1);
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.95),
		inset 0 -1px 1px rgba(255, 255, 255, 0.45),
		0 8px 24px rgba(15, 23, 42, 0.12),
		0 0 20px rgba(255, 126, 182, 0.68);
}

.floating-menu-panel {
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 44%;
	left: 1rem;
	z-index: 105;
	width: 16rem;
	max-height: min(70vh, 520px);
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(
		165deg,
		rgba(255, 255, 255, 0.496) 0%,
		rgba(255, 255, 255, 0.352) 50%,
		rgba(255, 255, 255, 0.448) 100%
	);
	-webkit-backdrop-filter: blur(26px) saturate(180%);
	backdrop-filter: blur(26px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 24px;
	box-shadow:
		inset 0 1px 1px rgba(255, 255, 255, 0.9),
		inset 0 -1px 1px rgba(255, 255, 255, 0.4),
		0 12px 40px rgba(15, 23, 42, 0.14);
	opacity: 0;
	pointer-events: none;
	transform: translate(calc(-100% - 4rem), -50%);
	transition: transform 300ms ease, opacity 300ms ease;
}

.floating-menu-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(90% 55% at 15% -5%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 60%),
		radial-gradient(80% 45% at 95% 0%, rgba(196, 181, 253, 0.25), rgba(255, 255, 255, 0) 65%),
		linear-gradient(120deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0.3) 52%, rgba(255, 255, 255, 0) 62%);
}

.floating-menu-panel > * {
	position: relative;
	z-index: 1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.floating-menu-trigger {
		background: rgba(255, 255, 255, 0.96);
	}

	.floating-menu-panel {
		background: rgba(255, 255, 255, 0.96);
	}
}

.floating-menu-panel__head {
	flex-shrink: 0;
	border-bottom-color: rgba(255, 255, 255, 0.55);
}

/* Markup ships text-neutral-600; that light grey drops under 4.5:1 wherever the
   glass sits over a dark backdrop, so labels are darkened here instead. */
.floating-menu-panel .floating-menu-link:not([aria-current="page"]) {
	color: #262626;
}

.floating-menu-panel .floating-menu-link:not([aria-current="page"]):hover {
	color: #0a0a0a;
}

/* Icons ship text-neutral-400, near 2:1 on glass, under the 3:1 graphics floor.
   Held a step lighter than the label so the icon still reads as secondary. */
.floating-menu-link:not([aria-current="page"]) .floating-menu-link__icon {
	color: #525252;
}

.floating-menu-link:not([aria-current="page"]):hover .floating-menu-link__icon {
	color: #262626;
}

/* Active item: track the link's indigo rather than pinning a grey. */
.floating-menu-link[aria-current="page"] .floating-menu-link__icon {
	color: inherit;
}

/* Item states stay translucent so the glass reads through them */
.floating-menu-panel .floating-menu-link:hover {
	background-color: rgba(255, 255, 255, 0.5);
}

.floating-menu-panel .floating-menu-link[aria-current="page"] {
	background-color: rgba(224, 231, 255, 0.6);
}

.floating-menu-panel__list {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 0.5rem 0;
	overflow-x: hidden;
	overflow-y: auto;
	list-style: none;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.floating-menu-link__icon,
.floating-menu-link__icon > img,
.floating-menu-link__icon > svg {
	width: 30px;
	height: 30px;
}

.floating-menu-link__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 30px;
}

.floating-menu-panel__list::-webkit-scrollbar {
	width: 4px;
}

.floating-menu-panel__list::-webkit-scrollbar-thumb {
	border-radius: 9999px;
	background: rgba(0, 0, 0, 0.15);
}

.floating-menu-panel.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translate(3.75rem, -50%);
}

.floating-menu-pin.flex {
	display: flex;
}

@media (max-width: 640px) {
	/* Phone: under sticky header, then +200% of trigger height (3rem → +6rem). */
	.floating-menu-root {
		top: calc(var(--bsmarty-header-height, 3.575rem) + 6mm);
		bottom: auto;
		left: 1rem;
		transform: none;
	}

	.floating-menu-panel {
		top: calc(var(--bsmarty-header-height, 3.575rem) + 6mm);
		bottom: auto;
		left: 4.75rem;
		width: min(16rem, calc(100vw - 5.75rem));
		max-height: min(60vh, 420px);
		transform: translateX(calc(-100% - 4.75rem));
	}

	.floating-menu-panel.is-open {
		transform: none;
	}
}

@media (min-width: 1024px) {
	body.home .floating-menu-root,
	body.home .floating-menu-panel {
		top: 44%;
	}
}
