/**
 * WooCommerce B2B/B2C Inquiry Button - Frontend Styles
 *
 * Colors, radius, etc. that are admin-configurable are injected via
 * wp_add_inline_style() in class-frontend.php. This file only contains
 * layout, responsive, hover, loading and disabled states so the
 * per-site color/radius values remain easily overridable.
 */

/* ----------------------------------------------------------------
 * Wrapper
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-btn-wrap {
	display: block;
	margin: 12px 0;
	clear: both;
}

.wc-b2b-inquiry-btn-wrap--loop {
	margin: 8px 0 0;
}

/* ----------------------------------------------------------------
 * Base button
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	white-space: normal;
	cursor: pointer;
	border: none;
	outline: none;
	background-color: #25D366;
	color: #ffffff;
	border-radius: 4px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.wc-b2b-inquiry-btn::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.29-1.39a9.9 9.9 0 0 0 4.75 1.21h.01c5.46 0 9.9-4.45 9.9-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2m0 1.67c2.2 0 4.27.86 5.82 2.42a8.2 8.2 0 0 1 2.42 5.82c0 4.55-3.7 8.24-8.25 8.24a8.2 8.2 0 0 1-4.19-1.15l-.3-.17-3.14.82.84-3.06-.19-.32a8.18 8.18 0 0 1-1.26-4.36c0-4.55 3.7-8.24 8.25-8.24m-4.55 4.72c-.15 0-.4.06-.61.29-.21.24-.8.78-.8 1.9 0 1.12.82 2.2.93 2.35.11.15 1.6 2.44 3.87 3.42.54.23.96.37 1.29.48.54.17 1.03.14 1.42.09.43-.07 1.34-.55 1.53-1.08.19-.53.19-.98.13-1.08-.06-.1-.21-.15-.43-.27-.23-.11-1.34-.66-1.55-.74-.21-.08-.36-.11-.51.11-.15.23-.59.74-.72.89-.13.15-.27.17-.5.06-.23-.11-.96-.35-1.83-1.13-.68-.6-1.13-1.35-1.27-1.58-.13-.23-.01-.35.1-.47.11-.1.23-.27.35-.4.11-.13.15-.23.23-.38.08-.15.04-.29-.02-.4-.06-.12-.51-1.28-.72-1.75-.19-.46-.38-.4-.53-.4h-.45z'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.29-1.39a9.9 9.9 0 0 0 4.75 1.21h.01c5.46 0 9.9-4.45 9.9-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2m0 1.67c2.2 0 4.27.86 5.82 2.42a8.2 8.2 0 0 1 2.42 5.82c0 4.55-3.7 8.24-8.25 8.24a8.2 8.2 0 0 1-4.19-1.15l-.3-.17-3.14.82.84-3.06-.19-.32a8.18 8.18 0 0 1-1.26-4.36c0-4.55 3.7-8.24 8.25-8.24m-4.55 4.72c-.15 0-.4.06-.61.29-.21.24-.8.78-.8 1.9 0 1.12.82 2.2.93 2.35.11.15 1.6 2.44 3.87 3.42.54.23.96.37 1.29.48.54.17 1.03.14 1.42.09.43-.07 1.34-.55 1.53-1.08.19-.53.19-.98.13-1.08-.06-.1-.21-.15-.43-.27-.23-.11-1.34-.66-1.55-.74-.21-.08-.36-.11-.51.11-.15.23-.59.74-.72.89-.13.15-.27.17-.5.06-.23-.11-.96-.35-1.83-1.13-.68-.6-1.13-1.35-1.27-1.58-.13-.23-.01-.35.1-.47.11-.1.23-.27.35-.4.11-.13.15-.23.23-.38.08-.15.04-.29-.02-.4-.06-.12-.51-1.28-.72-1.75-.19-.46-.38-.4-.53-.4h-.45z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.wc-b2b-inquiry-btn--full {
	display: flex;
	width: 100%;
}

.wc-b2b-inquiry-btn--auto {
	display: inline-flex;
	width: auto;
}

.wc-b2b-inquiry-btn--single {
	padding: 16px 32px;
	font-size: 17px;
}

.wc-b2b-inquiry-btn--b2b.wc-b2b-inquiry-btn--single {
	padding: 18px 32px;
	font-size: 18px;
}

/* ----------------------------------------------------------------
 * Hover / focus / active animation
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-btn:hover,
.wc-b2b-inquiry-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.wc-b2b-inquiry-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ----------------------------------------------------------------
 * Loading state (toggled via JS class on click, e.g. before redirect)
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-btn.is-loading {
	pointer-events: none;
	opacity: 0.75;
	cursor: progress;
}

.wc-b2b-inquiry-btn.is-loading::after {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: 4px;
	border: 2px solid rgba(255, 255, 255, 0.6);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: wc-b2b-inquiry-spin 0.6s linear infinite;
}

@keyframes wc-b2b-inquiry-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ----------------------------------------------------------------
 * Disabled state (no WhatsApp number configured, etc.)
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-btn.is-disabled,
.wc-b2b-inquiry-btn[aria-disabled="true"] {
	pointer-events: none;
	opacity: 0.5;
	cursor: not-allowed;
	filter: grayscale(0.3);
}

/* ----------------------------------------------------------------
 * Suppress WoodMart / WooCommerce cart controls on B2B products.
 * Layered defensively on top of the PHP is_purchasable() filter which
 * already prevents these elements from rendering in nearly all cases;
 * these selectors simply guarantee visual consistency if a theme
 * caches markup or renders a button via client-side JS.
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-type-b2b .add_to_cart_button,
.wc-b2b-inquiry-type-b2b .ajax_add_to_cart,
.wc-b2b-inquiry-type-b2b .single_add_to_cart_button,
.wc-b2b-inquiry-type-b2b .product_type_external,
.wc-b2b-inquiry-type-b2b .wd-buy-now-btn,
.wc-b2b-inquiry-type-b2b .wd-buy-now,
.wc-b2b-inquiry-type-b2b .woodmart-buy-now-button,
.wc-b2b-inquiry-type-b2b .buy-now-button,
.wc-b2b-inquiry-type-b2b form.cart .quantity,
body.wc-b2b-inquiry-b2b .add_to_cart_button,
body.wc-b2b-inquiry-b2b .single_add_to_cart_button,
body.wc-b2b-inquiry-b2b .wd-buy-now-btn,
body.wc-b2b-inquiry-b2b .woodmart-buy-now-button,
body.wc-b2b-inquiry-b2b .buy-now-button {
	display: none !important;
}

/* Quantity hiding is conditional on the admin setting; when disabled
 * this class is simply never added to the wrapper by the JS fallback,
 * and the PHP quantity args no longer force min=max=1. */
.wc-b2b-inquiry-hide-qty form.cart .quantity {
	display: none !important;
}

/* ----------------------------------------------------------------
 * Admin-only "WhatsApp number missing" notice (never shown to customers)
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-admin-notice {
	margin: 12px 0;
	padding: 10px 14px;
	background: #fff3cd;
	border: 1px solid #ffe69c;
	border-left: 4px solid #d9a300;
	border-radius: 4px;
	font-size: 13px;
	color: #664d03;
}

.wc-b2b-inquiry-admin-notice a {
	font-weight: 600;
	text-decoration: underline;
}

/* ----------------------------------------------------------------
 * Responsive breakpoints
 * ---------------------------------------------------------------- */

/* Tablet */
@media (max-width: 782px) {
	.wc-b2b-inquiry-btn {
		padding: 13px 22px;
		font-size: 15px;
	}

	.wc-b2b-inquiry-btn--single {
		padding: 15px 24px;
		font-size: 16px;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.wc-b2b-inquiry-btn {
		width: 100%;
		padding: 14px 16px;
		font-size: 15px;
	}

	.wc-b2b-inquiry-btn-wrap {
		margin: 10px 0;
	}
}

/* ----------------------------------------------------------------
 * Admin settings screen
 * ---------------------------------------------------------------- */
.wc-b2b-inquiry-admin-wrap .form-table th {
	width: 260px;
}

.wc-b2b-inquiry-admin-wrap code {
	background: #f0f0f1;
	padding: 2px 6px;
	border-radius: 3px;
}
