/*
 * RangeSearch frontend styles.
 * Deliberately minimal: the bar and panel inherit the theme's font and
 * text colour; the only opinionated values are spacing and structure.
 * --rangesearch-accent falls back to the link colour of the page.
 */

.rangesearch-form {
	margin: 0;
	max-width: var(--rangesearch-max-width, none);
}

.rangesearch-bar {
	display: flex;
	align-items: stretch;
	border: 1px solid currentColor;
	border-radius: var(--rangesearch-radius, 4px);
	background: var(--rangesearch-bar-bg, #fff);
	color: var(--rangesearch-bar-text, inherit);
}

.rangesearch-bar:focus-within {
	outline: 2px solid var(--rangesearch-accent, currentColor);
	outline-offset: 1px;
}

.rangesearch-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	padding: 0.55em 0.8em;
}

.rangesearch-input:focus {
	outline: none;
	box-shadow: none;
}

.rangesearch-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.rangesearch-submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0 0.9em;
	cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Suggestion panel                                                    */
/* ------------------------------------------------------------------ */

.rangesearch-panel {
	position: absolute;
	z-index: 100000;
	background: var(--rangesearch-panel-bg, #fff);
	color: var(--rangesearch-panel-text, #1d1d1d);
	border: 1px solid #c9c9c9;
	border-radius: var(--rangesearch-radius, 4px);
	max-height: min(70vh, 560px);
	overflow-y: auto;
	font-size: 0.95rem;
	line-height: 1.35;
}

.rangesearch-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.45);
}

.rangesearch-panel.rangesearch-loading {
	opacity: 0.65;
}

.rangesearch-heading {
	padding: 0.6em 0.9em 0.25em;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b6b6b;
}

.rangesearch-item {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.55em 0.9em;
	text-decoration: none;
	color: inherit;
}

.rangesearch-item.is-active,
.rangesearch-item:hover {
	background: #f1f1f1;
	color: inherit;
	text-decoration: none;
}

.rangesearch-thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 2px;
}

.rangesearch-body {
	flex: 1 1 auto;
	min-width: 0;
	display: block;
}

.rangesearch-title {
	display: block;
	font-weight: 600;
}

.rangesearch-desc {
	display: block;
	font-size: 0.85em;
	color: #5a5a5a;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.rangesearch-sku {
	display: block;
	font-size: 0.8em;
	color: #767676;
}

.rangesearch-price {
	flex: 0 0 auto;
	white-space: nowrap;
	font-weight: 600;
}

.rangesearch-price del {
	font-weight: 400;
	opacity: 0.6;
	margin-right: 0.35em;
}

.rangesearch-mark {
	background: none;
	color: inherit;
	font-weight: 700;
	padding: 0;
}

.rangesearch-item--tax .rangesearch-tax-label {
	font-size: 0.75em;
	color: #6b6b6b;
	min-width: 5.5em;
}

.rangesearch-item--tax .rangesearch-tax-name {
	flex: 1 1 auto;
}

.rangesearch-item--tax .rangesearch-tax-count {
	font-size: 0.8em;
	color: #767676;
}

.rangesearch-correction {
	padding: 0.6em 0.9em;
	font-size: 0.85em;
	color: #5a5a5a;
	border-bottom: 1px solid #e4e4e4;
}

.rangesearch-empty {
	padding: 1em 0.9em;
	color: #5a5a5a;
}

.rangesearch-see-all {
	display: block;
	text-align: center;
	border-top: 1px solid #e4e4e4;
	font-weight: 600;
	color: var(--rangesearch-accent, inherit);
}

/* ------------------------------------------------------------------ */
/* Details panel (two-pane suggestions on wide screens)                */
/* ------------------------------------------------------------------ */

.rangesearch-panel--split {
	display: flex;
	align-items: stretch;
	overflow: hidden;
}

.rangesearch-panel--split .rangesearch-list {
	flex: 1 1 55%;
	min-width: 0;
	overflow-y: auto;
	max-height: min(70vh, 560px);
}

.rangesearch-details {
	flex: 1 1 45%;
	min-width: 220px;
	border-left: 1px solid #e4e4e4;
	padding: 1em;
	overflow-y: auto;
	max-height: min(70vh, 560px);
}

.rangesearch-details-image {
	display: block;
	max-width: 100%;
	height: auto;
	margin-bottom: 0.75em;
}

.rangesearch-details-title {
	font-weight: 700;
	margin-bottom: 0.35em;
}

.rangesearch-details-price {
	font-weight: 600;
	margin-bottom: 0.5em;
}

.rangesearch-details-desc {
	font-size: 0.88em;
	color: #5a5a5a;
	margin-bottom: 0.9em;
}

.rangesearch-details-actions {
	display: flex;
	gap: 0.6em;
	flex-wrap: wrap;
}

.rangesearch-details-actions a {
	display: inline-block;
	padding: 0.45em 0.9em;
	border: 1px solid currentColor;
	border-radius: var(--rangesearch-radius, 4px);
	text-decoration: none;
	color: var(--rangesearch-accent, inherit);
	font-size: 0.88em;
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Search history                                                      */
/* ------------------------------------------------------------------ */

.rangesearch-history-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.rangesearch-history-clear {
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1em;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	text-transform: none;
	letter-spacing: 0;
}

.rangesearch-item--history {
	width: 100%;
	border: 0;
	background: transparent;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Voice search                                                        */
/* ------------------------------------------------------------------ */

.rangesearch-voice {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0 0.6em;
	cursor: pointer;
	opacity: 0.7;
}

.rangesearch-voice.is-listening {
	opacity: 1;
	color: var(--rangesearch-accent, currentColor);
}

/* ------------------------------------------------------------------ */
/* Icon layout                                                         */
/* ------------------------------------------------------------------ */

.rangesearch-form--icon .rangesearch-bar {
	border-color: transparent;
	background: transparent;
}

.rangesearch-form--icon:not(.is-open) .rangesearch-input,
.rangesearch-form--icon:not(.is-open) .rangesearch-voice {
	width: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

.rangesearch-form--icon.is-open .rangesearch-bar {
	border-color: currentColor;
	background: var(--rangesearch-bar-bg, #fff);
}

/* ------------------------------------------------------------------ */
/* Mobile overlay                                                      */
/* ------------------------------------------------------------------ */

.rangesearch-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	background: #fff;
	display: flex;
	flex-direction: column;
}

body.rangesearch-overlay-open {
	overflow: hidden;
}

.rangesearch-overlay-bar {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.6em 0.75em;
	border-bottom: 1px solid #dcdcdc;
}

.rangesearch-overlay-input {
	flex: 1 1 auto;
	min-width: 0;
	font: inherit;
	font-size: 1.05rem;
	padding: 0.5em 0.6em;
	border: 1px solid #c9c9c9;
	border-radius: var(--rangesearch-radius, 4px);
}

.rangesearch-overlay-close {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	font-size: 1.8rem;
	line-height: 1;
	padding: 0.2em 0.4em;
	cursor: pointer;
	color: inherit;
}

.rangesearch-panel--overlay {
	position: static;
	flex: 1 1 auto;
	width: 100% !important;
	max-height: none;
	border: 0;
	border-radius: 0;
}
