/* WhatsApp Product Enquiry Button — front-end styles */

.wpe-fab {
	--wpe-color: #25D366;
	position: fixed;
	bottom: 24px;
	z-index: 99998;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--wpe-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	padding: 0;
}

.wpe-fab:hover,
.wpe-fab:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.wpe-fab.wpe-pos-right {
	right: 24px;
}

.wpe-fab.wpe-pos-left {
	left: 24px;
}

.wpe-fab-icon {
	width: 30px;
	height: 30px;
	display: inline-flex;
}

.wpe-fab-icon svg {
	width: 100%;
	height: 100%;
}

/* Subtle pulse to draw the eye without being obnoxious */
.wpe-fab::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	animation: wpe-pulse 2.4s infinite;
	pointer-events: none;
}

@keyframes wpe-pulse {
	0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45); }
	70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 480px) {
	.wpe-fab {
		width: 52px;
		height: 52px;
		bottom: 16px;
	}
	.wpe-fab.wpe-pos-right { right: 16px; }
	.wpe-fab.wpe-pos-left { left: 16px; }
}

/* ------------------------------------------------------------------
 * Buy Now, restyled as a WhatsApp button
 *
 * Themes set the button colour from an inline <style> block that loads
 * after this file, and draw their own icon with a ::before glyph — hence
 * the !important flags and the blanked pseudo-element.
 * ------------------------------------------------------------------ */

.wpe-buy-now-whatsapp {
	--wpe-color: #25D366;
	background-color: var(--wpe-color) !important;
	background-image: none !important;
	border-color: var(--wpe-color) !important;
	color: #fff !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 9px;
	transition: filter 0.15s ease;
}

.wpe-buy-now-whatsapp:hover,
.wpe-buy-now-whatsapp:focus {
	background-color: var(--wpe-color) !important;
	border-color: var(--wpe-color) !important;
	color: #fff !important;
	filter: brightness(0.92);
}

/* Kill the theme's own cart glyph */
.wpe-buy-now-whatsapp::before,
.wpe-buy-now-whatsapp::after {
	content: none !important;
	display: none !important;
	margin: 0 !important;
}

.wpe-buy-now-whatsapp .wpe-btn-icon {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
}

.wpe-buy-now-whatsapp .wpe-btn-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Cart page: our button sits where "Proceed to checkout" was */
.wpe-cart-wa-btn {
	display: flex !important;
	width: 100%;
	text-align: center;
	cursor: pointer;
}

/* Safety net for any extra checkout button a theme renders from its own
   template rather than through the WooCommerce hook we unhooked. */
.woocommerce-cart .checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-mini-cart__buttons a.checkout {
	display: none !important;
}

/* Modal overlay */
.wpe-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(17, 24, 21, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wpe-modal-overlay[hidden] {
	display: none !important;
}

.wpe-modal {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 420px;
	border-radius: 14px;
	padding: 28px 24px 24px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
	max-height: 90vh;
	overflow-y: auto;
	box-sizing: border-box;
}

.wpe-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 6px;
}

.wpe-modal-close:hover {
	color: #111815;
}

.wpe-modal h2#wpe-modal-heading {
	margin: 0 0 6px;
	font-size: 20px;
	color: #111815;
}

.wpe-modal-sub {
	margin: 0 0 18px;
	font-size: 14px;
	color: #6b7280;
	line-height: 1.4;
}

/* Product being enquired about */
.wpe-product-summary {
	display: block;
	background: #f3f6f4;
	border: 1px solid #e2e8e4;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 0 0 18px;
}

.wpe-product-summary[hidden] {
	display: none;
}

.wpe-ps-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #111815;
	line-height: 1.35;
}

.wpe-ps-meta {
	display: block;
	font-size: 13px;
	color: #4b5563;
	margin-top: 3px;
}

.wpe-ps-meta:empty {
	display: none;
}

#wpe-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #111815;
	margin: 14px 0 6px;
}

#wpe-form label:first-of-type {
	margin-top: 0;
}

.wpe-req {
	color: #e0245e;
}

#wpe-form input,
#wpe-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	color: #111815;
	background: #fff;
}

#wpe-form input:focus,
#wpe-form textarea:focus {
	outline: none;
	border-color: var(--wpe-color, #25D366);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

#wpe-form textarea {
	resize: vertical;
}

.wpe-field-error {
	background: #fdecec;
	color: #b42318;
	border: 1px solid #f6b4ae;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	margin: 0 0 12px;
}

.wpe-field-error[hidden] {
	display: none;
}

.wpe-submit-btn {
	margin-top: 20px;
	width: 100%;
	background: #25D366;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background 0.15s ease;
}

.wpe-submit-btn:hover {
	background: #1ebd5a;
}

body.wpe-modal-open {
	overflow: hidden;
}
