/* ============================================================
   WooCommerce Request a Quote – Frontend Styles
   ============================================================ */

/* ── Design tokens (scoped to this plugin's pages only) ── */
body.woo-request-a-quote-page {
	--wrq-primary: #2555c7;
	--wrq-primary-dark: #1c3f9c;
	--wrq-primary-tint: #eef2fd;
	--wrq-success: #173a80;
	--wrq-success-tint: #ecf6fd;
	--wrq-success-border: #a6b7e9;
	--wrq-error: #d13438;
	--wrq-error-tint: #fdeeee;
	--wrq-error-border: #f3b7b8;
	--wrq-valid: #1029b9;
	--wrq-valid-tint: #f0f7fd;
	--wrq-invalid: #f43f5e;
	--wrq-invalid-tint: #fff5f7;
	--wrq-text: #1f2430;
	--wrq-text-muted: #6b7280;
	--wrq-border: #e6e8ee;
	--wrq-surface: #ffffff;
	--wrq-surface-muted: #f7f8fb;
	--wrq-input-bg: #f8faff;
	--wrq-radius: 12px;
	--wrq-radius-sm: 8px;
	--wrq-shadow: 0 1px 2px rgba(20, 24, 38, 0.04), 0 6px 20px rgba(20, 24, 38, 0.06);
}

.wrq-quote-wrap {
	color: var(--wrq-text);
}

.wrq-quote-wrap * {
	box-sizing: border-box;
}

/* ============================================================
   Add to Quote button (single product / archive)
   ============================================================ */

.wrq-add-to-quote {
	display: inline-block;
	margin-top: 8px;
}

.wrq-add-button.button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background-color: #2555c7;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
	box-shadow: 0 1px 2px rgba(20, 24, 38, 0.08);
}

.wrq-add-button.button:hover {
	background-color: #1c3f9c;
	color: #fff;
	box-shadow: 0 4px 10px rgba(37, 85, 199, 0.25);
}

.wrq-add-button.button:active {
	transform: translateY(1px);
}

.wrq-add-button.wrq-link {
	display: inline-block;
	color: #2555c7;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
}

.wrq-add-button.wrq-link:hover {
	color: #1c3f9c;
}

.wrq-add-button.loading {
	opacity: 0.6;
	pointer-events: none;
}

.wrq-feedback {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
}

.wrq-feedback.success { color: #17803d; }
.wrq-feedback.error   { color: #d13438; }
.wrq-feedback.notice  { color: #6b7280; }

.wrq-feedback a {
	margin-left: 4px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wrq-already-in-list {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #6b7280;
}

.wrq-already-in-list a {
	margin-left: 2px;
	text-decoration: underline;
	text-underline-offset: 2px;
	color: #2555c7;
}

/* ============================================================
   Page wrapper
   ============================================================ */

.wrq-quote-wrap {
	max-width: 880px;
	margin: 0 auto;
}

.wrq-page-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.wrq-page-header h2 {
	margin: 0;
	font-size: 22px;
}

.wrq-count-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--wrq-primary-tint);
	color: var(--wrq-primary);
	font-size: 13px;
	font-weight: 700;
}

/* ============================================================
   Notices
   ============================================================ */

.wrq-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border-radius: var(--wrq-radius-sm);
	padding: 14px 16px;
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.5;
}

.wrq-notice svg {
	flex-shrink: 0;
	margin-top: 2px;
}

.wrq-success,
.wrq-sent {
	background: var(--wrq-success-tint);
	border: 1px solid var(--wrq-success-border);
	color: #0f5c2c;
}

.wrq-success svg,
.wrq-sent svg { color: var(--wrq-success); }

.wrq-errors {
	background: var(--wrq-error-tint);
	border: 1px solid var(--wrq-error-border);
	color: #8a2224;
}

.wrq-errors svg { color: var(--wrq-error); }

.wrq-errors p { margin: 0 0 4px; }
.wrq-errors p:last-child { margin-bottom: 0; }

.wrq-notice-body { flex: 1; }
.wrq-notice-body p:first-child { margin-top: 0; }
.wrq-notice-body p:last-child { margin-bottom: 0; }

/* Sent confirmation gets a little more room to breathe. */
.wrq-sent {
	padding: 22px;
	align-items: center;
}

.wrq-sent strong {
	display: block;
	font-size: 16px;
	margin-bottom: 2px;
}

/* ============================================================
   Empty state
   ============================================================ */

.wrq-empty-state {
	text-align: center;
	padding: 56px 24px;
	border: 1px dashed var(--wrq-border);
	border-radius: var(--wrq-radius);
	background: var(--wrq-surface-muted);
}

.wrq-empty-state svg {
	color: #b7bccb;
	margin-bottom: 14px;
}

.wrq-empty-state p {
	margin: 0 0 18px;
	color: var(--wrq-text-muted);
	font-size: 15px;
}

.wrq-empty-state .button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 22px;
	background: var(--wrq-primary);
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: background-color 0.18s ease;
}

.wrq-empty-state .button:hover {
	background: var(--wrq-primary-dark);
	color: #fff;
}

/* ============================================================
   Quote table (card)
   ============================================================ */

.wrq-table-card {
	background: var(--wrq-surface);
	border: 1px solid var(--wrq-border);
	border-radius: var(--wrq-radius);
	box-shadow: var(--wrq-shadow);
	overflow: hidden;
	margin-bottom: 32px;
}

.wrq-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.wrq-table th,
.wrq-table td {
	padding: 14px 16px;
	border: none;
	border-bottom: 1px solid var(--wrq-border);
	vertical-align: middle;
	font-size: 14px;
}

.wrq-table thead th {
	background: var(--wrq-surface-muted);
	color: var(--wrq-text-muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-align: left;
	border-bottom: 1px solid var(--wrq-border);
}

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

.wrq-table tbody tr {
	transition: background-color 0.15s ease;
}

.wrq-table tbody tr:hover {
	background: var(--wrq-surface-muted);
}

.wrq-table .product-thumbnail {
	width: 64px;
}

.wrq-table .product-thumbnail img {
	max-width: 52px;
	height: auto;
	display: block;
	border-radius: var(--wrq-radius-sm);
	border: 1px solid var(--wrq-border);
}

.wrq-table .product-remove {
	width: 40px;
	text-align: center;
}

.wrq-table .product-remove a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	color: #9aa0af;
	font-size: 16px;
	text-decoration: none;
	line-height: 1;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wrq-table .product-remove a:hover {
	background: var(--wrq-error-tint);
	color: var(--wrq-error);
}

.wrq-table .product-name a {
	color: var(--wrq-text);
	text-decoration: none;
	font-weight: 600;
}

.wrq-table .product-name a:hover {
	color: var(--wrq-primary);
	text-decoration: underline;
}

.wrq-table .product-name dl.variation {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--wrq-text-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
}

.wrq-table .product-name dl.variation dt,
.wrq-table .product-name dl.variation dd {
	display: inline;
	margin: 0;
	font-weight: 400;
}

.wrq-table .product-name dl.variation dt { font-weight: 600; }

.wrq-table .product-price {
	text-align: right;
	font-weight: 600;
	white-space: nowrap;
}

/* Quantity stepper – restyle whatever markup WooCommerce/theme renders. */
.wrq-table .product-quantity .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--wrq-border);
	border-radius: var(--wrq-radius-sm);
	overflow: hidden;
	background: var(--wrq-surface);
}

.wrq-table .product-quantity .qty {
	width: 56px;
	border: none;
	text-align: center;
	font-size: 14px;
	padding: 8px 4px;
	-moz-appearance: textfield;
}

.wrq-table .product-quantity .qty:focus {
	outline: none;
	background: var(--wrq-primary-tint);
}

.wrq-table .product-quantity button,
.wrq-table .product-quantity .plus,
.wrq-table .product-quantity .minus {
	border: none;
	background: var(--wrq-surface-muted);
	color: var(--wrq-text-muted);
	cursor: pointer;
	padding: 0 10px;
	font-size: 13px;
}

.wrq-table .product-quantity button:hover {
	background: var(--wrq-primary-tint);
	color: var(--wrq-primary);
}

/* Removing row animation */
.wrq-table tr.wrq-removing {
	opacity: 0.4;
	pointer-events: none;
}

.wrq-sku {
	color: var(--wrq-text-muted);
}

.wrq-table-footer {
	display: flex;
	justify-content: flex-end;
	padding: 14px 16px;
	background: var(--wrq-surface-muted);
	border-top: 1px solid var(--wrq-border);
}

.wrq-update-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	background: var(--wrq-surface);
	color: var(--wrq-text);
	border: 1px solid var(--wrq-border);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.wrq-update-btn:hover {
	border-color: var(--wrq-primary);
	color: var(--wrq-primary);
}

/* ============================================================
   Quote request form
   ============================================================ */

.wrq-form-wrapper {
	position: relative;
	margin-top: 8px;
	padding: 30px 28px 28px;
	background: var(--wrq-surface);
	border: 1px solid var(--wrq-border);
	border-radius: var(--wrq-radius);
	box-shadow: var(--wrq-shadow);
	overflow: hidden;
}

/* Thin brand gradient across the top of the card. */
.wrq-form-wrapper::before {
	content: '';
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--wrq-primary), #38c8f0);
}

.wrq-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wrq-success);
	background: var(--wrq-success-tint);
	border-radius: 999px;
	padding: 4px 12px;
	margin-bottom: 14px;
}

.wrq-badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wrq-success);
	animation: wrq-pulse-dot 2s ease-in-out infinite;
}

@keyframes wrq-pulse-dot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(0.7); }
}

.wrq-form-wrapper h3 {
	margin: 0 0 4px;
	font-size: 19px;
}

.wrq-form-subtitle {
	margin: 0 0 22px;
	color: var(--wrq-text-muted);
	font-size: 13.5px;
}

/*
 * Every field (built-in or admin-added custom field) stacks in a single column,
 * scaling cleanly to any number of admin-added fields in any order. Each field
 * has a visible label above it, a type icon on the left inside the input, and
 * (for simple single-value inputs) a live valid/invalid indicator on the right
 * driven by frontend.js using the native HTML5 constraint validation API.
 *
 * Deliberately namespaced (not WooCommerce's own .form-row / .form-row-first /
 * .form-row-last / .form-row-wide) — those are WooCommerce/theme checkout classes
 * loaded globally with their own float/width rules, and reusing them here caused
 * layout collisions.
 */
.wrq-field {
	margin: 0 0 16px;
}

.wrq-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
	letter-spacing: -0.01em;
}

.wrq-form label .required {
	color: var(--wrq-invalid);
	text-decoration: none;
	margin-left: 1px;
}

.wrq-input-wrap {
	position: relative;
}

/*
 * .wrq-input-wrap must be a full-width BLOCK: it was a bare <span> (inline by
 * default), so the input's "width: 100%" inside it had no well-defined width to
 * resolve against and fell back to the browser's default ~20-character size —
 * that's what left a large gap on the right of every field.
 */
.wrq-input-wrap {
	display: block;
	width: 100%;
}

.wrq-input-wrap .wrq-field-icon {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	color: #94a3b8;
	pointer-events: none;
	transition: color 0.15s ease;
}

/*
 * Our own namespaced input class — NOT WooCommerce's ".input-text" (used
 * pervasively in WC's checkout/account forms with its own global padding
 * rules). Reusing that name here caused the theme's rules to win the cascade
 * and override our padding-left, making the icon overlap the typed text.
 */
.wrq-form .wrq-input,
.wrq-form select {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 12px 14px 12px 40px;
	border: 1.5px solid var(--wrq-border);
	border-radius: var(--wrq-radius-sm);
	font-size: 14.5px;
	background: var(--wrq-input-bg);
	color: var(--wrq-text);
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
}

.wrq-input-wrap:not(.wrq-input-wrap--select):not(.wrq-input-wrap--textarea) .wrq-input {
	padding-right: 38px;
}

.wrq-input-wrap--select select {
	padding-right: 34px;
}

.wrq-input-wrap--textarea {
	display: block;
}

.wrq-input-wrap--textarea .wrq-input {
	padding-left: 14px;
	min-height: 110px;
	max-height: 320px;
	resize: vertical;
}

.wrq-form select {
	cursor: pointer;
}

.wrq-form .wrq-input:focus,
.wrq-form select:focus {
	outline: none;
	border-color: var(--wrq-primary);
	background: var(--wrq-surface);
	box-shadow: 0 0 0 3px var(--wrq-primary-tint);
}

.wrq-form .wrq-input::placeholder {
	color: #94a3b8;
}

.wrq-select-arrow {
	position: absolute;
	right: 13px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	color: #94a3b8;
	pointer-events: none;
}

/* Live validation states, toggled by frontend.js. */
.wrq-state-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	display: none;
}

.wrq-field.wrq-is-valid .wrq-input {
	border-color: var(--wrq-valid);
	background: var(--wrq-valid-tint);
}

.wrq-field.wrq-is-valid .wrq-field-icon { color: var(--wrq-valid); }
.wrq-field.wrq-is-valid .wrq-check-icon { display: block; }

.wrq-field.wrq-is-invalid .wrq-input {
	border-color: var(--wrq-invalid);
	background: var(--wrq-invalid-tint);
	box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.09);
}

.wrq-field.wrq-is-invalid .wrq-field-icon { color: var(--wrq-invalid); }
.wrq-field.wrq-is-invalid .wrq-error-icon { display: block; }

.wrq-field-error-msg {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--wrq-invalid);
	margin-top: 5px;
	min-height: 0;
	opacity: 0;
	transform: translateY(-3px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.wrq-field.wrq-is-invalid .wrq-field-error-msg {
	opacity: 1;
	transform: translateY(0);
}

/* Checkbox-style rows (custom checkbox fields + privacy consent). */
.wrq-checkbox-row {
	display: flex;
	align-items: flex-start;
	gap: 9px;
}

.wrq-checkbox-row input[type="checkbox"] {
	width: 17px;
	height: 17px;
	margin-top: 2px;
	flex-shrink: 0;
	accent-color: var(--wrq-primary);
	cursor: pointer;
}

.wrq-checkbox-row label {
	font-size: 13.5px;
	font-weight: 400;
	color: var(--wrq-text-muted);
	margin: 0;
	cursor: pointer;
}

.wrq-privacy-row {
	margin-top: 4px;
}

.wrq-submit-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--wrq-border);
}

.wrq-submit-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 26px;
	background-color: var(--wrq-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
	box-shadow: 0 1px 2px rgba(20, 24, 38, 0.08);
}

.wrq-submit-btn:hover {
	background-color: var(--wrq-primary-dark);
	box-shadow: 0 4px 12px rgba(37, 85, 199, 0.28);
}

.wrq-submit-btn:active {
	transform: translateY(1px);
}

.wrq-submit-btn.wrq-is-loading {
	pointer-events: none;
	opacity: 0.85;
}

.wrq-submit-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wrq-spin 0.7s linear infinite;
}

.wrq-submit-btn.wrq-is-loading .wrq-submit-icon,
.wrq-submit-btn.wrq-is-loading .wrq-submit-text {
	display: none;
}

.wrq-submit-btn.wrq-is-loading .wrq-submit-spinner {
	display: block;
}

@keyframes wrq-spin {
	to { transform: rotate(360deg); }
}

.wrq-submit-note {
	font-size: 12.5px;
	color: var(--wrq-text-muted);
}
.wrq-input-wrap:not(.wrq-input-wrap--select):not(.wrq-input-wrap--textarea) .wrq-input {
    width: 100%;
    padding-left: 54px;
	border-radius: 10px;
}
.wrq-input-wrap--textarea .wrq-input {
    width: 100%;
	border-radius: 10px;
}
/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
	.wrq-form-wrapper {
		padding: 20px;
	}

	.wrq-submit-row {
		flex-direction: column;
		align-items: stretch;
	}

	.wrq-submit-btn {
		justify-content: center;
	}

	.wrq-table thead {
		display: none;
	}

	.wrq-table,
	.wrq-table tbody,
	.wrq-table tr,
	.wrq-table td {
		display: block;
		width: 100%;
	}

	.wrq-table tr {
		position: relative;
		padding: 14px 16px 14px 56px;
		border-bottom: 1px solid var(--wrq-border);
	}

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

	.wrq-table td {
		border: none;
		padding: 3px 0;
	}

	.wrq-table .product-remove {
		position: absolute;
		top: 14px;
		left: 16px;
		width: auto;
	}

	.wrq-table .product-thumbnail {
		position: absolute;
		top: 14px;
		left: 52px;
		width: auto;
	}

	.wrq-table .product-thumbnail img {
		max-width: 40px;
	}

	.wrq-table .product-name {
		padding-left: 46px;
		min-height: 40px;
	}

	.wrq-table .product-quantity,
	.wrq-table .product-price {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 8px;
	}

	.wrq-table .product-quantity::before {
		content: attr(data-title);
		font-weight: 600;
		font-size: 12px;
		color: var(--wrq-text-muted);
	}

	.wrq-table .product-price::before {
		content: attr(data-title);
		font-weight: 600;
		font-size: 12px;
		color: var(--wrq-text-muted);
	}

	.wrq-table-footer {
		justify-content: center;
	}
}
