/* 右侧随动条：主按钮、展开联系、回顶。三点 → 叉 为纯 CSS 动画 */
.he-fr {
	--he-fr-w: 48px;
	--he-fr-gap: 10px;
	--he-fr-lbl-bg: #4a4a4a;
	--he-fr-lbl-fg: #ffffff;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 100050;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--he-fr-gap);
}

/* 上方次要按钮：仅由 JS 切换 .he-fr--open 显隐（无悬停展开） */
.he-fr__expand {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--he-fr-gap);
	max-height: 0;
	opacity: 0;
	visibility: hidden;
	overflow: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: max-height 0.35s ease, opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.35s;
}

.he-fr--open .he-fr__expand {
	max-height: min(560px, 86vh);
	opacity: 1;
	visibility: visible;
	overflow: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition: max-height 0.35s ease, opacity 0.28s ease, transform 0.28s ease, visibility 0s;
}

/* 展开区各圆形槽位：独立底色/图标色（由小工具外观里的 CSS 变量注入） */
.he-fr__btn.he-fr__btn--circ.he-fr__btn--slot-contact {
	background: var(--he-fr-slot-contact-bg, var(--he-fr-bg, #2c2c2c));
	color: var(--he-fr-slot-contact-ico, var(--he-fr-ico, #fff));
}

.he-fr__btn.he-fr__btn--circ.he-fr__btn--slot-whatsapp {
	background: var(--he-fr-slot-wa-bg, var(--he-fr-bg, #2c2c2c));
	color: var(--he-fr-slot-wa-ico, var(--he-fr-ico, #fff));
}

.he-fr__btn.he-fr__btn--circ.he-fr__btn--slot-extra.he-fr__btn--slot-extra-1 {
	background: var(--he-fr-slot-x1-bg, var(--he-fr-bg, #2c2c2c));
	color: var(--he-fr-slot-x1-ico, var(--he-fr-ico, #fff));
}

.he-fr__btn.he-fr__btn--circ.he-fr__btn--slot-extra.he-fr__btn--slot-extra-2 {
	background: var(--he-fr-slot-x2-bg, var(--he-fr-bg, #2c2c2c));
	color: var(--he-fr-slot-x2-ico, var(--he-fr-ico, #fff));
}

/* 一行：可选左侧灰标签 + 右侧圆形按钮（与弹窗/WhatsApp 同列） */
.he-fr__slot {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	max-width: min(360px, 90vw);
}

.he-fr__pill {
	padding: 4px 10px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.28;
	text-align: right;
	color: var(--he-fr-lbl-fg, #fff);
	background: var(--he-fr-lbl-bg, #4a4a4a);
	box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 文案与圆形按钮同行为：可点击的灰标签 */
button.he-fr__pill.he-fr__pill--hit,
a.he-fr__pill.he-fr__pill--hit {
	display: inline-block;
	max-width: 100%;
	margin: 0;
	border: 0;
	text-decoration: none;
	cursor: pointer;
	font: inherit;
	font-weight: 500;
	font-size: 14px;
	line-height: 1.28;
	text-align: right;
	-webkit-appearance: none;
	appearance: none;
	color: var(--he-fr-lbl-fg, #fff);
	background: var(--he-fr-lbl-bg, #4a4a4a);
	box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
}

a.he-fr__pill.he-fr__pill--hit:hover {
	color: var(--he-fr-lbl-fg, #fff);
}

.he-fr__expand .he-fr__btn--circ {
	flex-shrink: 0;
	border-radius: 0;
}

.he-fr__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--he-fr-w);
	height: var(--he-fr-w);
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	box-sizing: border-box;
	color: var(--he-fr-ico, #fff);
	background: var(--he-fr-bg, #2c2c2c);
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.he-fr__btn > svg{
	max-width: 20px
}

/* 方块主按钮 / 回顶：统一悬停底 */
a.he-fr__btn:not(.he-fr__btn--circ):hover,
button.he-fr__btn:not(.he-fr__btn--circ):hover {
	background: #3a3a3a;
	box-shadow: 0 4px 14px rgb(0 0 0 / 22%);
}

/* 彩色圆形槽位：不改变底色，仅用亮度微调，避免盖住单独配色 */
a.he-fr__btn.he-fr__btn--circ:hover,
button.he-fr__btn.he-fr__btn--circ:hover {
	filter: brightness(1.08);
	box-shadow: 0 4px 14px rgb(0 0 0 / 22%);
}

a.he-fr__btn.he-fr__btn--circ:focus-visible:hover,
button.he-fr__btn.he-fr__btn--circ:focus-visible:hover {
	filter: brightness(1.08);
}

a.he-fr__btn.he-fr__btn--circ,
button.he-fr__btn.he-fr__btn--circ {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.he-fr__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.he-fr__btn--toggle {
	padding: 0 4px;
	position: relative;
	z-index: 2;
}

.he-fr__btn--top {
	position: relative;
	z-index: 2;
}

/* 三点 / 叉：仅在 .he-fr--open 时变叉（与点击展开同步） */
.he-fr-ellipsis {
	position: relative;
	width: 22px;
	height: 16px;
	display: block;
}

.he-fr-ellipsis__d {
	position: absolute;
	top: 50%;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	transform-origin: center center;
	opacity: 1;
	--he-fr-morph: 0.45s;
	--he-fr-ease: cubic-bezier(0.5, 0, 0.2, 1);
	transition:
		left var(--he-fr-morph) var(--he-fr-ease),
		width var(--he-fr-morph) var(--he-fr-ease),
		height var(--he-fr-morph) var(--he-fr-ease),
		margin var(--he-fr-morph) var(--he-fr-ease),
		border-radius var(--he-fr-morph) var(--he-fr-ease),
		transform var(--he-fr-morph) var(--he-fr-ease),
		opacity 0.2s ease;
}

/* 默认：三颗横排小圆点 */
.he-fr-ellipsis__d:nth-child(1) {
	left: 0;
	transform: translate(0, -50%);
}
.he-fr-ellipsis__d:nth-child(2) {
	left: 9px;
	transform: translate(0, -50%);
}
.he-fr-ellipsis__d:nth-child(3) {
	left: 18px;
	transform: translate(0, -50%);
}

.he-fr--open .he-fr-ellipsis__d:nth-child(1) {
	left: 50%;
	width: 2px;
	height: 16px;
	border-radius: 1px;
	margin: 0;
	transform: translate(-50%, -50%) rotate(-45deg);
}

.he-fr--open .he-fr-ellipsis__d:nth-child(2) {
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	left: 50%;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0);
}

.he-fr--open .he-fr-ellipsis__d:nth-child(3) {
	left: 50%;
	width: 2px;
	height: 16px;
	border-radius: 1px;
	margin: 0;
	transform: translate(-50%, -50%) rotate(45deg);
}

/* 图标内联 SVG 尺寸 */
.he-fr__ico {
	display: block;
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.he-fr__ico--sm {
	width: 22px;
	height: 22px;
}

/* Elementor 图标：与内联 SVG 同尺寸、继承色 */
.he-fr__btn .elementor-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	color: inherit;
}

/* 非彩色槽时继承全局图标色 */
.he-fr__btn:not(.he-fr__btn--circ) .elementor-icon {
	color: var(--he-fr-ico, #fff);
}

.he-fr__btn .elementor-icon svg,
.he-fr__btn .e-font-icon-svg {
	width: 1em;
	height: 1em;
}

.he-fr__btn--toggle--custom {
	padding: 0 6px;
}

@media (prefers-reduced-motion: reduce) {
	.he-fr__expand,
	.he-fr-ellipsis__d {
		transition: none;
	}
}

@media (max-width: 480px) {
	.he-fr__pill {
		white-space: normal;
		max-width: 52vw;
		font-size: 13px;
		text-align: left;
	}
}
