/**
 * PowerSynch Floating Button — the green "Contact Us" pill that docks
 * against the edge of the viewport (Figma node 11881:11175), plus the
 * contact popup it opens.
 *
 * Colours and the vertical offset arrive as inline custom properties from
 * the settings screen, so this file only carries the design defaults.
 *
 * Every rule is scoped under .psad-fab-dock. The pill is a <button> in
 * popup mode, and theme resets routinely style `[type=button], button`
 * (attribute selectors, specificity 0,1,0) — an unscoped `.psad-fab` ties
 * with those and loses on source order, which repaints the pill in the
 * theme's button colours. The extra class in the selector settles it, and
 * the reset block below neutralises whatever else the theme sets.
 */

.psad-fab-dock {
	--psad-fab-bg:      #007900;
	--psad-fab-color:   #ffffff;
	--psad-fab-offset:  0px;
	--psad-fab-radius:  152px;
	--psad-fab-shadow:  -6px 22px 51.15px rgba( 50, 112, 50, 0.62 );

	position: fixed;
	z-index: 99990;

	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;

	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.psad-fab-dock--right {
	right: 0;
}

.psad-fab-dock--left {
	left: 0;
	align-items: flex-start;
}

.psad-fab-dock--center {
	top: 50%;
	transform: translateY( calc( -50% + var(--psad-fab-offset) ) );
}

.psad-fab-dock--bottom {
	bottom: calc( 32px + var(--psad-fab-offset) );
}

.psad-fab-dock *,
.psad-fab-dock *::before,
.psad-fab-dock *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- pill */

.psad-fab-dock .psad-fab {
	-webkit-appearance: none;
	appearance: none;

	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 12px 20px 12px 16px;
	border: 0;

	background: var(--psad-fab-bg);
	background-image: none;
	color: var(--psad-fab-color);
	border-radius: var(--psad-fab-radius) 0 0 var(--psad-fab-radius);
	box-shadow: var(--psad-fab-shadow);
	text-shadow: none;

	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	font-style: normal;
	line-height: 28px;
	letter-spacing: 0;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;

	transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

/* The edge-facing corners stay square so the pill reads as attached to the
   viewport, exactly as in the design. */
.psad-fab-dock--left .psad-fab {
	flex-direction: row-reverse;
	padding: 12px 12px 12px 20px;
	border-radius: 0 var(--psad-fab-radius) var(--psad-fab-radius) 0;
	box-shadow: 6px 22px 51.15px rgba( 50, 112, 50, 0.62 );
}

.psad-fab-dock .psad-fab:hover,
.psad-fab-dock .psad-fab:focus,
.psad-fab-dock .psad-fab:focus-visible,
.psad-fab-dock .psad-fab:active {
	background: var(--psad-fab-bg);
	color: var(--psad-fab-color);
	border: 0;
}

.psad-fab-dock .psad-fab:hover,
.psad-fab-dock .psad-fab:focus-visible {
	filter: brightness( 1.08 );
	box-shadow: -6px 26px 56px rgba( 50, 112, 50, 0.72 );
	transform: translateX( -4px );
}

.psad-fab-dock--left .psad-fab:hover,
.psad-fab-dock--left .psad-fab:focus-visible {
	box-shadow: 6px 26px 56px rgba( 50, 112, 50, 0.72 );
	transform: translateX( 4px );
}

.psad-fab-dock .psad-fab:focus {
	outline: none;
}

.psad-fab-dock .psad-fab:focus-visible {
	outline: 2px solid var(--psad-fab-color);
	outline-offset: 3px;
}

.psad-fab-dock .psad-fab__icon {
	display: block;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	overflow: hidden;
}

.psad-fab-dock .psad-fab__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.psad-fab-dock .psad-fab__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* The exported glyphs are stroked white; follow the configured text colour
   so a custom palette keeps icon and label in sync. */
.psad-fab-dock .psad-fab__icon svg [stroke] {
	stroke: currentColor;
}

.psad-fab-dock .psad-fab__label {
	display: block;
	color: inherit;
	font: inherit;
}

@media ( min-width: 768px ) {
	.psad-fab-dock .psad-fab__icon--mobile-only {
		display: none;
	}
}

/* Icon-only pill ("Show the label" off): the glyph alone, edge-docked just
   like the full pill. Sits after the --left rule so it wins the padding. */
.psad-fab-dock .psad-fab--icon-only {
	gap: 0;
	padding: 12px 14px;
}

/* The label is taken off screen, not removed, so the button keeps its
   accessible name. */
.psad-fab-dock .psad-fab__label--sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------------------- popup */

.psad-fab-dock .psad-fab-popup {
	--psad-popup-bg:     #ffffff;
	--psad-popup-title:  #101828;
	--psad-popup-muted:  #667085;
	--psad-popup-border: #eaecf0;

	width: 300px;
	max-width: calc( 100vw - 32px );
	margin: 0 12px;
	padding: 14px;

	background: var(--psad-popup-bg);
	border: 0;
	border-radius: 16px;
	box-shadow: 0 18px 44px rgba( 16, 24, 40, 0.18 );

	opacity: 0;
	transform: translateY( 8px );
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.psad-fab-dock .psad-fab-popup[hidden] {
	display: none;
}

.psad-fab-dock .psad-fab-popup.is-open {
	opacity: 1;
	transform: translateY( 0 );
}

.psad-fab-dock .psad-fab-popup__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.psad-fab-dock .psad-fab-popup__title {
	margin: 0;
	padding: 0;
	color: var(--psad-popup-title);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
}

.psad-fab-dock .psad-fab-popup__close {
	-webkit-appearance: none;
	appearance: none;

	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-height: 0;
	margin: 0 0 0 auto;
	padding: 0;

	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	color: var(--psad-popup-muted);
	font-family: inherit;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}

.psad-fab-dock .psad-fab-popup__close:hover,
.psad-fab-dock .psad-fab-popup__close:focus-visible {
	background: #f2f4f7;
	border: 0;
	color: var(--psad-popup-title);
}

.psad-fab-dock .psad-fab-popup__note {
	margin: 0 0 8px;
	padding: 0;
	color: var(--psad-popup-muted);
	font-family: inherit;
	font-size: 13px;
	line-height: 20px;
}

.psad-fab-dock .psad-fab-popup__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.psad-fab-dock .psad-fab-popup__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.psad-fab-dock .psad-fab-popup__item::before,
.psad-fab-dock .psad-fab-popup__item::marker {
	content: none;
}

.psad-fab-dock .psad-fab-popup__item + .psad-fab-popup__item {
	border-top: 1px solid var(--psad-popup-border);
}

.psad-fab-dock .psad-fab-popup__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 8px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	box-shadow: none;
	color: var(--psad-popup-title);
	font-family: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.psad-fab-dock .psad-fab-popup__link:hover,
.psad-fab-dock .psad-fab-popup__link:focus-visible {
	background: rgba( 0, 121, 0, 0.08 );
	color: var(--psad-popup-title);
	text-decoration: none;
}

.psad-fab-dock .psad-fab-popup__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba( 0, 121, 0, 0.1 );
	color: var(--psad-fab-bg);
}

.psad-fab-dock .psad-fab-popup__icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

.psad-fab-dock .psad-fab-popup__icon svg [stroke] {
	stroke: currentColor;
}

.psad-fab-dock .psad-fab-popup__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.psad-fab-dock .psad-fab-popup__item-label {
	color: var(--psad-popup-muted);
	font-size: 12px;
	font-weight: 500;
	line-height: 18px;
}

.psad-fab-dock .psad-fab-popup__value {
	font-size: 15px;
	font-weight: 500;
	line-height: 22px;
	overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- mobile */

@media ( max-width: 767px ) {
	.psad-fab-dock .psad-fab {
		font-size: 16px;
		line-height: 24px;
	}

	.psad-fab-dock--mobile-icon .psad-fab {
		gap: 0;
		padding: 12px 14px;
	}

	/* The mobile design is icon-only. Keep the label available to assistive
	   technology while removing it from the visual layout. */
	.psad-fab-dock:not(.psad-fab-dock--mobile-hidden) .psad-fab__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect( 0, 0, 0, 0 );
		clip-path: inset( 50% );
		white-space: nowrap;
		border: 0;
	}

	.psad-fab-dock:not(.psad-fab-dock--mobile-hidden) .psad-fab {
		gap: 0;
		padding: 12px 14px;
	}

	.psad-fab-dock--mobile-hidden {
		display: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.psad-fab-dock .psad-fab,
	.psad-fab-dock .psad-fab-popup,
	.psad-fab-dock .psad-fab-popup__link {
		transition: none;
	}

	.psad-fab-dock .psad-fab:hover,
	.psad-fab-dock .psad-fab:focus-visible,
	.psad-fab-dock--left .psad-fab:hover,
	.psad-fab-dock--left .psad-fab:focus-visible {
		transform: none;
	}

	.psad-fab-dock .psad-fab-popup {
		transform: none;
	}
}
