/* ---------------------------------------------------------------------------
 * RMS Commerce Core — quote system.
 *
 * v1.2: brought to full parity with the rest of the storefront. The basket
 * and request form sit in cards with the brand accent bar the other page
 * heads carry; the desk (team) views get the same treatment. Depends on
 * rms-base for tokens and .rms-btn.
 * ------------------------------------------------------------------------- */

.rms-quote-page {
	max-width: var(--rms-maxw);
	margin: 0 auto;
	padding: 0 var(--rms-gutter) 48px;
}

/* ---- Page head: the same eyebrow-and-accent treatment as rms-pages ------- */

.rms-quote-page .rms-h2 {
	position: relative;
	margin: 0 0 20px;
	padding-top: 14px;
	font-size: clamp(24px, 2.8vw, 34px);
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--rms-text, #12181d);
}

.rms-quote-page .rms-h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 4px;
	border-radius: 999px;
	background: var(--rms-primary, #0098db);
}

.rms-quote-page .rms-h3 {
	margin: 26px 0 12px;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--rms-text-mut, #5b6b78);
}

/* ---- The basket card ----------------------------------------------------- */

.rms-quote-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
	overflow: hidden;
	box-shadow: 0 10px 28px rgba(9, 14, 22, 0.05);
}

.rms-quote-table th {
	text-align: left;
	padding: 12px;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--rms-text-mut, #5b6b78);
	background: var(--rms-muted, #f6f8fa);
	border-bottom: 1px solid var(--rms-border, #dfe6ec);
}

.rms-quote-table td {
	padding: 16px 12px;
	border-bottom: 1px solid var(--rms-border, #dfe6ec);
	vertical-align: middle;
}

.rms-quote-table tr:last-child td {
	border-bottom: 0;
}

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

.rms-quote-table tbody tr:hover {
	background: color-mix(in srgb, var(--rms-primary, #0098db) 3%, var(--rms-surface, #fff));
}

@supports not (background: color-mix(in srgb, red 20%, transparent)) {
	.rms-quote-table tbody tr:hover {
		background: var(--rms-muted, #f6f8fa);
	}
}

.rms-qt__name a {
	color: var(--rms-text, #12181d);
	font-weight: 600;
	text-decoration: none;
}

.rms-qt__name a:hover,
.rms-qt__name a:focus {
	color: var(--rms-primary-d, #0078ad);
}

.rms-qt__sku code {
	font-size: 12.5px;
	color: var(--rms-text-mut, #5b6b78);
	background: var(--rms-muted, #f6f8fa);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 5px;
	padding: 2px 7px;
}

.rms-qty {
	width: 80px;
	height: 40px;
	padding: 0 10px;
	font-size: 14.5px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius-sm, 6px);
	background: var(--rms-surface, #fff);
}

.rms-qty:focus {
	border-color: var(--rms-primary, #0098db);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--rms-primary, #0098db) 22%, transparent);
	outline: none;
}

.rms-remove {
	width: 36px;
	height: 36px;
	line-height: 1;
	font-size: 20px;
	color: var(--rms-text-mut, #5b6b78);
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.rms-remove:hover,
.rms-remove:focus {
	border-color: #b32d2e;
	color: #b32d2e;
	background: #fdf3f3;
}

.rms-note {
	font-size: 13px;
	color: var(--rms-text-mut, #5b6b78);
	margin: 14px 0 0;
	max-width: 70ch;
}

/* ---- The request form: a card with the brand's top accent ---------------- */

.rms-quote-form {
	margin-top: 32px;
	padding: 28px 26px;
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-top: 3px solid var(--rms-primary, #0098db);
	border-radius: var(--rms-radius, 10px);
	box-shadow: 0 10px 28px rgba(9, 14, 22, 0.05);
}

.rms-quote-form .rms-h3:first-child {
	margin-top: 0;
}

.rms-quote-form label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--rms-text, #12181d);
}

.rms-quote-form input[type="text"],
.rms-quote-form input[type="email"],
.rms-quote-form input[type="tel"],
.rms-quote-form input[type="date"],
.rms-quote-form textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	font: inherit;
	font-size: 15px;
	color: var(--rms-text, #12181d);
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 8px;
}

.rms-quote-form textarea {
	min-height: 110px;
	resize: vertical;
}

.rms-quote-form input:focus,
.rms-quote-form textarea:focus {
	border-color: var(--rms-primary, #0098db);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--rms-primary, #0098db) 22%, transparent);
	outline: none;
}

.rms-field {
	margin-bottom: 16px;
}

.rms-grid {
	display: grid;
	gap: 0 20px;
}

.rms-grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
	.rms-grid--2 {
		grid-template-columns: 1fr;
	}
}

.rms-field--check label {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-weight: 400;
	font-size: 14px;
}

.rms-field--check input[type="checkbox"] {
	accent-color: var(--rms-primary, #0098db);
	margin-top: 2px;
}

.rms-field small {
	display: block;
	color: var(--rms-text-mut, #5b6b78);
	font-size: 12.5px;
	margin-top: 4px;
}

/* Honeypot stays parked off-screen. */
.rms-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rms-flash {
	display: inline-block;
	margin-left: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #0a7c2f;
}

.rms-flash.is-error {
	color: #b32d2e;
}

/* ---- Empty basket --------------------------------------------------------- */

.rms-empty {
	text-align: center;
	padding: 64px 20px;
	background: var(--rms-muted, #f6f8fa);
	border: 1px dashed var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
}

.rms-empty::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--rms-primary, #0098db) 10%, transparent);
	border: 2px solid color-mix(in srgb, var(--rms-primary, #0098db) 35%, transparent);
}

@supports not (background: color-mix(in srgb, red 20%, transparent)) {
	.rms-empty::before {
		background: var(--rms-surface, #fff);
		border-color: var(--rms-border, #dfe6ec);
	}
}

.rms-empty h2 {
	margin: 0 0 8px;
	font-size: 20px;
	color: var(--rms-text, #12181d);
}

.rms-empty p {
	color: var(--rms-text-mut, #5b6b78);
	margin: 0 0 18px;
}

/* ---- Add-to-quote button on product pages --------------------------------- */

.rms-addquote {
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rms-addquote:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px color-mix(in srgb, var(--rms-primary, #0098db) 22%, transparent);
}

.rms-addquote.is-added {
	border-color: #0a7c2f;
	color: #0a7c2f;
}

/* ---- Team desk (validation verdicts, summaries) --------------------------- */

.rms-desk {
	padding: 20px;
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
}

.rms-desk-summary {
	padding: 14px 16px;
	margin: 14px 0;
	background: var(--rms-muted, #f6f8fa);
	border-left: 3px solid var(--rms-primary, #0098db);
	border-radius: var(--rms-radius-sm, 6px);
	font-size: 14px;
}

.rms-desk-result {
	margin-top: 12px;
}

/* Margin verdict chips (ok / tight / escalate / loss / incomplete). */
.rms-v {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 999px;
	border: 1px solid;
}

.rms-v::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.rms-v--ok          { color: #0a7c2f; background: #eaf7ee; border-color: #bfe4ca; }
.rms-v--tight       { color: #94660c; background: #fdf6e3; border-color: #f0dfae; }
.rms-v--escalate    { color: #b3540e; background: #fdefe3; border-color: #f3d3b3; }
.rms-v--below_floor { color: #b3540e; background: #fdefe3; border-color: #f3d3b3; }
.rms-v--loss        { color: #b32d2e; background: #fdf0f0; border-color: #f0c4c4; }
.rms-v--incomplete  { color: #5b6b78; background: #f2f5f7; border-color: #dfe6ec; }

@media (prefers-reduced-motion: reduce) {
	.rms-quote-page *,
	.rms-addquote {
		transition: none !important;
		animation: none !important;
	}
}

/* Submit-outcome flash. */
.rms-quote-flash {
	margin: 0 0 20px;
	padding: 14px 18px;
	font-size: 14.5px;
	line-height: 1.55;
	border-radius: var(--rms-radius-sm, 6px);
	border: 1px solid;
}

.rms-quote-flash--ok {
	color: #0a5c26;
	background: #eaf7ee;
	border-color: #bfe4ca;
}

.rms-quote-flash--error {
	color: #8f2425;
	background: #fdf0f0;
	border-color: #f0c4c4;
}

/* ---------------------------------------------------------------------------
 * v1.4 — TWO-COLUMN BASKET + PARTS-LIST PASTE
 * ------------------------------------------------------------------------- */

.rms-quote-cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

@media (min-width: 1000px) {
	.rms-quote-cols {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: 36px;
	}

	.rms-quote-side {
		position: sticky;
		top: 84px;
	}

	.rms-quote-side .rms-quote-form {
		margin-top: 0;
	}
}

/* On a phone the table stacks into cards — no sideways scroll. */
@media (max-width: 640px) {
	.rms-quote-table,
	.rms-quote-table tbody,
	.rms-quote-table tr,
	.rms-quote-table td {
		display: block;
		width: 100%;
	}

	.rms-quote-table thead {
		display: none;
	}

	.rms-quote-table tr {
		padding: 12px;
		border-bottom: 1px solid var(--rms-border, #dfe6ec);
	}

	.rms-quote-table td {
		padding: 4px 0;
		border-bottom: 0;
	}
}

.rms-bom {
	margin-top: 22px;
	background: var(--rms-muted, #f6f8fa);
	border: 1px dashed var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
}

.rms-bom[open] {
	border-style: solid;
	border-color: var(--rms-primary, #0098db);
}

.rms-bom__summary {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	padding: 16px 20px;
	font-size: 15px;
	font-weight: 700;
	color: var(--rms-text, #12181d);
	cursor: pointer;
	list-style: none;
}

.rms-bom__summary::-webkit-details-marker {
	display: none;
}

.rms-bom__summary::before {
	content: '+';
	font-weight: 700;
	color: var(--rms-primary, #0098db);
}

.rms-bom[open] .rms-bom__summary::before {
	content: '\2212';
}

.rms-bom__hint {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--rms-text-mut, #5b6b78);
}

.rms-bom__form {
	padding: 0 20px 20px;
}

.rms-bom__form textarea {
	width: 100%;
	min-height: 120px;
	padding: 12px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--rms-text, #12181d);
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 8px;
	resize: vertical;
}

.rms-bom__form textarea:focus {
	border-color: var(--rms-primary, #0098db);
	outline: none;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--rms-primary, #0098db) 22%, transparent);
}

.rms-bom__note {
	margin: 10px 0 14px;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--rms-text-mut, #5b6b78);
	max-width: 68ch;
}

/* ---- v1.4: the attachment dropzone ---------------------------------------- */

.rms-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 26px 18px;
	text-align: center;
	background: var(--rms-muted, #f6f8fa);
	border: 2px dashed var(--rms-border, #dfe6ec);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rms-drop:hover,
.rms-drop.is-drag {
	border-color: var(--rms-primary, #0098db);
	background: color-mix(in srgb, var(--rms-primary, #0098db) 5%, var(--rms-muted, #f6f8fa));
}

.rms-drop.has-file {
	border-style: solid;
	border-color: var(--rms-primary, #0098db);
}

.rms-drop__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.rms-drop__icon {
	font-size: 22px;
	color: var(--rms-primary, #0098db);
	line-height: 1;
}

.rms-drop__text {
	font-size: 14px;
	font-weight: 600;
	color: var(--rms-text, #12181d);
	overflow-wrap: anywhere;
}

.rms-drop__hint {
	font-size: 12px;
	color: var(--rms-text-mut, #5b6b78);
}
