/**
 * Ruler Autocomplete Search — front end.
 *
 * Colours and sizes come from the --ras-* custom properties printed inline
 * from the plugin settings.
 *
 * Buttons and the input carry :not(#ras-reset) in their selectors. No element
 * has that id, so it always matches, but it lifts the rule to ID-level
 * specificity. Theme and WooCommerce button styles (for example
 * `.woocommerce button[type="submit"]`, which pads and margins every submit
 * button on shop pages) then cannot restyle the search, without !important.
 * Each such rule also resets the properties those styles commonly set.
 */

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

.ras,
.ras *,
.ras-sidebar,
.ras-sidebar *,
.ras-dialog,
.ras-dialog *,
.ras-panel--full,
.ras-panel--full *,
.ras-full-overlay,
.ras-form,
.ras-form * {
	box-sizing: border-box;
}

.ras {
	position: relative;
	display: inline-block;
	vertical-align: middle;
}

.ras-icon {
	display: block;
	flex: 0 0 auto;
	width: var(--ras-icon-size, 22px);
	height: var(--ras-icon-size, 22px);
}

/* ---------- Trigger ---------- */

.ras .ras-trigger:not(#ras-reset) {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px;
	border: 0;
	border-radius: 4px;
	background: none;
	box-shadow: none;
	color: var(--ras-trigger-icon);
	font: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	word-break: normal;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	cursor: pointer;
}

.ras .ras-trigger:not(#ras-reset):hover,
.ras .ras-trigger:not(#ras-reset):focus {
	background: none;
	color: var(--ras-trigger-icon);
}

.ras-trigger:focus-visible,
.ras-close:focus-visible,
.ras-submit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Close buttons ---------- */

.ras-close:not(#ras-reset) {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 18px;
	line-height: 1;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	word-break: normal;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	cursor: pointer;
}

.ras-close:not(#ras-reset):hover,
.ras-close:not(#ras-reset):focus {
	background: none;
	color: inherit;
}

.ras-panel .ras-close:not(#ras-reset),
.ras-panel .ras-close:not(#ras-reset):hover,
.ras-panel .ras-close:not(#ras-reset):focus {
	color: var(--ras-close-text);
}

.ras-close-icon {
	display: block;
	flex: 0 0 auto;
	width: var(--ras-close-size, 26px);
	height: var(--ras-close-size, 26px);
	color: var(--ras-close);
}

/* ---------- Bar: dropdown panel under the button ---------- */

.ras-panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	z-index: 9999;
	width: var(--ras-bar-width, 420px);
	max-width: calc(100vw - 32px);
	padding: 16px 20px 20px;
	border-radius: 8px;
	background: var(--ras-panel-bg);
	color: var(--ras-panel-text);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
	text-align: left;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity .18s ease, transform .18s ease;
}

.ras--align-left .ras-panel {
	right: auto;
	left: 0;
}

.ras-panel[hidden] {
	display: none;
}

.ras-panel.is-open {
	opacity: 1;
	transform: none;
}

/* Phones: fixed under the button, 16px from each screen edge (top set by the script). */
.ras-panel.is-phone {
	position: fixed;
	right: 16px;
	left: 16px;
	width: auto;
	max-width: none;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ras-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

/* Title on the left, close on the right; with no title the close stays right. */
.ras-panel-head .ras-close:not(#ras-reset),
.ras-dialog-head .ras-close:not(#ras-reset) {
	margin-left: auto;
}

.ras-panel-title {
	min-width: 0;
	color: inherit;
	font-size: 22px;
	font-weight: 400;
	line-height: 1.2;
}

.ras-dialog-head .ras-panel-title {
	font-size: 26px;
}

/* ---------- Bar, full width: a strip under the site header ----------
   The script moves the panel to <body> and sets its top (and the overlay's)
   to the header's bottom edge, so the header stays visible above it. */

.ras-panel.ras-panel--full {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 99990;
	/* Container width: 100% edge to edge, or a fixed width centred by the auto margins. */
	width: var(--ras-full-container, 100%);
	max-width: 100%;
	margin: 0 auto;
	padding: 20px 16px 32px;
	overflow-y: auto;
	border-radius: 0;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
	transform: translateY(-12px);
}

.ras-panel.ras-panel--full.is-open {
	transform: none;
}

.ras-full-inner {
	width: 100%;
	max-width: var(--ras-full-width, 1140px);
	margin: 0 auto;
}

.ras-full-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99989;
	background: var(--ras-overlay);
	opacity: 0;
	transition: opacity .25s ease;
}

.ras-full-overlay[hidden] {
	display: none;
}

.ras-full-overlay.is-open {
	opacity: 1;
}

/* Results flow in the strip; the single list gets a little more room. */
.ras-panel--full .ras-form .ras-results-list {
	max-height: min(60vh, 480px);
}

/* ---------- Columns: one per content type ---------- */

.ras-form .ras-results-list.is-columns {
	display: grid;
	grid-template-columns: repeat(var(--ras-cols, 1), minmax(0, 1fr));
	gap: 40px;
	max-height: none;
	padding: 0;
	overflow: visible;
}

.ras-results-list .ras-col {
	min-width: 0;
}

.ras-col-head {
	display: block;
	margin-bottom: 4px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ras-divider);
	color: var(--ras-result-title);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.ras-form .ras-col-list {
	max-height: min(55vh, 440px);
	margin: 0;
	padding: 0 12px 0 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.ras-col-list::-webkit-scrollbar {
	width: 4px;
}

.ras-col-list::-webkit-scrollbar-track {
	border-radius: 4px;
	background: var(--ras-divider);
}

.ras-col-list::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: var(--ras-close);
}

@supports not selector(::-webkit-scrollbar) {
	.ras-form .ras-col-list {
		scrollbar-width: thin;
		scrollbar-color: var(--ras-close) var(--ras-divider);
	}
}

@media (max-width: 782px) {
	.ras-form .ras-results-list.is-columns {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.ras-form .ras-col-list {
		max-height: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ras-panel.ras-panel--full,
	.ras-full-overlay,
	.ras-dialog-box,
	.ras-info-toggle::after {
		transition: none;
	}
}

/* ---------- Form ---------- */

.ras-form {
	position: relative;
	width: 100%;
	margin: 0;
	font-size: 18px;
}

.ras-field {
	position: relative;
	display: flex;
	align-items: center;
}

.ras-form .ras-input:not(#ras-reset) {
	display: block;
	width: 100%;
	min-width: 0;
	max-width: none;
	height: 52px;
	margin: 0;
	/* Room for the clear button and the submit icon. */
	padding: 0 92px 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--ras-input-bg);
	box-shadow: none;
	color: var(--ras-input-text);
	font: inherit;
	font-size: inherit;
	line-height: 1.2;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.ras-form .ras-input:not(#ras-reset)::placeholder {
	color: var(--ras-input-text);
	opacity: .7;
}

.ras-form .ras-input:not(#ras-reset)::-webkit-search-decoration,
.ras-form .ras-input:not(#ras-reset)::-webkit-search-cancel-button {
	/* The browser's own clear "x" is replaced by .ras-clear. */
	display: none;
	-webkit-appearance: none;
	appearance: none;
}

.ras-form .ras-input:not(#ras-reset):focus-visible {
	box-shadow: 0 0 0 1px var(--ras-input-icon);
}

.ras-form .ras-submit:not(#ras-reset),
.ras-form .ras-clear:not(#ras-reset) {
	position: absolute;
	top: 50%;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 999px;
	background: none;
	box-shadow: none;
	color: var(--ras-input-icon);
	font-size: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	word-break: normal;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	opacity: 1;
	cursor: pointer;
	transform: translateY(-50%);
}

.ras-form .ras-submit:not(#ras-reset):hover,
.ras-form .ras-submit:not(#ras-reset):focus {
	background: none;
	color: var(--ras-input-icon);
}

/* Clear button: the mode's close icon and colour, left of the submit icon. */
.ras-form .ras-clear:not(#ras-reset) {
	right: 46px;
	padding: 6px;
	color: var(--ras-close);
}

.ras-form .ras-clear:not(#ras-reset):hover,
.ras-form .ras-clear:not(#ras-reset):focus {
	background: none;
	color: var(--ras-close);
}

/* :not(#ras-reset) as above, or the display rule there outranks this one. */
.ras-form .ras-clear:not(#ras-reset)[hidden] {
	display: none;
}

/* 10px smaller than the close icon at the top of the bar / sidebar, never under 10px. */
.ras-clear .ras-close-icon {
	width: max(calc(var(--ras-close-size, 26px) - 10px), 10px);
	height: max(calc(var(--ras-close-size, 26px) - 10px), 10px);
}

.ras-clear:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Underline field: no fill, a single rule under the text. */
.ras-form--underline .ras-input:not(#ras-reset) {
	height: 48px;
	padding-left: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	background: transparent;
}

.ras-form--underline .ras-input:not(#ras-reset):focus-visible {
	box-shadow: 0 1px 0 0 currentColor;
}

.ras-form--underline .ras-submit:not(#ras-reset) {
	right: 0;
}

.ras-form--underline .ras-clear:not(#ras-reset) {
	right: 36px;
}

/* Bordered field: square corners, a border all round. */
.ras-form--bordered .ras-input:not(#ras-reset) {
	padding-left: 16px;
	border: var(--ras-border-width, 1px) solid var(--ras-input-border);
	border-radius: 0;
}

.ras-form--bordered .ras-input:not(#ras-reset):focus-visible {
	box-shadow: 0 0 0 1px var(--ras-input-border);
}

.ras-form--bordered .ras-submit:not(#ras-reset),
.ras-form--bordered .ras-clear:not(#ras-reset) {
	border-radius: 0;
}

/* Loading: the icon pulses while a request is in flight. */
.ras-form.is-loading .ras-submit:not(#ras-reset) {
	animation: ras-pulse 1s ease-in-out infinite;
}

@keyframes ras-pulse {
	50% { opacity: .35; }
}

/* ---------- Results ----------
   .ras-results is the popup; inside it the list scrolls on its own and the
   "View all" link sits underneath, outside the scroll area. */

.ras-form .ras-results {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	z-index: 9999;
	padding: 12px 8px 12px 16px;
	border-radius: 8px;
	background: var(--ras-results-bg, #fff);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
	text-align: left;
}

/* Inside the bar panel, the sidebar and the modal the results flow in the panel itself. */
.ras-panel .ras-form .ras-results,
.ras-sidebar .ras-form .ras-results,
.ras-dialog .ras-form .ras-results {
	position: static;
	margin-top: 20px;
	padding: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ras-form .ras-results[hidden],
.ras-results-foot[hidden] {
	display: none;
}

.ras-form .ras-results-list {
	max-height: min(50vh, 320px);
	margin: 0;
	padding: 0 12px 0 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

/*
 * The ::-webkit-scrollbar rules below give an always-visible thin bar in
 * Chrome and Safari (overlay scrollbars would hide it). The standard
 * properties are for Firefox only: Chrome ignores the pseudo-elements once
 * scrollbar-color is set, so they must not reach it.
 */
@supports not selector(::-webkit-scrollbar) {
	.ras-form .ras-results-list {
		scrollbar-width: thin;
		scrollbar-color: var(--ras-close) var(--ras-divider);
	}
}

/* In the sidebar the drawer is tall; let the list use it. */
.ras-sidebar .ras-form .ras-results-list {
	max-height: calc(100vh - 260px);
}

/* The modal box scrolls as a whole; the list needs no scroll of its own. */
.ras-dialog .ras-form .ras-results-list {
	max-height: none;
	overflow: visible;
}

.ras-results-list::-webkit-scrollbar {
	width: 4px;
}

.ras-results-list::-webkit-scrollbar-track {
	border-radius: 4px;
	background: var(--ras-divider);
}

.ras-results-list::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: var(--ras-close);
}

.ras-results-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ras-results-list li::before,
.ras-results-list li::marker {
	content: none;
}

.ras-result + .ras-result {
	border-top: 1px solid var(--ras-divider);
}

.ras-result-link {
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 12px 0;
	color: var(--ras-result-title);
	font-size: 17px;
	line-height: 1.3;
	text-decoration: none;
}

.ras-result-link:hover,
.ras-result-link:focus,
.ras-result.is-active .ras-result-link {
	background: var(--ras-results-hover);
	color: var(--ras-result-title-hover, var(--ras-result-title));
	text-decoration: none;
}

.ras-result-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 116px;
	max-width: 32%;
	aspect-ratio: 116 / 100;
	overflow: hidden;
	background: var(--ras-thumb-bg);
}

.ras-result-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.ras-result-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

/* Letters matching the search: same colour as the title, emphasised by the
   Matched text style (bold / underline / italic) chosen in Appearance.
   A custom property set to "inherit" counts as unset, so a style that is
   off falls through to the fallback: the fallbacks must be "inherit". */
.ras-result-title mark {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: var(--ras-mark-weight, inherit);
	font-style: var(--ras-mark-style, inherit);
	text-decoration: var(--ras-mark-decoration, none);
	text-underline-offset: 3px;
}

.ras-result-price {
	color: var(--ras-price);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
}

.ras-result-price del {
	margin-right: 4px;
	font-weight: 400;
	opacity: .6;
}

.ras-result-price ins {
	text-decoration: none;
}

.ras-results-foot {
	margin-top: 24px;
}

.ras-view-all,
.ras-view-all:hover,
.ras-view-all:focus {
	color: var(--ras-view-all);
	font-size: 17px;
	text-decoration: none;
}

.ras-view-all:hover,
.ras-view-all:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ras-empty {
	padding: 10px 0;
	color: var(--ras-result-title);
	font-size: 16px;
	opacity: .8;
}

/* ---------- Sidebar: full-height side drawer ---------- */

.ras-sidebar {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.ras-sidebar[hidden] {
	display: none;
}

.ras-overlay {
	position: absolute;
	inset: 0;
	background: var(--ras-overlay);
	opacity: 0;
	transition: opacity .25s ease;
}

.ras-drawer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: var(--ras-sidebar-width, 50%);
	max-width: 100%;
	padding: 32px 32px 40px;
	overflow-y: auto;
	background: var(--ras-panel-bg);
	box-shadow: 0 0 40px rgba(0, 0, 0, .2);
	color: var(--ras-panel-text);
	text-align: left;
	outline: none;
	transform: translateX(100%);
	transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.ras-sidebar--left .ras-drawer {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.ras-sidebar.is-open .ras-overlay {
	opacity: 1;
}

.ras-sidebar.is-open .ras-drawer {
	transform: none;
}

.ras-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 48px;
}

.ras-sidebar .ras-drawer-title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 400;
	line-height: 1.1;
}

.ras-close--x:not(#ras-reset) {
	margin-left: auto;
	color: var(--ras-close);
}

.ras-close--x:not(#ras-reset):hover,
.ras-close--x:not(#ras-reset):focus {
	color: var(--ras-close);
}

.ras-close--x .ras-close-icon {
	display: block;
	width: var(--ras-close-size, 36px);
	height: var(--ras-close-size, 36px);
}

/* ---------- Modal: a box near the top of the screen ---------- */

.ras-dialog {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.ras-dialog[hidden] {
	display: none;
}

.ras-dialog.is-open .ras-overlay {
	opacity: 1;
}

.ras-dialog-box {
	position: absolute;
	top: var(--ras-modal-offset, 80px);
	width: var(--ras-modal-width, 760px);
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - var(--ras-modal-offset, 80px) - 24px);
	padding: 20px 24px 28px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: var(--ras-box-border-width, 0) solid var(--ras-box-border, transparent);
	border-radius: var(--ras-box-radius, 10px);
	background: var(--ras-box-bg, var(--ras-panel-bg));
	box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
	color: var(--ras-panel-text);
	text-align: left;
	outline: none;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity .2s ease, transform .2s ease;
}

.ras-dialog--top-left .ras-dialog-box {
	left: var(--ras-modal-side-offset, 24px);
	max-width: calc(100vw - var(--ras-modal-side-offset, 24px) - 16px);
}

.ras-dialog--top-right .ras-dialog-box {
	right: var(--ras-modal-side-offset, 24px);
	max-width: calc(100vw - var(--ras-modal-side-offset, 24px) - 16px);
}

.ras-dialog--top-center .ras-dialog-box {
	right: 0;
	left: 0;
	margin: 0 auto;
}

.ras-dialog.is-open .ras-dialog-box {
	opacity: 1;
	transform: none;
}

.ras-dialog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

@media (max-width: 782px) {
	.ras-dialog-box,
	.ras-dialog--top-left .ras-dialog-box,
	.ras-dialog--top-right .ras-dialog-box {
		top: 16px;
		right: 0;
		left: 0;
		max-height: calc(100vh - 32px);
		margin: 0 auto;
		padding: 16px 16px 24px;
	}
}

/* ---------- Info blocks: popular searches, categories, tags, did you mean ----------
   .ras-results--info holds the suggestions (.ras-results-main) and the
   blocks (.ras-info). The form is a size container, so a narrow panel stacks
   them even on a wide screen; under 1000px the blocks become an accordion. */

.ras-form--info {
	container-type: inline-size;
}

.ras-results-heading,
.ras-info-toggle:not(#ras-reset) {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--ras-heading);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .12em;
	line-height: 1.4;
	text-align: left;
	text-transform: uppercase;
	min-height: 0;
}

.ras-results--info:not(.has-info) .ras-results-heading,
.ras-form--columns .ras-results-heading {
	/* Columns carry their own headings. */
	display: none;
}

.ras-results--info.has-info {
	display: grid;
	gap: 28px 48px;
}

.ras-results--info.has-info[hidden] {
	display: none;
}

.ras-info-at-right.has-info {
	grid-template-columns: minmax(0, 1fr) minmax(200px, 36%);
}

.ras-info-at-left.has-info {
	grid-template-columns: minmax(200px, 36%) minmax(0, 1fr);
}

.ras-info-at-left .ras-info,
.ras-info-at-top .ras-info {
	order: -1;
}

.ras-results-main {
	min-width: 0;
}

.ras-info[hidden] {
	display: none;
}

/* Left / right: blocks one below the other. */
.ras-info-at-left .ras-info,
.ras-info-at-right .ras-info {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* Top / bottom: blocks next to each other. */
.ras-info-at-top .ras-info,
.ras-info-at-bottom .ras-info {
	display: grid;
	grid-template-columns: repeat(var(--ras-info-cols, 1), minmax(0, 1fr));
	gap: 24px 40px;
}

/* Wide screens: the title is a heading, not a control. */
.ras-info-toggle:not(#ras-reset) {
	pointer-events: none;
	cursor: default;
}

.ras-info-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ras-info-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ras-info-list li::before,
.ras-info-list li::marker {
	content: none;
}

/* Item count after a category name, when "Show category counts" is on. */
.ras-info-count {
	opacity: 0.6;
	font-size: 0.87em;
}

.ras-info-link:not(#ras-reset) {
	display: block;
	width: 100%;
	margin: 0;
	/* A small indent under the block title. */
	padding: 6px 0 6px 10px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--ras-result-title);
	font: inherit;
	font-size: 15px;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	min-height: 0;
	cursor: pointer;
}

.ras-info-link:not(#ras-reset):hover,
.ras-info-link:not(#ras-reset):focus-visible {
	background: none;
	color: var(--ras-result-title);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* A narrow panel (e.g. the bar at 420px): stack whatever the position. */
@container (max-width: 640px) {
	.ras-results--info.has-info {
		grid-template-columns: minmax(0, 1fr);
	}

	.ras-info-at-top .ras-info,
	.ras-info-at-bottom .ras-info {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Under 1000px: an accordion, always above the results whatever the
   desktop position. The title toggles its block open. */
@media (max-width: 999px) {
	.ras-results--info.has-info {
		display: flex;
		flex-direction: column;
		gap: 20px;
	}

	.ras-info-at-left .ras-info,
	.ras-info-at-right .ras-info,
	.ras-info-at-top .ras-info,
	.ras-info-at-bottom .ras-info {
		display: block;
		order: -1;
	}

	.ras-info-block {
		border-top: 1px solid var(--ras-divider);
	}

	.ras-info-block:last-child {
		border-bottom: 1px solid var(--ras-divider);
	}

	.ras-info-toggle:not(#ras-reset) {
		position: relative;
		margin: 0;
		padding: 14px 28px 14px 0;
		pointer-events: auto;
		cursor: pointer;
	}

	/* Chevron: points down closed, up open. */
	.ras-info-toggle:not(#ras-reset)::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 6px;
		width: 8px;
		height: 8px;
		border-right: 1.5px solid currentColor;
		border-bottom: 1.5px solid currentColor;
		transform: translateY(-70%) rotate(45deg);
		transition: transform .2s ease;
	}

	.ras-info-block.is-open .ras-info-toggle:not(#ras-reset)::after {
		transform: translateY(-30%) rotate(-135deg);
	}

	.ras-info-body {
		display: none;
		padding-bottom: 12px;
	}

	.ras-info-block.is-open .ras-info-body {
		display: block;
	}
}

/* ---------- Product rows: short description, SKU, price on the right ---------- */



.ras-result-excerpt {
	font-size: 13px;
	line-height: 1.4;
	opacity: .75;
}

.ras-result-sku {
	font-size: 12px;
	opacity: .6;
}

.ras-result-price--side {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	margin-left: auto;
	padding-left: 12px;
	font-size: 16px;
	text-align: right;
}

.ras-result-price--side del {
	margin: 0;
	font-size: 12px;
}

/* Phones: a smaller image, the description kept to two lines, and a
   right-hand price moved onto its own line under the details. */
@media (max-width: 560px) {
	.ras-result .ras-result-link {
		flex-wrap: wrap;
		gap: 6px 14px;
		font-size: 15px;
	}

	/* Details keep their place beside the image however long the title is. */
	.ras-result .ras-result-body {
		flex: 1 1 0;
	}

	.ras-result .ras-result-thumb {
		width: 64px;
		max-width: 25%;
	}

	.ras-result-excerpt {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.ras-result .ras-result-price--side {
		flex-basis: 100%;
		flex-direction: row;
		align-items: baseline;
		justify-content: flex-start;
		gap: 8px;
		margin-left: 0;
		padding-left: 0;
		text-align: left;
	}

	.ras-result.has-thumb .ras-result-price--side {
		padding-left: 78px; /* image + gap, so it lines up with the title */
	}
}

/* While the sidebar is open the page behind it does not scroll. */
html.ras-lock,
html.ras-lock body {
	overflow: hidden;
}

@media (max-width: 782px) {
	.ras-drawer {
		width: 100%;
		padding: 20px 16px 32px;
	}

	.ras-drawer-head {
		margin-bottom: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ras-panel,
	.ras-overlay,
	.ras-drawer {
		transition: none;
	}

	.ras-form.is-loading .ras-submit:not(#ras-reset) {
		animation: none;
	}
}
