/**
 * Orui Floating Contact 1.0.1
 * Scoped component styles. Every selector is bound to #orui-floating-contact so
 * the theme, header/nav, Ask AI entry, cookie bar and inquiry form are never
 * touched.
 *
 * Geometry contract:
 *   desktop (>782px): four 56px circles, 12px gap, centered right rail
 *   compact (<=782px): four 48px circles, 10px gap, bottom-right
 *     - closed: one 48px toggle circle
 *     - open: three 48px action circles above it; labels sit OUTSIDE the
 *       circle to the left, so button geometry never changes
 *     - back-to-top is a separate 48px circle above the toggle
 */

#orui-floating-contact.orui-fc {
	--orui-fc-size: 56px;
	--orui-fc-gap: 12px;
	--orui-fc-edge: 24px;
	--orui-fc-bottom: 24px;
	--orui-fc-ink: #24344e;
	--orui-fc-ink-soft: #33465f;
	--orui-fc-ink-deep: #1b2839;
	--orui-fc-wa: #159447;
	--orui-fc-wa-deep: #0b7d3a;
	--orui-fc-font: "Catamaran", "Helvetica Neue", Arial, sans-serif;

	position: fixed;
	inset-block-start: 50%;
	inset-inline-end: calc(var(--orui-fc-edge) + env(safe-area-inset-right, 0px));
	transform: translateY(-50%);
	z-index: 90;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--orui-fc-gap);
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	pointer-events: none;
	font-family: var(--orui-fc-font);
	font-size: 14px;
	line-height: 1.2;
	text-align: left;
	color: #fff;
}

#orui-floating-contact .orui-fc__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--orui-fc-gap);
	margin: 0;
	padding: 0;
}

#orui-floating-contact .orui-fc__item {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--orui-fc-size);
	height: var(--orui-fc-size);
	min-width: var(--orui-fc-size);
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	color: #fff;
	background-image: linear-gradient(160deg, var(--orui-fc-ink-soft) 0%, var(--orui-fc-ink-deep) 100%);
	box-shadow: 0 8px 20px rgba(27, 40, 57, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
	transition: transform 160ms ease, box-shadow 160ms ease, background-image 160ms ease;
}

/* WhatsApp: darker brand greens; white icon stays >= 3:1 across the gradient. */
#orui-floating-contact .orui-fc__item--whatsapp {
	background-image: linear-gradient(160deg, var(--orui-fc-wa) 0%, var(--orui-fc-wa-deep) 100%);
	box-shadow: 0 8px 20px rgba(11, 125, 58, 0.28);
}

#orui-floating-contact .orui-fc__item:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(27, 40, 57, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#orui-floating-contact .orui-fc__item--whatsapp:hover {
	box-shadow: 0 12px 26px rgba(11, 125, 58, 0.34);
}

#orui-floating-contact .orui-fc__item:active {
	transform: translateY(0);
}

#orui-floating-contact .orui-fc__item:focus-visible {
	outline: 3px solid var(--orui-fc-ink);
	outline-offset: 3px;
	box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(36, 52, 78, 0.55), 0 8px 20px rgba(27, 40, 57, 0.26);
}

#orui-floating-contact .orui-fc__svg {
	display: block;
	width: 24px;
	height: 24px;
	flex: none;
	pointer-events: none;
}

/* Desktop hover/focus label. Outside the circle; never changes its box. */
#orui-floating-contact .orui-fc__text {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: calc(100% + 12px);
	transform: translate(6px, -50%);
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fff;
	color: var(--orui-fc-ink-deep);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(20, 30, 45, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 160ms ease, transform 160ms ease;
}

#orui-floating-contact .orui-fc__item:hover .orui-fc__text,
#orui-floating-contact .orui-fc__item:focus-visible .orui-fc__text {
	opacity: 1;
	visibility: visible;
	transform: translate(0, -50%);
}

/* Compact toggle is mobile/tablet only and stays a 48px circle. */
#orui-floating-contact .orui-fc__toggle {
	display: none;
}

/* Back to top: reserved space in the desktop rail, no layout shift. */
#orui-floating-contact .orui-fc__top {
	visibility: hidden;
	opacity: 0;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

#orui-floating-contact[data-top-visible="true"] .orui-fc__top {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	transition: opacity 180ms ease, transform 180ms ease, visibility 0s;
}

#orui-floating-contact[data-top-visible="true"] .orui-fc__top:hover {
	transform: translateY(-2px);
}

#orui-floating-contact[data-top-visible="false"] .orui-fc__top:focus-visible {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* Existing site overlays: never draw on top of the WP mobile menu. */
#orui-floating-contact[data-nav-open="true"] {
	display: none;
}

body.has-modal-open #orui-floating-contact {
	display: none;
}

@media (max-width: 782px) {
	#orui-floating-contact.orui-fc {
		--orui-fc-size: 48px;
		--orui-fc-gap: 10px;
		--orui-fc-edge: 16px;
		/* Conservative clearance for the Hostinger Ask AI launcher and cookie
		   bar in the bottom-right corner. Not measured from unrelated
		   components, so no other element is read or modified. */
		--orui-fc-bottom: 88px;
		inset-block-start: auto;
		inset-block-end: calc(var(--orui-fc-bottom) + env(safe-area-inset-bottom, 0px));
		transform: none;
	}

	#orui-floating-contact .orui-fc__toggle {
		display: inline-flex;
	}

	#orui-floating-contact .orui-fc__actions[data-open="false"] {
		display: none;
	}

	#orui-floating-contact .orui-fc__actions[data-open="true"] {
		display: flex;
		animation: orui-fc-enter 180ms ease-out both;
	}

	/* Expanded labels: separate text to the left of the circle. */
	#orui-floating-contact .orui-fc__actions .orui-fc__text {
		position: absolute;
		inset-block-start: 50%;
		inset-inline-end: calc(100% + 10px);
		transform: translate(4px, -50%);
		display: block;
		padding: 7px 10px;
		border-radius: 8px;
		background: #fff;
		color: var(--orui-fc-ink-deep);
		font-size: 13px;
		font-weight: 600;
		line-height: 1;
		white-space: nowrap;
		box-shadow: 0 6px 18px rgba(20, 30, 45, 0.18);
		opacity: 1;
		visibility: visible;
		pointer-events: none;
	}

	#orui-floating-contact .orui-fc__actions[data-open="true"] .orui-fc__text {
		transform: translate(0, -50%);
	}

	/* Back to top sits above the toggle, independent of the flex stack. */
	#orui-floating-contact .orui-fc__top {
		position: fixed;
		inset-inline-end: calc(var(--orui-fc-edge) + env(safe-area-inset-right, 0px));
		inset-block-end: calc(var(--orui-fc-bottom) + var(--orui-fc-size) + var(--orui-fc-gap) + env(safe-area-inset-bottom, 0px));
	}

	#orui-floating-contact[data-open="true"] .orui-fc__top {
		display: none;
	}

	/* Form focus / software keyboard only suppresses the compact control. */
	#orui-floating-contact[data-form-focus="true"],
	#orui-floating-contact[data-keyboard="true"] {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 140ms ease, visibility 0s linear 140ms;
	}
}

@keyframes orui-fc-enter {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Short or landscape viewports: shrink spacing so the rail always fits. */
@media (max-height: 560px) {
	#orui-floating-contact.orui-fc {
		--orui-fc-size: 48px;
		--orui-fc-gap: 8px;
	}
}

@media (max-width: 782px) and (max-height: 560px) {
	#orui-floating-contact.orui-fc {
		--orui-fc-bottom: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#orui-floating-contact .orui-fc__item,
	#orui-floating-contact .orui-fc__text,
	#orui-floating-contact .orui-fc__top,
	#orui-floating-contact[data-form-focus="true"],
	#orui-floating-contact[data-keyboard="true"] {
		transition: none;
	}

	#orui-floating-contact .orui-fc__item:hover,
	#orui-floating-contact[data-top-visible="true"] .orui-fc__top:hover {
		transform: none;
	}

	#orui-floating-contact .orui-fc__actions[data-open="true"] {
		animation: none;
	}
}

@media (forced-colors: active) {
	#orui-floating-contact .orui-fc__item {
		border: 1px solid ButtonText;
		background-image: none;
		background-color: ButtonFace;
		color: ButtonText;
	}

	#orui-floating-contact .orui-fc__item:focus-visible {
		outline: 3px solid Highlight;
	}
}

@media print {
	#orui-floating-contact.orui-fc {
		display: none !important;
	}
}
