/* =========================================================================
 * B2B Inquiry Mode
 * 1) Hide commerce leftovers (prices, add-to-cart, wishlist/compare/size-guide)
 * 2) Inquiry button styling
 * 3) Popup modal styled after xunpan.jpg
 * ======================================================================= */

/* ------------------------------------------------------------------ */
/* 1) Hide commerce leftovers                                          */
/* ------------------------------------------------------------------ */

/* Prices anywhere on WooCommerce pages (loops, single, floating bar, search suggestions) */
body.woocommerce .price,
body.woocommerce-page .price,
.product-price {
	display: none !important;
}

/* SALE badge */
body.woocommerce span.onsale,
body.woocommerce-page span.onsale {
	display: none !important;
}

/* Single product: add-to-cart row (emptied by purchasable=false), floating bar,
   and the Wishlist / Compare / Size Guide row */
.single-product .ct-product-add-to-cart,
.single-product .ct-floating-bar,
.single-product .ct-product-additional-actions {
	display: none !important;
}

/* ------------------------------------------------------------------ */
/* 2) Inquiry button                                                   */
/* ------------------------------------------------------------------ */

.b2b-inquiry-wrap {
	margin-top: 4px;
}

.b2b-inquiry-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	max-width: 420px;
	padding: 15px 32px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(180deg, #f2a722 0%, #e08a0c 100%);
	color: #241503;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.2px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(224, 138, 12, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.b2b-inquiry-btn:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(224, 138, 12, 0.45);
}

.b2b-inquiry-btn:active {
	transform: translateY(0);
}

.b2b-arrow {
	font-weight: 700;
	transition: transform 0.15s ease;
}

.b2b-inquiry-btn:hover .b2b-arrow {
	transform: translateX(3px);
}

.b2b-inquiry-note {
	margin: 10px 0 0;
	font-size: 13px;
	color: #6b7280;
}

/* ------------------------------------------------------------------ */
/* 3) Modal                                                            */
/* ------------------------------------------------------------------ */

.b2b-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.b2b-modal.is-open {
	display: flex;
}

.b2b-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 35, 0.62);
	backdrop-filter: blur(2px);
}

.b2b-modal__card {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba(9, 18, 33, 0.45);
	animation: b2b-pop 0.22s ease;
}

@keyframes b2b-pop {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Top bar */
.b2b-modal__topbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 16px;
	background: #14263e;
	color: rgba(255, 255, 255, 0.92);
	font-size: 13px;
	font-weight: 500;
}

.b2b-dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.b2b-close {
	margin-left: auto;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.75);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

.b2b-close:hover {
	color: #fff;
}

/* Body */
.b2b-modal__body {
	padding: 22px 24px 20px;
}

.b2b-kicker {
	margin: 0 0 6px;
	color: #e08a0c;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

.b2b-title {
	margin: 0 0 8px;
	color: #16283f;
	font-size: 25px;
	line-height: 1.22;
	font-weight: 800;
}

.b2b-sub {
	margin: 0 0 18px;
	color: #6b7280;
	font-size: 13.5px;
	line-height: 1.5;
}

/* CF7 form inside the modal */
.b2b-form label {
	display: block;
	margin: 0 0 14px;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
}

.b2b-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 14px;
}

/* CF7 autop() wraps both fields into one <p>; unwrap them so each
   label becomes its own grid column, and drop the injected <br>. */
.b2b-form-grid p {
	display: contents;
}

.b2b-form-grid br {
	display: none;
}

.b2b-form input[type="text"],
.b2b-form textarea {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 11px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #111827;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.b2b-form textarea {
	min-height: 88px;
	resize: vertical;
}

.b2b-form input:focus,
.b2b-form textarea:focus {
	outline: none;
	border-color: #e08a0c;
	box-shadow: 0 0 0 3px rgba(224, 138, 12, 0.18);
}

.b2b-form ::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.b2b-form .wpcf7-not-valid-tip {
	margin-top: 4px;
	font-size: 12px;
	color: #dc2626;
}

.b2b-form input.wpcf7-not-valid,
.b2b-form textarea.wpcf7-not-valid {
	border-color: #dc2626;
}

.b2b-form .wpcf7-response-output {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	border-width: 0;
}

.b2b-form form[data-status="sent"] .wpcf7-response-output {
	background: #ecfdf5;
	color: #047857;
}

.b2b-form form[data-status="failed"] .wpcf7-response-output,
.b2b-form form[data-status="aborted"] .wpcf7-response-output {
	background: #fef2f2;
	color: #b91c1c;
}

/* Submit button (CF7 submit input) */
.b2b-form input[type="submit"],
.b2b-form button[type="submit"] {
	display: block;
	width: 100%;
	padding: 14px 24px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(180deg, #f2a722 0%, #e08a0c 100%);
	color: #241503;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(224, 138, 12, 0.35);
	transition: filter 0.15s ease;
}

.b2b-form input[type="submit"]:hover,
.b2b-form button[type="submit"]:hover {
	filter: brightness(1.05);
}

/* Trust badges */
.b2b-trust {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
}

.b2b-trust li {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #6b7280;
	font-size: 12px;
	line-height: 1.3;
}

.b2b-trust svg {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	fill: #16a34a;
}

/* Scroll lock */
body.b2b-no-scroll {
	overflow: hidden;
}

/* Mobile */
@media (max-width: 520px) {
	.b2b-form-grid {
		grid-template-columns: 1fr;
	}

	.b2b-title {
		font-size: 21px;
	}

	.b2b-trust {
		flex-direction: column;
		gap: 8px;
	}
}
