/* ============================================================
   WooCommerce 询价插件 — 前端样式（参考 YITH Request a Quote）
   询价模式：屏蔽原生 Add to Cart，改用“Add to quote”。
   ============================================================ */

/* ---- 1. 屏蔽原生 Add to Cart 按钮（详情页 + 列表页 + 区块网格） ----
 * 注意：只隐藏按钮与数量选择器，不能隐藏整个 .wc-block-add-to-cart-form
 * 容器，否则“Add to quote”按钮（位于该容器内）也会被一并隐藏。
 */
.woocommerce .single_add_to_cart_button,
.woocommerce form.cart .quantity,
.woocommerce .wc-block-add-to-cart-form .quantity,
.woocommerce .wc-block-add-to-cart-form button[type="submit"],
.woocommerce .wc-block-add-to-cart-form .wc-block-components-button,
.woocommerce .add_to_cart_button,
.woocommerce .product_type_simple,
.woocommerce .added_to_cart,
.woocommerce .wc-block-grid__product-add-to-cart,
.wc-block-grid__product .add_to_cart_button,
.wc-block-grid__product .wp-block-button {
	display: none !important;
}

/* ---- 2. Add to quote 按钮 -------------------------------------------------- */
.wcqr-add-to-quote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	padding: 14px 28px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.2px;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	color: #ffffff !important;
	background: #0f766e;
	border: 1px solid #0f766e;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.wcqr-add-to-quote:hover {
	background: #0b5e58;
	border-color: #0b5e58;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.wcqr-add-to-quote:active {
	transform: translateY(1px);
}

.wcqr-add-to-quote:focus-visible {
	outline: 2px solid #0f766e;
	outline-offset: 2px;
}

.wcqr-add-to-quote.wcqr-in-list {
	background: #2f9e6e;
	border-color: #2f9e6e;
}

/* 详情页按钮与 Add to Cart 同一行 */
.woocommerce div.product form.cart {
	align-items: center;
}

/* ---- 3. 询价单页面 --------------------------------------------------------- */
.wcqr-quote-wrap {
	max-width: 860px;
	margin: 2rem auto;
	font-family: inherit;
	color: #1c1c1c;
}

/* 空状态 */
.wcqr-empty {
	padding: 56px 24px;
	text-align: center;
	background: #f7f7f7;
	border: 1px dashed #d4d4d4;
	border-radius: 12px;
}

.wcqr-empty-icon {
	display: block;
	font-size: 40px;
	margin-bottom: 8px;
}

.wcqr-empty p {
	margin: 0 0 18px;
	color: #555;
}

.wcqr-empty-cta {
	display: inline-block;
	padding: 12px 24px;
	color: #fff;
	background: #0f766e;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
}

.wcqr-empty-cta:hover {
	background: #0b5e58;
	color: #fff;
	text-decoration: none;
}

/* 询价单卡片 */
.wcqr-quote-card {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin-bottom: 28px;
}

.wcqr-table {
	width: 100%;
	border-collapse: collapse;
}

.wcqr-table th,
.wcqr-table td {
	padding: 14px 16px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid #f0f0f0;
}

.wcqr-table thead th {
	background: #fafafa;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: #6b7280;
}

.wcqr-table tbody tr:last-child td {
	border-bottom: none;
}

.wcqr-col-product {
	width: 46%;
}

.wcqr-thumb {
	display: inline-block;
	vertical-align: middle;
	width: 64px;
	height: 64px;
	margin-right: 14px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #eee;
	background: #fafafa;
}

.wcqr-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wcqr-product-meta {
	display: inline-block;
	vertical-align: middle;
}

.wcqr-product-name {
	font-weight: 600;
	color: #111;
	text-decoration: none;
}

.wcqr-product-name:hover {
	color: #0f766e;
	text-decoration: none;
}

.wcqr-sku {
	display: block;
	color: #9ca3af;
	font-size: 12px;
	margin-top: 3px;
	letter-spacing: 0.4px;
}

.wcqr-col-price,
.wcqr-col-subtotal {
	font-variant-numeric: tabular-nums;
}

.wcqr-qty {
	width: 66px;
	padding: 8px 6px;
	text-align: center;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}

.wcqr-qty:focus {
	outline: none;
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.wcqr-remove {
	width: 32px;
	height: 32px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	color: #6b7280;
	background: transparent;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.wcqr-remove:hover {
	color: #b91c1c;
	background: #fef2f2;
	border-color: #fecaca;
}

/* 合计 */
.wcqr-totals {
	display: flex;
	align-items: baseline;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 20px;
	background: #fafafa;
	border-top: 1px solid #f0f0f0;
}

.wcqr-totals-label {
	color: #6b7280;
	font-size: 14px;
}

.wcqr-totals-amount {
	font-size: 20px;
	font-weight: 700;
	color: #111;
}

/* ---- 4. 询价表单 ---------------------------------------------------------- */
.wcqr-form {
	max-width: 720px;
	margin: 0 auto;
	padding: 32px;
	background: #fcfcfd;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
}

.wcqr-form h3 {
	margin: 0 0 6px;
	font-size: 22px;
}

.wcqr-form-desc {
	margin: 0 0 22px;
	color: #6b7280;
	font-size: 14px;
	line-height: 1.5;
}

.wcqr-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.wcqr-form label {
	display: block;
}

.wcqr-form label.wcqr-full {
	grid-column: 1 / -1;
}

.wcqr-form label span {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #374151;
}

.wcqr-form input[type="text"],
.wcqr-form input[type="email"],
.wcqr-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	font-size: 14px;
	color: #111;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wcqr-form input:focus,
.wcqr-form textarea:focus {
	outline: none;
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.wcqr-feedback {
	min-height: 1.4em;
	margin: 16px 0 0;
	font-size: 14px;
	font-weight: 600;
}

.wcqr-feedback.wcqr-error { color: #b91c1c; }
.wcqr-feedback.wcqr-success { color: #0f766e; }

.wcqr-submit {
	display: inline-block;
	margin-top: 18px;
	padding: 14px 34px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	background: #0f766e;
	border: 1px solid #0f766e;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.wcqr-submit:hover {
	background: #0b5e58;
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.wcqr-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---- 5. 响应式 ------------------------------------------------------------- */
@media (max-width: 600px) {
	.wcqr-form-row {
		grid-template-columns: 1fr;
	}
	.wcqr-thumb { width: 52px; height: 52px; }
	.wcqr-table th, .wcqr-table td { padding: 10px 8px; }
	.wcqr-col-price, .wcqr-col-subtotal { font-size: 13px; }
}

/* ---- 6. 减少动态效果 -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.wcqr-add-to-quote,
	.wcqr-remove,
	.wcqr-submit,
	.wcqr-empty-cta {
		transition: none;
	}
	.wcqr-add-to-quote:active {
		transform: none;
	}
}
