/**
 * Amwaj Core - WhatsApp module.
 *
 * Colours and offsets come from CSS custom properties printed inline by PHP,
 * so this file is identical for every page and stays browser-cached.
 */

.amwaj-wa-float {
	position: fixed;
	right: var( --amwaj-wa-x, 12px );
	bottom: var( --amwaj-wa-y, 60px );
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var( --amwaj-wa-bg, #22c15e );
	color: var( --amwaj-wa-fg, #fff );
	box-shadow: 0 4px 12px rgba( 0, 0, 0, .18 );
	transition: transform .18s ease;
	-webkit-tap-highlight-color: transparent;
}

.amwaj-wa-float:hover,
.amwaj-wa-float:focus-visible {
	color: var( --amwaj-wa-fg, #fff );
	transform: scale( 1.06 );
}

.amwaj-wa-float svg {
	display: block;
}

/* Auto-popup greeting bubble. */
.amwaj-wa-bubble {
	position: fixed;
	right: calc( var( --amwaj-wa-x, 12px ) + 66px );
	bottom: calc( var( --amwaj-wa-y, 60px ) + 8px );
	z-index: 9999999;
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: min( 260px, calc( 100vw - 100px ) );
	padding: 10px 12px;
	border-radius: 10px;
	background: #fff;
	color: #2e2f32;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, .16 );
}

.amwaj-wa-bubble__close {
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: .55;
}

.amwaj-wa-bubble__close:hover {
	opacity: 1;
}

/*
 * No RTL mirroring: the legacy widget stayed bottom-right in Arabic too, so
 * the bubble sits to the left of the button in both directions.
 */

/*
 * "Buy via WhatsApp" button on single products.
 *
 * These declarations are copied verbatim from the plugin this replaces, which
 * printed them in an inline <style> next to the button. The class is doubled in
 * the selector purely to raise specificity, because those rules used to sit
 * late in the document and therefore beat the theme's stylesheet; ours loads
 * from <head> and would otherwise lose the cascade.
 */
a.wws-product-query-btn.amwaj-wa-product {
	display: inline-flex;
	width: auto;
	align-items: center;
	justify-content: center;
	margin: 5px 0;
	padding: 5px 8px;
	border-radius: 3px;
	position: relative;
	text-decoration: none !important;
}

.amwaj-wa-product .wws-product-query-btn__text {
	display: flex;
	flex-direction: column;
	margin-left: 10px;
}

.amwaj-wa-product .wws-product-query-btn__text span {
	font-size: 15px;
	line-height: 20px;
}

@media ( prefers-reduced-motion: reduce ) {

	.amwaj-wa-float {
		transition: none;
	}
}
