/**
 * Soma Optic floating actions.
 * CSS-only phone pulse; the back-to-top control reuses Woodmart's native JS.
 */
:root {
	--wd-soma-fab-size: 52px;
	--wd-soma-fab-edge: 18px;
	--wd-soma-fab-bottom: 20px;
}

.wd-soma-floating-phone,
body .scrollToTop {
	position: fixed;
	bottom: var(--wd-soma-fab-bottom);
	z-index: 351;
	height: var(--wd-soma-fab-size);
	box-sizing: border-box;
}

.wd-soma-floating-phone {
	right: var(--wd-soma-fab-edge);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 166px;
	padding: 0 0 0 15px;
	border-radius: 999px;
	background: var(--wd-primary-color, #ff6b5a);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	color: #fff;
	direction: ltr;
	isolation: isolate;
	transform: translateZ(0);
	transition: transform .2s ease, box-shadow .2s ease;
}

.wd-soma-floating-phone:hover,
.wd-soma-floating-phone:focus-visible {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
}

.wd-soma-floating-phone:focus-visible,
.scrollToTop:focus-visible {
	outline: 3px solid rgba(255, 255, 255, .95);
	outline-offset: 3px;
}

.wd-soma-floating-phone__number {
	position: relative;
	z-index: 2;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .25px;
	font-variant-numeric: tabular-nums;
}

.wd-soma-floating-phone__icon-wrap {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 var(--wd-soma-fab-size);
	width: var(--wd-soma-fab-size);
	height: var(--wd-soma-fab-size);
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
}

.wd-soma-floating-phone__icon {
	position: relative;
	z-index: 2;
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.wd-soma-floating-phone__pulse {
	position: absolute;
	inset: 0;
	z-index: -1;
	border: 2px solid currentColor;
	border-radius: 50%;
	opacity: 0;
	animation: wd-soma-phone-pulse 2.2s ease-out infinite;
	will-change: transform, opacity;
}

@keyframes wd-soma-phone-pulse {
	0% {
		transform: scale(.92);
		opacity: .52;
	}
	68%, 100% {
		transform: scale(1.48);
		opacity: 0;
	}
}

/* Override Woodmart's default right-side position while keeping its native behavior. */
body .scrollToTop {
	right: auto;
	left: var(--wd-soma-fab-edge);
	width: var(--wd-soma-fab-size);
	border-radius: 50%;
	line-height: var(--wd-soma-fab-size);
	background: rgba(var(--bgcolor-white-rgb, 255, 255, 255), .94);
	border: 1px solid var(--brdcolor-gray-300, rgba(0, 0, 0, .105));
	box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
	color: var(--wd-primary-color, #ff6b5a);
	transform: translateX(-120%);
	transition: opacity .22s ease, transform .22s ease, box-shadow .2s ease;
}

body .scrollToTop.button-show {
	transform: none;
}

body .scrollToTop:hover {
	color: var(--wd-primary-color, #ff6b5a);
	box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

@media (max-width: 767px) {
	:root {
		--wd-soma-fab-size: 48px;
		--wd-soma-fab-edge: 14px;
		--wd-soma-fab-bottom: 16px;
	}

	.wd-soma-floating-phone {
		min-width: 154px;
		padding-left: 13px;
		gap: 6px;
	}

	.wd-soma-floating-phone__number {
		font-size: 12px;
	}

	.wd-soma-floating-phone__icon {
		width: 22px;
		height: 22px;
	}

	.sticky-toolbar-on .wd-soma-floating-phone,
	body.sticky-toolbar-on .scrollToTop {
		bottom: 74px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wd-soma-floating-phone,
	body .scrollToTop {
		transition: none;
	}

	.wd-soma-floating-phone__pulse {
		animation: none;
		display: none;
	}
}
