/* ============================================================
 * BIOTA · Floating Live Chat button (bottom-right, site-wide)
 * Markup: biota_chat_fab() in functions.php · behaviour: chat-fab.js
 *
 * z-index 45 sits under the header (50) and the cart / menu drawers and their
 * scrims (60–61), so an open drawer covers the button instead of the other
 * way round. Not rendered on checkout (its mobile pay bar owns the bottom).
 * ============================================================ */

#biota-chatfab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 45;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: var(--wp--preset--font-family--body);
}

.biota-chatfab__btn {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--wp--preset--color--action);
	color: #ffffff;
	box-shadow: 0 6px 20px rgba(7, 73, 169, 0.32);
	cursor: pointer;
	transition: transform 0.2s, background 0.2s;
}
.biota-chatfab__btn:hover {
	background: var(--wp--preset--color--primary);
}
.biota-chatfab__btn:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-sky, #9cc3ff);
	outline-offset: 3px;
}
/* The button swaps its bubble for a cross while the menu is open. */
.biota-chatfab__x,
#biota-chatfab.is-open .biota-chatfab__btn > svg:first-child {
	display: none;
}
#biota-chatfab.is-open .biota-chatfab__x {
	display: block;
}

.biota-chatfab__menu {
	box-sizing: border-box;
	width: 260px;
	padding: 14px;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(13, 15, 20, 0.16);
}
.biota-chatfab__menu[hidden] {
	display: none;
}
.biota-chatfab__title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--text-muted);
}
.biota-chatfab__opt {
	display: block;
	padding: 11px 12px;
	border-radius: 10px;
	background: var(--wp--preset--color--surface-light);
	color: var(--wp--preset--color--text);
	text-decoration: none;
}
.biota-chatfab__opt + .biota-chatfab__opt {
	margin-top: 8px;
}
.biota-chatfab__opt:hover,
.biota-chatfab__opt:focus-visible {
	background: var(--wp--preset--color--surface-subtle);
}
.biota-chatfab__label {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
}
.biota-chatfab__sub {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	color: var(--wp--preset--color--text-muted);
}

@media (max-width: 860px) {
	#biota-chatfab {
		right: 16px;
		bottom: 16px;
	}
	.biota-chatfab__btn {
		width: 52px;
		height: 52px;
	}
	/* Clear the cart page's sticky buy bar (~66px) so the button never sits on
	   its Checkout CTA. */
	body.woocommerce-cart #biota-chatfab {
		bottom: 84px;
	}
}
/* Product pages: step up over the sticky CTA bar while it is showing (the bar
   exists at ≤782px only, see .biota-stickybar in pdp.css). */
@media (max-width: 782px) {
	#biota-chatfab {
		transition: bottom 0.25s ease;
	}
	body.biota-stickybar-on #biota-chatfab {
		bottom: calc(82px + env(safe-area-inset-bottom));
	}
}
