/* RMS Product Assistant. Brand tokens only — no literal colours. */

.rms-assistant { max-width: var(--rms-maxw); margin: 0 auto; padding: 28px var(--rms-gutter);
  border: 1px solid var(--rms-border); border-radius: var(--rms-radius); background: var(--rms-surface); }
.rms-assistant__title { font-size: var(--rms-t-sec); font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.rms-assistant__lede { color: var(--rms-text-mut); max-width: 70ch; margin: 0 0 18px; line-height: 1.6; }

.rms-assistant__form { display: flex; gap: 10px; flex-wrap: wrap; }
.rms-assistant__input { flex: 1 1 320px; min-width: 0; height: 46px; padding: 0 14px;
  border: 1px solid var(--rms-border); border-radius: var(--rms-radius-sm);
  background: var(--rms-surface); color: var(--rms-text); font: inherit; }
.rms-assistant__input:focus { outline: 2px solid var(--rms-primary); outline-offset: 1px; border-color: var(--rms-primary); }
.rms-assistant__submit { flex: 0 0 auto; height: 46px; padding: 0 22px; border: 0; cursor: pointer;
  background: var(--rms-primary-d); color: #fff; font-weight: 700; border-radius: var(--rms-radius-sm); }
.rms-assistant__submit:hover { background: var(--rms-primary-d); }
.rms-assistant__submit:focus-visible { outline: 2px solid var(--rms-dark); outline-offset: 2px; }

.rms-assistant__note { font-size: 12.5px; color: var(--rms-text-mut); margin: 10px 0 0; max-width: 70ch; }
.rms-assistant__status { min-height: 22px; font-size: 13.5px; color: var(--rms-text-mut); margin-top: 12px; }
.rms-assistant__summary { margin: 8px 0 4px; font-size: 15px; }
.rms-assistant__notice { margin: 4px 0 12px; font-size: 13px; color: var(--rms-text-mut);
  border-left: 3px solid var(--rms-border); padding-left: 10px; }
.rms-assistant__count { font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--rms-text-mut); margin: 14px 0 8px; }

.rms-assistant__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rms-assistant__item { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--rms-border);
  border-radius: var(--rms-radius); background: var(--rms-surface); }
.rms-assistant__pick { flex: 0 0 auto; padding-top: 2px; }
.rms-assistant__body { min-width: 0; flex: 1 1 auto; }
.rms-assistant__name { font-size: 16px; margin: 4px 0 6px; }
.rms-assistant__name a { color: var(--rms-text); text-decoration: none; }
.rms-assistant__name a:hover { color: var(--rms-primary); text-decoration: underline; }

/* Confidence is stated, never implied. The three states are visually distinct
   so "possible match" cannot be mistaken for "exact match" at a glance. */
.rms-assistant__badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 3px; margin: 0; }
.rms-assistant__badge--exact    { background: #e7f5ec; color: #0a7c2f; }
.rms-assistant__badge--strong   { background: #eaf2fb; color: #1f5fa8; }
.rms-assistant__badge--possible { background: #fdf3e3; color: #8a5a00; }

.rms-assistant__facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0; font-size: 13.5px; }
.rms-assistant__facts dt { color: var(--rms-text-mut); }
.rms-assistant__facts dd { margin: 0; font-weight: 600; }
.rms-assistant__specs { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13.5px; }
.rms-assistant__specs th, .rms-assistant__specs td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--rms-border); }
.rms-assistant__specs th { color: var(--rms-text-mut); font-weight: 500; width: 45%; }

.rms-assistant__why { font-size: 13px; color: var(--rms-text-mut); margin: 8px 0 0; }
.rms-assistant__why span { font-weight: 700; color: var(--rms-text); }
.rms-assistant__explain { font-size: 13.5px; margin: 8px 0 0; line-height: 1.6; }

/* Differences on a "possible match" are never collapsed or de-emphasised —
   the whole point is that the customer sees what does not match. */
.rms-assistant__differs { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #d9a441; background: #fdf9f0; }
.rms-assistant__differs p { margin: 0 0 4px; font-weight: 700; font-size: 12.5px; }
.rms-assistant__differs ul { margin: 0 0 0 18px; font-size: 13px; }

.rms-assistant-launch { border: 1px solid var(--rms-border); background: var(--rms-surface);
  color: var(--rms-text); padding: 10px 16px; border-radius: var(--rms-radius-sm); font-weight: 600; cursor: pointer; }
.rms-assistant-launch:hover { border-color: var(--rms-primary); color: var(--rms-primary); }
.rms-assistant-dialog { max-width: 860px; width: 92vw; border: 1px solid var(--rms-border);
  border-radius: var(--rms-radius); padding: 0; background: var(--rms-surface); }
.rms-assistant-dialog::backdrop { background: rgba(11, 18, 32, .55); }
.rms-assistant-dialog__close { position: absolute; top: 10px; right: 12px; font-size: 26px; line-height: 1;
  border: 0; background: transparent; cursor: pointer; color: var(--rms-text-mut); }

.rms-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .rms-assistant__item { flex-direction: column; }
  .rms-assistant__specs th { width: auto; }
}
@media (prefers-reduced-motion: reduce) { .rms-assistant * { transition: none !important; animation: none !important; } }

/* =====================================================================
 * v1.1 polish — the assistant now presents as a product feature, not a
 * bare form ("can we style the product assistant better please").
 * =================================================================== */
.rms-assistant {
	padding: 0;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(11, 18, 32, .05);
}
.rms-assistant__head-band {
	background: var(--rms-dark);
	color: #fff;
	padding: 26px 28px 22px;
	border-bottom: 3px solid var(--rms-primary);
}
.rms-assistant__head-band .rms-assistant__title { color: #fff; margin: 0 0 4px; }
.rms-assistant__head-band .rms-assistant__lede { color: rgba(255, 255, 255, .78); margin: 0; }
.rms-assistant__body-pad { padding: 24px 28px 28px; }

/* Fallback when the PHP has not been updated to emit the band wrappers:
   the flat layout still gets the accent treatment. */
.rms-assistant > .rms-assistant__title { padding: 26px 28px 0; }
.rms-assistant > .rms-assistant__lede { padding: 0 28px; }
.rms-assistant > .rms-assistant__form,
.rms-assistant > .rms-assistant__note,
.rms-assistant > .rms-assistant__status,
.rms-assistant > .rms-assistant__results { margin-left: 28px; margin-right: 28px; }
.rms-assistant > .rms-assistant__results { margin-bottom: 28px; }
.rms-assistant::before {
	content: "";
	display: block;
	height: 4px;
	background: linear-gradient(90deg, var(--rms-primary), var(--rms-primary-d));
}
.rms-assistant__item { transition: border-color .15s ease, box-shadow .15s ease; }
.rms-assistant__item:hover {
	border-color: var(--rms-primary);
	box-shadow: 0 4px 14px rgba(11, 18, 32, .07);
}

/* ===========================================================================
 * v1.9 — RESULT CARDS, ACTIONS AND SPEC ROWS
 *
 * The live results page rendered the spec table as bare rows, and the two
 * action controls as adjacent unstyled text ("Add selected to quoteSpeak to
 * us: …" ran together because neither was a block or a button). Both are
 * given real treatment here, and the spec values — which are facet links —
 * now read as the interactive things they are.
 * ======================================================================== */

.rms-assistant__specs {
	width: 100%;
	margin: 12px 0 0;
	border-collapse: collapse;
	font-size: 13.5px;
}

.rms-assistant__specs tr + tr th,
.rms-assistant__specs tr + tr td {
	border-top: 1px solid var(--rms-line, #f0f0f3);
}

.rms-assistant__specs th,
.rms-assistant__specs td {
	padding: 7px 0;
	text-align: left;
	vertical-align: top;
}

.rms-assistant__specs th {
	width: 46%;
	padding-right: 16px;
	font-weight: 500;
	color: var(--rms-text-mut, #5b6b78);
}

.rms-assistant__specs td {
	font-weight: 600;
	color: var(--rms-text, #12181d);
}

.rms-assistant__specs td a {
	color: var(--rms-primary-d, #085a83);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
}

.rms-assistant__specs td a:hover,
.rms-assistant__specs td a:focus {
	border-bottom-style: solid;
}

/* ---- the action row ---- */

.rms-assistant__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--rms-border, #dfe6ec);
}

.rms-assistant__addquote {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--rms-primary-d, #0a6ea0);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.12s ease;
}

.rms-assistant__addquote:hover,
.rms-assistant__addquote:focus {
	background: var(--rms-primary-d, #085a83);
}

.rms-assistant__addquote[disabled] {
	background: var(--rms-border, #dfe6ec);
	color: var(--rms-text-mut, #5b6b78);
	cursor: not-allowed;
}

.rms-assistant__help {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	color: var(--rms-text, #12181d);
	text-decoration: none;
	background: var(--rms-surface, #fff);
}

.rms-assistant__help:hover,
.rms-assistant__help:focus {
	border-color: var(--rms-primary, #0a6ea0);
	color: var(--rms-primary-d, #085a83);
}

.rms-assistant__more {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 16px 0 0;
	border: 1px dashed var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
	background: var(--rms-surface, #fff);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--rms-primary-d, #085a83);
	cursor: pointer;
}

.rms-assistant__more:hover,
.rms-assistant__more:focus {
	border-style: solid;
	border-color: var(--rms-primary, #0a6ea0);
	background: var(--rms-muted, #f6f8fa);
}

/* The match badge and the card itself, so a result reads as one object. */
.rms-assistant__list > li {
	padding: 16px 18px;
	background: var(--rms-surface, #fff);
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: var(--rms-radius, 10px);
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.rms-assistant__list > li:hover {
	border-color: var(--rms-primary, #0a6ea0);
	box-shadow: 0 6px 18px rgba(11, 18, 32, 0.06);
}

.rms-assistant__why {
	padding-top: 10px;
	border-top: 1px dashed var(--rms-line, #f0f0f3);
}

@media (prefers-reduced-motion: reduce) {
	.rms-assistant__list > li,
	.rms-assistant__addquote {
		transition: none;
	}
}

/* =========================================================================
 * v1.10 — THE ASSISTANT, DESIGNED
 *
 * The panel had the right behaviour and the presence of a search box on a
 * blank page. This gives it its own surface: a gradient field with a quiet
 * circuit motif, the input as the obvious first action, quick-start chips
 * built from the site's real top-level categories, and a loading skeleton so
 * the page does not collapse and jump when results arrive.
 * ====================================================================== */

.rms-assistant {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 0 auto;
	padding: 30px clamp(18px, 4vw, 34px) 28px;
	max-width: var(--rms-maxw, 1280px);
	border-radius: 18px;
	border: 1px solid var(--rms-border, #dfe6ec);
	background:
		radial-gradient(760px 300px at 88% -10%, rgba(10, 110, 160, .10), transparent 62%),
		linear-gradient(180deg, #fbfdff 0%, #ffffff 46%);
	box-sizing: border-box;
}

.rms-assistant::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	pointer-events: none;
	opacity: .5;
	background-image:
		linear-gradient(to right, rgba(10, 110, 160, .07) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(10, 110, 160, .07) 1px, transparent 1px);
	background-size: 34px 34px;
	-webkit-mask-image: radial-gradient(560px 260px at 82% 0%, #000, transparent 72%);
	mask-image: radial-gradient(560px 260px at 82% 0%, #000, transparent 72%);
}

.rms-assistant__title {
	margin: 0 0 8px;
	font-size: var(--rms-t-sec);
	font-weight: 700;
	letter-spacing: -0.018em;
	color: var(--rms-text, #12181d);
}

.rms-assistant__lede {
	margin: 0 0 18px;
	max-width: 78ch;
	font-size: 15.5px;
	line-height: 1.62;
	color: var(--rms-text-mut, #5b6b78);
}

/* ---- the input row ---- */

.rms-assistant__form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: stretch;
	margin: 0 0 14px;
}

.rms-assistant__input {
	flex: 1 1 320px;
	min-width: 0;
	min-height: 54px;
	padding: 0 16px 0 44px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 12px;
	background: #fff
		no-repeat 14px 50%/18px 18px
		url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b78' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.2-3.2'/%3E%3C/svg%3E");
	font: inherit;
	font-size: 16px;
	color: var(--rms-text, #12181d);
	transition: border-color .18s ease, box-shadow .18s ease;
}

.rms-assistant__input:focus {
	outline: none;
	border-color: var(--rms-primary, #0a6ea0);
	box-shadow: 0 0 0 4px rgba(10, 110, 160, .14);
}

.rms-assistant__submit {
	flex: 0 0 auto;
	min-height: 54px;
	padding: 0 26px;
	border: 0;
	border-radius: 12px;
	background: var(--rms-primary-d, #0a6ea0);
	color: #fff;
	font: inherit;
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background .18s ease, transform .15s ease;
}

.rms-assistant__submit:hover,
.rms-assistant__submit:focus-visible {
	background: var(--rms-primary-d, #085a83);
	transform: translateY(-1px);
}

/* ---- quick-start chips ---- */

.rms-assistant__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 14px;
}

.rms-assistant__chipslabel {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rms-text-mut, #5b6b78);
	margin-right: 2px;
}

.rms-assistant__chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 13.5px;
	color: var(--rms-text, #12181d);
	cursor: pointer;
	transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.rms-assistant__chip:hover,
.rms-assistant__chip:focus-visible {
	border-color: var(--rms-primary, #0a6ea0);
	transform: translateY(-1px);
}

.rms-assistant__chip.is-on {
	background: var(--rms-primary-d, #0a6ea0);
	border-color: var(--rms-primary, #0a6ea0);
	color: #fff;
}

.rms-assistant__chipn {
	font-size: 11.5px;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 999px;
	background: rgba(10, 110, 160, .1);
	color: var(--rms-primary-d, #085a83);
}

.rms-assistant__chip.is-on .rms-assistant__chipn {
	background: rgba(255, 255, 255, .22);
	color: #fff;
}

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

/* ---- loading skeleton ---- */

.rms-assistant__skels {
	display: grid;
	gap: 12px;
	margin-top: 6px;
}

.rms-assistant__skel {
	height: 82px;
	border-radius: 12px;
	background: linear-gradient(100deg, #eef2f6 30%, #f7fafc 50%, #eef2f6 70%);
	background-size: 220% 100%;
	animation: rms-skel 1.25s linear infinite;
}

@keyframes rms-skel {
	from { background-position: 130% 0; }
	to   { background-position: -30% 0; }
}

.rms-assistant__status:not(:empty) {
	display: block;
	margin: 6px 0 12px;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(10, 110, 160, .07);
	font-size: 14px;
	color: var(--rms-primary-d, #085a83);
}

.rms-assistant__results:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	.rms-assistant__skel {
		animation: none;
	}
}

/* ---- result cards: the thumbnail rail ---------------------------------
 * An engineer recognises a part by its shape before its order code, so the
 * card leads with the picture where the catalogue has one. Cards without an
 * image simply have no rail — the grid collapses rather than reserving a
 * hole. */

.rms-assistant__item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.rms-assistant__item:has(.rms-assistant__thumb) {
	grid-template-columns: auto 92px minmax(0, 1fr);
}

.rms-assistant__thumb {
	display: block;
	width: 92px;
	height: 92px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 10px;
	background: #fff;
	padding: 6px;
	box-sizing: border-box;
	overflow: hidden;
}

.rms-assistant__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* No :has() (older Safari/Firefox ESR): the rail still sits where it is, the
   card just keeps a two-column grid and the image becomes the first item. */
@supports not selector(:has(*)) {
	.rms-assistant__item {
		display: flex;
		flex-wrap: wrap;
		gap: 14px;
	}

	.rms-assistant__body {
		flex: 1 1 260px;
		min-width: 0;
	}
}

@media (max-width: 560px) {
	.rms-assistant__item,
	.rms-assistant__item:has(.rms-assistant__thumb) {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.rms-assistant__thumb {
		width: 64px;
		height: 64px;
	}
}

/* ---- close the result set ---- */

.rms-assistant__results {
	position: relative;
}

.rms-assistant__close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 50%;
	background: #fff;
	color: var(--rms-text-mut, #5b6b78);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.rms-assistant__close:hover,
.rms-assistant__close:focus-visible {
	border-color: var(--rms-primary, #0a6ea0);
	color: var(--rms-primary-d, #085a83);
	transform: rotate(90deg);
}

.rms-assistant__count {
	padding-right: 44px;
}

/* The dialog's own close control, given the same treatment. */
.rms-assistant-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--rms-border, #dfe6ec);
	border-radius: 50%;
	background: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: var(--rms-text-mut, #5b6b78);
}

.rms-assistant-dialog {
	position: relative;
}
