/*
 * Общесайтовый плавающий рельс быстрых действий (es52-rail) + кнопка «наверх»
 * (es63-to-top). Перенос из эталонных макетов, встречается во всех 8 файлов.
 * Цвета согласованы с уже принятой палитрой esc2/prc/prv (cyan вместо
 * --future-aqua, orange #f58220 как на «Контактах»/«Производстве»).
 */

.es52-rail,
.es63-to-top {
	--ar-ink: #06171d;
	--ar-panel: rgba(10, 26, 33, .9);
	--ar-line: rgba(85, 227, 220, .22);
	--ar-cyan: #4aa3ab;
	--ar-cyan-text: #dffefd;
	--ar-orange: #f58220;
}

.es52-rail {
	position: fixed;
	z-index: 9997;
	right: 18px;
	top: 50%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	transform: translate(54px, -50%);
	font-family: Montserrat, Arial, sans-serif;
	transition: transform .38s cubic-bezier(.2, .75, .2, 1);
}

.es52-rail.is-open {
	transform: translate(0, -50%);
}

.es52-rail__toggle {
	position: absolute;
	right: 100%;
	top: 50%;
	display: grid;
	place-items: center;
	width: 34px;
	height: 64px;
	padding: 0;
	border: 1px solid rgba(85, 227, 220, .16);
	border-right: 0;
	color: rgba(223, 254, 253, .72);
	background: rgba(10, 26, 33, .76);
	box-shadow: -8px 10px 30px rgba(4, 12, 16, .14);
	backdrop-filter: blur(12px);
	cursor: pointer;
	transform: translateY(-50%);
	transition: color .25s ease, background .25s ease;
}

.es52-rail__toggle:hover,
.es52-rail__toggle:focus-visible {
	color: var(--ar-cyan);
	background: rgba(10, 26, 33, .94);
	outline: none;
}

.es52-rail__toggle svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	transition: transform .35s ease;
}

.es52-rail.is-open .es52-rail__toggle svg {
	transform: rotate(180deg);
}

.es52-rail__toggle::after {
	content: "";
	position: absolute;
	right: 6px;
	top: 10px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ar-orange);
	box-shadow: 0 0 0 0 rgba(255, 120, 23, .45);
	animation: es52-contact-dot 2.6s ease-out infinite;
}

.es52-rail__group {
	display: grid;
	gap: 0;
	padding: 3px;
	overflow: visible;
	border: 1px solid rgba(85, 227, 220, .13);
	background: rgba(10, 26, 33, .82);
	box-shadow: 0 14px 38px rgba(4, 12, 16, .18);
	backdrop-filter: blur(15px);
}

.es52-rail__item {
	position: relative;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, .055);
	color: rgba(223, 254, 253, .72) !important;
	background: transparent;
	text-decoration: none !important;
	cursor: pointer;
	transition: color .28s ease, background .28s ease, transform .28s cubic-bezier(.2, .75, .2, 1), box-shadow .28s ease;
}

.es52-rail__item:last-child {
	border-bottom: 0;
}

.es52-rail__item svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.es52-rail__item::before {
	content: attr(data-label);
	position: absolute;
	right: calc(100% + 13px);
	top: 50%;
	width: max-content;
	max-width: 230px;
	padding: 10px 13px;
	color: #fff;
	background: var(--ar-ink);
	border-left: 2px solid var(--ar-orange);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	opacity: 0;
	pointer-events: none;
	transform: translate(8px, -50%);
	transition: opacity .25s ease, transform .25s ease;
}

.es52-rail__item:hover,
.es52-rail__item:focus-visible,
.es52-rail__item.is-active {
	color: var(--ar-cyan) !important;
	background: rgba(85, 227, 220, .075);
	transform: translateX(-2px);
	outline: none;
}

.es52-rail__item:hover::before,
.es52-rail__item:focus-visible::before {
	opacity: 1;
	transform: translate(0, -50%);
}

.es52-rail__item--call {
	color: rgba(255, 164, 94, .9) !important;
	background: rgba(255, 120, 23, .055);
}

.es52-rail__item--call:hover,
.es52-rail__item--call:focus-visible {
	color: #ff8b33 !important;
	background: rgba(255, 120, 23, .1);
}

.es52-rail__item--call::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 1px solid rgba(255, 120, 23, .52);
	animation: es52-call-pulse 2.5s ease-out infinite;
}

.es52-rail__max-icon {
	width: 20px;
	height: 20px;
	display: block;
}

.es52-rail__messengers {
	position: absolute;
	right: calc(100% + 13px);
	top: 0;
	display: flex;
	gap: 7px;
	padding: 7px;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	background: rgba(10, 26, 33, .96);
	border: 1px solid rgba(85, 227, 220, .22);
	box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
	transform: translateX(10px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.es52-rail__messengers.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: translateX(0);
}

.es52-rail__messengers a {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	color: var(--ar-cyan-text) !important;
	background: rgba(255, 255, 255, .05);
	text-decoration: none;
	transition: background .25s ease, color .25s ease, transform .25s ease;
}

.es52-rail__messengers a:hover {
	color: var(--ar-ink) !important;
	background: var(--ar-cyan);
	transform: translateY(-3px);
}

.es52-rail__messengers svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@keyframes es52-call-pulse {
	0% { opacity: .75; transform: scale(.92); }
	70%, 100% { opacity: 0; transform: scale(1.2); }
}

@keyframes es52-contact-dot {
	0% { box-shadow: 0 0 0 0 rgba(255, 120, 23, .48); }
	65%, 100% { box-shadow: 0 0 0 8px rgba(255, 120, 23, 0); }
}

/* Back to top */

.es63-to-top {
	position: fixed;
	z-index: 9996;
	right: 78px;
	bottom: 24px;
	display: grid;
	grid-template-columns: 34px auto;
	align-items: center;
	min-height: 46px;
	padding: 5px 15px 5px 5px;
	border: 1px solid rgba(85, 227, 220, .24);
	color: #eaffff !important;
	background: var(--ar-panel);
	box-shadow: 0 14px 36px rgba(4, 12, 16, .2);
	backdrop-filter: blur(14px);
	font: 700 10px/1 Montserrat, Arial, sans-serif !important;
	letter-spacing: .11em;
	text-decoration: none !important;
	text-transform: uppercase;
	opacity: 0;
	pointer-events: none;
	transform: translateY(14px);
	transition: opacity .28s ease, transform .28s ease, border-color .28s ease;
	clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.es63-to-top::after {
	content: "";
	position: absolute;
	top: 0;
	right: 9px;
	width: 30px;
	height: 2px;
	background: var(--ar-orange);
	transform: skewX(-38deg);
	transform-origin: right;
}

.es63-to-top b {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	color: var(--ar-cyan);
	font-size: 21px;
	font-weight: 500;
	transition: transform .25s ease;
}

.es63-to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.es63-to-top:hover {
	border-color: rgba(85, 227, 220, .58);
}

.es63-to-top:hover b {
	transform: translateY(-3px);
}

@media (max-width: 1060px) {
	.es52-rail {
		right: 10px;
		top: auto;
		bottom: 74px;
		align-items: flex-end;
		transform: none;
	}

	.es52-rail__toggle {
		position: relative;
		right: auto;
		top: auto;
		display: grid;
		width: 48px;
		height: 48px;
		border: 1px solid rgba(85, 227, 220, .2);
		background: rgba(10, 26, 33, .94);
		transform: none;
	}

	.es52-rail__group {
		position: absolute;
		right: 0;
		bottom: calc(100% + 8px);
		grid-template-columns: repeat(3, 44px);
		gap: 0;
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
		transform: translateY(8px);
		transition: opacity .22s ease, transform .22s ease, visibility .22s;
	}

	.es52-rail.is-open .es52-rail__group {
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0);
	}

	.es52-rail__item {
		width: 44px;
		height: 44px;
		border-bottom: 0;
		border-right: 1px solid rgba(255, 255, 255, .055);
	}

	.es52-rail__item:last-child {
		border-right: 0;
	}

	.es52-rail__item::before {
		display: none;
	}

	.es52-rail__messengers {
		right: 0;
		top: auto;
		bottom: calc(100% + 62px);
	}

	.es63-to-top {
		right: 12px;
		bottom: 18px;
		grid-template-columns: 34px;
		padding: 5px;
	}

	.es63-to-top span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.es52-rail,
	.es52-rail__item--call::after,
	.es52-rail__toggle::after,
	.es63-to-top {
		transition: none;
		animation: none;
	}
}

/* S2-318: home back-to-top geometry and adaptive palette in the catalogue. */
.es63-to-top {bottom:calc(var(--es-cookie-height, 0px) + 18px);}
body.efs2-menu-lock :is(.es52-rail,.es63-to-top) {visibility:hidden;}
@media (min-width:768px) and (max-width:1180px) {.es63-to-top {right:90px;}}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top {width:auto;min-width:44px;min-height:44px;height:44px;padding:0 14px;grid-template-columns:18px auto;gap:10px;background:rgba(255,255,255,.94);color:#005b6c!important;border:1px solid rgba(0,91,108,.25);border-radius:0;box-shadow:0 3px 12px rgba(7,17,22,.1);font-size:10px;letter-spacing:.08em;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top::after {width:28px;height:2px;background:#f58220;transform:none;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top.is-over-light {background:#005b6c;color:#fff!important;border-color:#005b6c;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top b {width:18px;height:24px;color:currentColor;font-size:18px;font-weight:400;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top:hover,body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top:focus-visible {background:#005b6c;color:#fff!important;border-color:#005b6c;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top.is-over-light:hover {background:#173a43;border-color:#173a43;}
body:is(.prod1-page,.direction-page,.tax-product_cat,.single-product,.page-id-343,.esc2-contact-body,.es-favorites-body) .es63-to-top:focus-visible {outline:2px solid #f58220;outline-offset:3px;}

/* Contacts use the shared back-to-top control on mobile too. */
body.esc2-contact-body .es63-to-top {display:grid!important;}
