/**
 * WhatsApp Product Order — frontend styles.
 * Colors are driven by inline --wpo-bg / --wpo-fg variables set per button,
 * so admin color settings always win without needing dynamic stylesheets.
 *
 * Layout rules use !important on a small number of properties because some
 * themes wrap product buttons in flex/inline containers that would otherwise
 * collapse the button to its content width. This keeps the button full-width
 * everywhere without fighting the theme.
 */

/* Block-level wrapper guarantees the button gets a full-width line of its own. */
.wpo-button-wrap {
	display: block !important;
	width: 100% !important;
	clear: both;
	margin: 12px 0 0 !important;
}

.wpo-whatsapp-button {
	--wpo-bg: #25D366;
	--wpo-fg: #ffffff;

	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 14px 20px !important;
	font-size: 16px !important;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--wpo-fg) !important;
	background-color: var(--wpo-bg) !important;
	background-image: none !important;
	border: none !important;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
	transition: filter 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
	float: none !important;
	text-transform: none !important;
}

/* Extra-specific overrides to beat aggressive theme button styles (e.g. Ecomus). */
body .wpo-button-wrap button.wpo-whatsapp-button,
body button#wpo-order-button.wpo-whatsapp-button {
	width: 100% !important;
	max-width: 100% !important;
	display: flex !important;
	float: none !important;
	color: var(--wpo-fg) !important;
	background-color: var(--wpo-bg) !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none;
}

body button#wpo-order-button.wpo-whatsapp-button:hover {
	color: var(--wpo-fg) !important;
	background-color: var(--wpo-bg) !important;
}

.wpo-whatsapp-button:hover {
	filter: brightness(0.93);
	color: var(--wpo-fg) !important;
	background-color: var(--wpo-bg) !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.wpo-whatsapp-button:active {
	transform: translateY(1px);
}

.wpo-whatsapp-button:focus-visible {
	outline: 3px solid rgba(37, 211, 102, 0.45);
	outline-offset: 2px;
}

.wpo-whatsapp-button.wpo-loading {
	opacity: 0.7;
	pointer-events: none;
}

.wpo-wa-icon {
	width: 22px !important;
	height: 22px !important;
	min-width: 22px;
	flex: 0 0 auto !important;
	display: inline-block;
	vertical-align: middle;
}

.wpo-btn-text {
	display: inline-block;
	line-height: 1.2;
}

/* Floating button */
.wpo-floating-button {
	--wpo-bg: #25D366;
	--wpo-fg: #ffffff;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wpo-fg);
	background-color: var(--wpo-bg);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wpo-floating-button:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.wpo-floating-button svg {
	width: 30px;
	height: 30px;
}

/* Mobile */
@media (max-width: 600px) {
	.wpo-whatsapp-button {
		font-size: 15px;
		padding: 13px 16px;
	}
	.wpo-floating-button {
		width: 52px;
		height: 52px;
		right: 16px;
		bottom: 16px;
	}
	.wpo-floating-button svg {
		width: 28px;
		height: 28px;
	}
}
