/**
 * B2B RFQ Pro — frontend base styles.
 * Elementor widget Style-tab controls override these via {{WRAPPER}}-scoped
 * selectors, which win on specificity, so these are just sane defaults for
 * the shortcode fallback and unstyled widget instances.
 */

/**
 * Failsafe: hide any native WooCommerce "Add to Cart" button that might
 * still render through a path our PHP-side filters don't reach — e.g. a
 * theme's own markup, or WooCommerce Blocks (Product Collection/All
 * Products blocks), which render via the Store API and never fire the
 * classic woocommerce_after_shop_loop_item / add_to_cart_link hooks at
 * all. This is a store-wide RFQ-only site: the only button that should
 * ever be visible is "Add to RFQ".
 */
.add_to_cart_button,
.ajax_add_to_cart,
.single_add_to_cart_button,
a.button.product_type_simple,
a.button.product_type_variable,
a.button.product_type_grouped,
a.button.product_type_external,
.wc-block-components-product-button,
.wc-block-grid__product-add-to-cart,
.wp-block-woocommerce-product-button {
	display: none !important;
}

.b2b-rfq-add-to-cart-form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.b2b-rfq-qty-input {
	width: 60px;
}

.b2b-rfq-add-to-cart-feedback {
	font-size: 0.85em;
	color: #2e7d32;
}

.b2b-rfq-mini-cart {
	position: relative;
	display: inline-block;
}

.b2b-rfq-mini-cart-toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.b2b-rfq-mini-cart-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	font-size: 20px;
	line-height: 1;
	transition: color 0.15s ease;
}

.b2b-rfq-mini-cart-icon svg {
	width: 1em;
	height: 1em;
}

.b2b-rfq-mini-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: #1a1a1a;
	color: #fff;
	font-size: 11px;
	line-height: 1;
}

.b2b-rfq-mini-cart-panel {
	display: none;
	position: absolute;
	right: 0;
	top: 100%;
	z-index: 100;
	min-width: 260px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 12px;
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.08 );
}

.b2b-rfq-mini-cart:hover .b2b-rfq-mini-cart-panel,
.b2b-rfq-mini-cart:focus-within .b2b-rfq-mini-cart-panel {
	display: block;
}

.b2b-rfq-mini-cart-items {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.b2b-rfq-mini-cart-item {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 13px;
}

.b2b-rfq-mini-cart-view-btn {
	display: block;
	width: 100%;
	text-align: center;
}

.b2b-rfq-cart-form {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
}

.b2b-rfq-cart-form-items,
.b2b-rfq-cart-form-fields {
	flex: 1 1 320px;
	min-width: 280px;
}

.b2b-rfq-cart-form-heading {
	margin-top: 0;
}

.b2b-rfq-cart-table {
	width: 100%;
	border-collapse: collapse;
}

.b2b-rfq-cart-table th,
.b2b-rfq-cart-table td {
	text-align: left;
	padding: 8px;
	border-bottom: 1px solid #e0e0e0;
}

.b2b-rfq-cart-qty-input {
	width: 70px;
}

.b2b-rfq-cart-remove-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #b00020;
}

.b2b-rfq-submission-form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.b2b-rfq-field {
	flex: 1 1 45%;
	margin: 0;
}

.b2b-rfq-field-full {
	flex: 1 1 100%;
}

.b2b-rfq-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.b2b-rfq-field input,
.b2b-rfq-field textarea,
.b2b-rfq-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	font: inherit;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.b2b-rfq-field input:focus,
.b2b-rfq-field textarea:focus,
.b2b-rfq-field select:focus {
	border-color: #1a1a1a;
	outline: none;
}

.b2b-rfq-phone-group {
	display: flex;
	gap: 8px;
}

.b2b-rfq-phone-code {
	flex: 0 0 auto;
	width: auto;
	max-width: 45%;
}

.b2b-rfq-phone-number {
	flex: 1 1 auto;
}

.b2b-rfq-required {
	color: #b00020;
}

/**
 * Honeypot field: visually hidden off-screen (not display:none) so bots
 * that specifically skip display:none inputs still fill it in, while
 * aria-hidden + tabindex="-1" in the markup keeps it invisible to screen
 * readers and unreachable by keyboard for real visitors.
 */
.b2b-rfq-hp-field {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.b2b-rfq-form-message {
	min-height: 1em;
}

.b2b-rfq-form-message:not(:empty) {
	padding: 10px 14px;
	border-radius: 4px;
}

.b2b-rfq-form-message-success {
	color: #2e7d32;
	background-color: #eaf6ea;
	border: 1px solid #2e7d32;
}

.b2b-rfq-form-message-error {
	color: #b00020;
	background-color: #fbeaec;
	border: 1px solid #b00020;
}

@media ( max-width: 480px ) {
	.b2b-rfq-phone-group {
		flex-direction: column;
	}

	.b2b-rfq-phone-code {
		max-width: 100%;
	}
}

@media ( max-width: 768px ) {
	.b2b-rfq-cart-form {
		flex-direction: column;
	}
}
