/* Виджет MAX на главной */
.max-widget {
	position: fixed;
	z-index: 50;
}

.max-widget__icon {
	position: relative;
	display: block;
}

.max-widget__icon::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: 25%;
	background: linear-gradient(135deg, #44ccff, #5533ee 66%, #9933dd);
	filter: blur(8px);
	animation: max-widget-glow 2.5s ease-in-out infinite;
}

.max-widget__logo {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.max-widget__tip {
	font-size: 14px;
	line-height: 20px;
	white-space: nowrap;
	color: #111;
}

@keyframes max-widget-glow {
	0%, 100% {
		opacity: .25;
		transform: scale(.95);
	}
	50% {
		opacity: .8;
		transform: scale(var(--max-widget-glow-scale, 1.25));
	}
}

@media (min-width: 769px) {
	.max-widget {
		right: 40px;
		bottom: 44px;
		display: block;
	}

	.max-widget__icon {
		width: 50px;
		height: 50px;
	}

	.max-widget__tip {
		position: absolute;
		top: 50%;
		right: calc(100% + 14px);
		padding: 6px 12px;
		background: #fff;
		border-radius: 3px;
		box-shadow: 0 0 12px rgba(9, 164, 223, .5);
		opacity: 0;
		transform: translate(6px, -50%);
		transition: opacity .2s, transform .2s;
		pointer-events: none;
	}

	.max-widget:hover .max-widget__tip,
	.max-widget:focus-visible .max-widget__tip {
		opacity: 1;
		transform: translate(0, -50%);
		transition-delay: .3s;
	}
}

@media (max-width: 768px) {
	/* отступ снизу, чтобы бар не закрывал конец страницы */
	body {
		padding-bottom: 48px;
	}

	.max-widget {
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 48px;
		background: #fff;
		border-top: 1px solid #e5e5e5;
	}

	.max-widget__icon {
		width: 30px;
		height: 30px;
		margin-right: 10px;
	}

	.max-widget__icon::before {
		--max-widget-glow-scale: 1.1;
		filter: blur(3px);
	}

	.ui-to-top {
		bottom: 63px;
	}

	/* плашка cookie стоит у нижнего края: бар появится, когда её закроют */
	body:has(.cookie_modal.view) .max-widget {
		visibility: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.max-widget__icon::before {
		animation: none;
		opacity: .5;
		transform: scale(1.1);
	}
}
