/* RD Smart Search. Everything is scoped under .rd-ss. Mobile first.
   Theme with: --rd-ss-accent, --rd-ss-ink, --rd-ss-bg, --rd-ss-soft, --rd-ss-h, --rd-ss-radius, --rd-ss-panel-w */

.rd-ss {
	position: relative;
	box-sizing: border-box;
	color: var(--rd-ss-ink, #1a1a2e);
	font-size: 15px;
	line-height: 1.4;
	text-align: left;
}
.rd-ss *,
.rd-ss *::before,
.rd-ss *::after {
	box-sizing: border-box;
}

/* Bar */
.rd-ss__box {
	position: relative;
}
.rd-ss .rd-ss__form {
	display: flex;
	align-items: center;
	height: var(--rd-ss-h, 46px);
	margin: 0;
	background: var(--rd-ss-bg, #fff);
	border: 1px solid rgba(26, 26, 46, 0.18);
	border-radius: var(--rd-ss-radius, 10px);
	overflow: hidden;
}
.rd-ss .rd-ss__form:focus-within {
	border-color: var(--rd-ss-accent, #0d7377);
	box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
}
.rd-ss .rd-ss__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	outline: 0;
	box-shadow: none;
	background: transparent;
	color: var(--rd-ss-ink, #1a1a2e);
	font-size: 16px; /* 16px stops iOS from zooming on focus */
	-webkit-appearance: none;
	appearance: none;
}
.rd-ss .rd-ss__submit,
.rd-ss .rd-ss__toggle,
.rd-ss .rd-ss__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	min-width: 44px;
	height: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	color: var(--rd-ss-accent, #0d7377);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.rd-ss .rd-ss__close {
	color: var(--rd-ss-ink, #1a1a2e);
}

/* Dropdown. z-index sits above the WoodMart sticky header (z-index 390). */
.rd-ss__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000;
	width: var(--rd-ss-panel-w, auto);
	min-width: 100%;
	max-height: 70vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--rd-ss-bg, #fff);
	color: var(--rd-ss-ink, #1a1a2e);
	border-radius: var(--rd-ss-radius, 10px);
	box-shadow: 0 12px 32px rgba(26, 26, 46, 0.18);
}
.rd-ss__panel[hidden] {
	display: none;
}
.rd-ss .rd-ss__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-top: 1px solid rgba(26, 26, 46, 0.06);
	color: inherit;
	text-decoration: none;
}
.rd-ss .rd-ss__item:first-child {
	border-top: 0;
}
.rd-ss .rd-ss__item:hover,
.rd-ss .rd-ss__all:hover,
.rd-ss .is-active {
	background: var(--rd-ss-soft, #f0faf9);
}
.rd-ss .rd-ss__chip.is-active,
.rd-ss .rd-ss__chip:hover {
	background: var(--rd-ss-accent, #0d7377);
	color: #fff;
}
.rd-ss .rd-ss__img {
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	object-fit: cover;
	background: var(--rd-ss-soft, #f0faf9);
}
.rd-ss__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}
.rd-ss__title {
	font-weight: 600;
}
.rd-ss__title mark {
	padding: 0;
	background: none;
	color: var(--rd-ss-accent, #0d7377);
}
.rd-ss__cat {
	font-size: 12px;
	opacity: 0.65;
}
.rd-ss__price {
	flex: none;
	max-width: 40%;
	color: var(--rd-ss-accent, #0d7377);
	font-size: 13px;
	font-weight: 600;
	text-align: right;
}
.rd-ss__price del {
	font-weight: 400;
	opacity: 0.55;
}
.rd-ss__price ins {
	text-decoration: none;
}
.rd-ss__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 12px 14px;
}
.rd-ss .rd-ss__chip {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--rd-ss-soft, #f0faf9);
	color: var(--rd-ss-accent, #0d7377);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.rd-ss__none {
	padding: 14px 14px 0;
}
.rd-ss .rd-ss__all {
	display: block;
	padding: 12px 14px;
	border-top: 1px solid rgba(26, 26, 46, 0.06);
	color: var(--rd-ss-accent, #0d7377);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

/* Loading skeleton rows */
.rd-ss__skel {
	height: 48px;
	margin: 10px 14px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--rd-ss-soft, #f0faf9) 25%, #dff1ee 37%, var(--rd-ss-soft, #f0faf9) 63%);
	background-size: 400% 100%;
	animation: rd-ss-skel 1.2s ease infinite;
}
@keyframes rd-ss-skel {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
	.rd-ss__skel { animation: none; }
}

/* Icon style: full width overlay on mobile, anchored box from tablet up */
.rd-ss--icon {
	display: inline-block;
}
.rd-ss--icon .rd-ss__box {
	display: none;
}
.rd-ss--icon.is-open .rd-ss__box {
	display: block;
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 100000;
	max-height: 100vh;
	padding: 12px;
	overflow-y: auto;
	background: var(--rd-ss-bg, #fff);
	box-shadow: 0 12px 32px rgba(26, 26, 46, 0.18);
}
.rd-ss--icon .rd-ss__panel {
	position: static;
	margin-top: 8px;
	box-shadow: none;
}
@media (min-width: 768px) {
	.rd-ss--icon.is-open .rd-ss__box {
		position: absolute;
		top: calc(100% + 8px);
		left: auto;
		width: 440px;
		border-radius: var(--rd-ss-radius, 10px);
	}
}

/* Attached to a WoodMart search form */
.rd-ss--wm {
	height: 0;
}
.rd-ss--wm .rd-ss__panel {
	top: 6px;
	width: 100%;
}
.rd-ss--flow {
	height: auto;
}
.rd-ss--flow .rd-ss__panel {
	position: static;
	max-height: 60vh;
	margin-top: 8px;
	box-shadow: none;
}
/* The header dropdown is narrow (300px): put the price under the title so titles do not wrap word by word. */
.wd-search-dropdown .rd-ss__item {
	flex-wrap: wrap;
	row-gap: 2px;
}
.wd-search-dropdown .rd-ss__body {
	flex-basis: 0;
}
.wd-search-dropdown .rd-ss__price {
	flex-basis: 100%;
	max-width: none;
	padding-left: 60px;
	text-align: left;
}
/* While our dropdown is open, hide the theme history and popular requests box under the same form. */
.rd-ss-busy > .wd-search-results-wrapper,
.rd-ss-busy > .wd-search-history,
.rd-ss-busy > .wd-search-requests {
	display: none;
}

/* Empty results page helper */
.rd-ss-empty {
	margin: 16px 0;
}
.rd-ss-empty .rd-ss__chips {
	padding: 0;
}
