/**
 * SearchMint storefront styles.
 *
 * Everything is scoped under .smt-* and colours come from CSS variables, so the
 * admin settings or the theme can override them. Logical properties are used
 * so RTL works without a separate file.
 */

.smt,
.smt *,
.smt *::before,
.smt *::after {
	box-sizing: border-box;
}

.smt {
	/* variables */
	--smt-accent: #0e94a2;
	--smt-accent-2: #2f9fd8;
	--smt-accent-text: #fff;
	--smt-grad: linear-gradient( 100deg, var( --smt-accent ), var( --smt-accent-2 ) );
	--smt-grad-soft: linear-gradient( 100deg, color-mix( in srgb, var( --smt-accent ) 12%, transparent ), color-mix( in srgb, var( --smt-accent-2 ) 10%, transparent ) );
	--smt-surface: #fff;
	--smt-surface-2: #f3f7f8;
	--smt-border: #dde5ea;
	--smt-border-2: #c6d4dc;
	--smt-text: inherit;
	--smt-muted: #5b6f80;
	--smt-faint: #8496a6;
	--smt-ok: #18a06c;
	--smt-warn: #d98a06;
	--smt-bad: #d94343;
	--smt-radius: 10px;
	--smt-radius-lg: 18px;
	--smt-gap: 16px;
	--smt-shadow: 0 14px 40px -14px rgb( 21 42 61 / 22% );
	--smt-card-min: 220px;

	/* inherit the theme typography */
	font-family: inherit;
	color: var( --smt-text );
}

/* themes that use a dark colour scheme */
@media ( prefers-color-scheme: dark ) {
	.smt {
		--smt-surface: #16181d;
		--smt-surface-2: #1e2127;
		--smt-border: #2c3038;
		--smt-border-2: #3a404a;
		--smt-muted: #9aa1ab;
		--smt-faint: #7b8590;
		--smt-shadow: 0 14px 40px -14px rgb( 0 0 0 / 60% );
	}
}

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

.smt-spark {
	flex: none;
	color: var( --smt-accent );
}

/* Results page */

.smt-results {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.smt-heading {
	margin: 0;
	font-size: 1.5rem;
	line-height: 1.3;
}

.smt-heading span {
	color: var( --smt-accent );
}

.smt-notice {
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var( --smt-border );
	border-inline-start: 3px solid var( --smt-accent );
	border-radius: var( --smt-radius );
	background: var( --smt-surface-2 );
	font-size: 0.9rem;
}

.smt-empty {
	margin: 0;
	padding: 32px 0;
	color: var( --smt-muted );
	text-align: center;
}

/* The ask box */

.smt-ask {
	position: relative;
	max-width: 860px;
	margin: 0;
}

.smt-ask__frame {
	padding: 2.5px;
	border-radius: 19px;
	background: var( --smt-grad );
	box-shadow: 0 16px 40px -14px color-mix( in srgb, var( --smt-accent-2 ) 45%, transparent );
}

.smt-ask__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 58px;
	padding: 6px 6px 6px 18px;
	border-radius: 17px;
	background: var( --smt-surface );
}

.smt-ask__inner input[ type='search' ] {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	outline: none;
	box-shadow: none;
}

.smt-ask__inner input[ type='search' ]::placeholder {
	color: var( --smt-faint );
}

.smt-ask__go {
	height: 44px;
	padding: 0 22px;
	border-radius: 13px;
}

/* Loading: pipeline strip and skeleton cards */

.smt-pipe {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	color: var( --smt-faint );
	font-size: 0.8rem;
	font-weight: 550;
}

.smt-pipe__step {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.smt-pipe__step::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var( --smt-accent );
	animation: smt-pulse 1.2s ease-in-out infinite;
}

.smt-pipe__step:nth-child( 3 )::before {
	animation-delay: 0.3s;
}

.smt-pipe__step:nth-child( 5 )::before {
	animation-delay: 0.6s;
}

.smt-pipe__arr {
	color: var( --smt-border-2 );
}

.smt-skeleton {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( var( --smt-card-min ), 1fr ) );
	gap: var( --smt-gap );
}

.smt-skeleton span {
	display: block;
	height: 190px;
	border: 1px solid var( --smt-border );
	border-radius: var( --smt-radius );
	background: linear-gradient( 100deg, var( --smt-surface-2 ) 40%, var( --smt-surface ) 50%, var( --smt-surface-2 ) 60% );
	background-size: 200% 100%;
	animation: smt-shimmer 1.2s linear infinite;
}

.smt-sections.is-stale {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s;
}

/* The answer panel */

.smt-answer {
	padding: 2px;
	border-radius: 20px;
	background: var( --smt-grad );
	box-shadow: 0 20px 48px -18px color-mix( in srgb, var( --smt-accent-2 ) 45%, transparent );
	animation: smt-rise 0.45s ease;
}

.smt-answer__in {
	display: grid;
	grid-template-columns: 1fr 320px;
	overflow: hidden;
	border-radius: 18px;
	background: var( --smt-surface );
}

.smt-answer__main {
	min-width: 0;
	padding: 24px 28px;
}

.smt-answer__hd {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	color: var( --smt-accent );
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.smt-answer__body {
	max-width: 62ch;
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.7;
}

.smt-answer__src {
	margin: 10px 0 0;
	color: var( --smt-faint );
	font-size: 0.75rem;
}

.smt-answer__src b {
	color: var( --smt-muted );
}

.smt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 0 0 16px;
}

.smt-ichip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	border: 1px solid var( --smt-border-2 );
	border-radius: 9px;
	background: var( --smt-surface-2 );
	font-size: 0.85rem;
}

.smt-ichip b {
	font-weight: 650;
}

.smt-ichip__x {
	padding: 0 2px;
	border-radius: 6px;
	color: var( --smt-faint );
	font-size: 1rem;
	line-height: 1;
	text-decoration: none;
}

.smt-ichip__x:hover {
	color: var( --smt-bad );
}

.smt-follow {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px dashed var( --smt-border-2 );
}

.smt-refine {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 6px 6px 14px;
	border: 1.5px solid var( --smt-border-2 );
	border-radius: 12px;
	background: var( --smt-surface-2 );
	transition: border-color 0.15s, box-shadow 0.15s;
}

.smt-refine:focus-within {
	border-color: var( --smt-accent );
	background: var( --smt-surface );
	box-shadow: 0 0 0 3px color-mix( in srgb, var( --smt-accent ) 15%, transparent );
}

.smt-refine input[ type='text' ] {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 6px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	outline: none;
	box-shadow: none;
}

.smt-refine .smt-btn {
	padding: 9px 18px;
	border-radius: 9px;
	font-size: 0.85rem;
}

.smt-sugs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

/* AI top pick */

.smt-answer__pick {
	display: flex;
	flex-direction: column;
	padding: 22px 24px;
	border-inline-start: 1px solid color-mix( in srgb, var( --smt-accent ) 30%, transparent );
	background: var( --smt-grad-soft );
}

.smt-pick {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 11px;
}

.smt-pick__lbl {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var( --smt-accent );
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.smt-pick__top {
	display: flex;
	align-items: center;
	gap: 14px;
}

.smt-pick__img {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 66px;
	height: 66px;
	overflow: hidden;
	border: 1px solid var( --smt-border );
	border-radius: 14px;
	background: var( --smt-surface );
	box-shadow: 0 6px 16px -8px rgb( 21 42 61 / 20% );
}

.smt-pick__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.smt-pick__nm {
	color: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.smt-pick__nm:hover {
	color: var( --smt-accent );
}

.smt-pick__sku {
	margin-top: 3px;
	color: var( --smt-faint );
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.72rem;
}

.smt-pick__ft {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: auto;
}

.smt-pick__pr {
	font-size: 1.35rem;
	font-weight: 800;
}

.smt-pick__pr del {
	margin-inline-end: 6px;
	color: var( --smt-faint );
	font-size: 0.8rem;
	font-weight: 500;
}

.smt-pick__ft .smt-btn {
	margin-inline-start: auto;
	padding: 9px 13px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.smt-pick__meta {
	margin: 2px 0 0;
	color: var( --smt-faint );
	font-size: 0.72rem;
	text-align: center;
}

/* "why" blocks, on the top pick and inside cards */

.smt-why {
	display: block;
	margin: 0;
	padding: 7px 10px;
	border-inline-start: 3px solid var( --smt-accent );
	border-radius: 0 8px 8px 0;
	background: var( --smt-surface-2 );
	color: var( --smt-muted );
	font-size: 0.78rem;
	line-height: 1.45;
}

.smt-answer__pick .smt-why {
	background: var( --smt-surface );
}

.smt-why b {
	color: var( --smt-accent );
	font-weight: 700;
}

@media ( max-width: 960px ) {
	.smt-answer__in {
		grid-template-columns: 1fr;
	}

	.smt-answer__pick {
		border-inline-start: 0;
		border-top: 1px solid color-mix( in srgb, var( --smt-accent ) 30%, transparent );
	}

	.smt-answer__main {
		padding: 20px;
	}
}

/* Smart filter chips */

.smt-filterbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px 10px;
	padding: 14px 16px;
	border: 1px solid var( --smt-border );
	border-radius: 14px;
	background: var( --smt-surface );
	animation: smt-rise 0.4s ease;
}

.smt-filterbar__lbl {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 4px 7px 0;
	color: var( --smt-faint );
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.smt-ai {
	padding: 2px 6px;
	border-radius: 5px;
	background: var( --smt-grad );
	color: var( --smt-accent-text );
	font-size: 0.6rem;
	font-weight: 800;
}

.smt-fgroup {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.smt-fgroup__n {
	padding-inline-start: 6px;
	color: var( --smt-faint );
	font-size: 0.7rem;
	font-weight: 650;
}

.smt-fchip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 13px;
	border: 1px solid var( --smt-border-2 );
	border-radius: 999px;
	background: var( --smt-surface );
	color: var( --smt-muted );
	font-size: 0.8rem;
	font-weight: 550;
	text-decoration: none;
	transition: border-color 0.13s, color 0.13s;
}

.smt-fchip:hover {
	border-color: var( --smt-accent );
	color: var( --smt-accent );
}

.smt-fchip.is-on {
	border-color: transparent;
	background: var( --smt-grad );
	color: var( --smt-accent-text );
	font-weight: 650;
}

.smt-fchip__n {
	opacity: 0.6;
	font-size: 0.7rem;
}

.smt-fchip--clear {
	border: 1px dashed color-mix( in srgb, var( --smt-bad ) 50%, transparent );
	color: var( --smt-bad );
}

/* Sections and the product grid */

.smt-section {
	margin: 0 0 34px;
	animation: smt-rise 0.45s ease;
}

.smt-section__hd {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 14px;
}

.smt-section__hd .smt-spark {
	align-self: center;
}

.smt-section__title {
	margin: 0;
	font-size: 1.15rem;
	letter-spacing: -0.01em;
}

.smt-section__cnt {
	color: var( --smt-faint );
	font-size: 0.8rem;
}

.smt-section__tag {
	padding: 3px 9px;
	border: 1px solid var( --smt-border-2 );
	border-radius: 999px;
	background: var( --smt-surface );
	color: var( --smt-muted );
	font-size: 0.65rem;
	font-weight: 600;
}

/* WooCommerce's own loop markup, laid out as a card grid; a theme can override any of this */

.smt-sections ul.products {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( var( --smt-card-min ), 1fr ) );
	gap: var( --smt-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.smt-sections ul.products::before,
.smt-sections ul.products::after {
	content: none;
}

.smt-sections ul.products li.product {
	display: flex;
	position: relative;
	flex-direction: column;
	gap: 8px;
	float: none;
	width: auto;
	margin: 0;
	padding: 14px;
	border: 1px solid var( --smt-border );
	border-radius: var( --smt-radius );
	background: var( --smt-surface );
	text-align: start;
	transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.smt-sections ul.products li.product:hover,
.smt-sections ul.products li.product:focus-within {
	border-color: var( --smt-accent );
	box-shadow: var( --smt-shadow );
	transform: translateY( -2px );
}

.smt-sections li.product.smt-card--oos {
	opacity: 0.7;
}

.smt-sections li.product a.woocommerce-loop-product__link {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.smt-sections li.product img {
	display: block;
	width: 100%;
	height: auto;
	/* fixed ratio so the layout does not shift while images load */
	aspect-ratio: 1;
	object-fit: contain;
	margin: 0;
	border: 1px solid var( --smt-border );
	border-radius: calc( var( --smt-radius ) - 2px );
	background: var( --smt-surface-2 );
}

.smt-sections li.product .woocommerce-loop-product__title {
	margin: 0;
	padding: 0;
	font-size: 0.9rem;
	font-weight: 650;
	line-height: 1.35;
}

.smt-sections li.product .price {
	display: block;
	margin: auto 0 0;
	color: inherit;
	font-size: 1.1rem;
	font-weight: 800;
}

.smt-sections li.product .price del {
	margin-inline-end: 6px;
	color: var( --smt-faint );
	font-size: 0.8rem;
	font-weight: 500;
	opacity: 1;
}

.smt-sections li.product .price ins {
	background: none;
	text-decoration: none;
}

.smt-sections li.product .star-rating {
	margin: 0;
}

.smt-sections li.product .button {
	margin: 0;
}

.smt-card__extra {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.smt-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.smt-bdg {
	padding: 3px 8px;
	border-radius: 5px;
	background: var( --smt-surface-2 );
	color: var( --smt-muted );
	font-size: 0.65rem;
	font-weight: 700;
}

.smt-bdg--ok {
	background: color-mix( in srgb, var( --smt-ok ) 12%, transparent );
	color: var( --smt-ok );
}

.smt-bdg--out {
	background: color-mix( in srgb, var( --smt-bad ) 12%, transparent );
	color: var( --smt-bad );
}

.smt-bdg--cond {
	background: color-mix( in srgb, var( --smt-accent-2 ) 12%, transparent );
	color: var( --smt-accent-2 );
}

.smt-bdg--exact_match,
.smt-bdg--best_value {
	background: var( --smt-grad );
	color: var( --smt-accent-text );
}

/* Chips and buttons */

.smt-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border: 1px solid var( --smt-border-2 );
	border-radius: 999px;
	background: var( --smt-surface );
	color: var( --smt-muted );
	font: inherit;
	font-size: 0.8rem;
	font-weight: 550;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
}

.smt-chip:hover {
	border-color: var( --smt-accent );
	color: var( --smt-accent );
	box-shadow: 0 6px 16px -8px rgb( 21 42 61 / 25% );
	transform: translateY( -1px );
}

.smt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: 1px solid var( --smt-border );
	border-radius: var( --smt-radius );
	background: var( --smt-surface );
	color: inherit;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s, filter 0.15s;
}

.smt-btn--primary {
	border-color: transparent;
	background: var( --smt-grad );
	color: var( --smt-accent-text );
	box-shadow: 0 8px 20px -8px color-mix( in srgb, var( --smt-accent-2 ) 55%, transparent );
}

.smt-btn--primary:hover {
	color: var( --smt-accent-text );
	filter: brightness( 1.05 );
	transform: translateY( -1px );
}

.smt-btn:focus-visible,
.smt-chip:focus-visible,
.smt-fchip:focus-visible,
.smt-ichip__x:focus-visible,
.smt-sections li.product a:focus-visible {
	/* keep a visible focus outline */
	outline: 2px solid var( --smt-accent );
	outline-offset: 2px;
}

.smt-more {
	align-self: center;
	margin: 0 auto;
}

/* Autocomplete dropdown */

.smt-ac {
	z-index: 9999;
	max-height: min( 60vh, 460px );
	overflow-y: auto;
	border: 1px solid var( --smt-border );
	border-radius: var( --smt-radius-lg );
	background: var( --smt-surface );
	box-shadow: var( --smt-shadow );
}

.smt-ac__pill {
	display: block;
	width: 100%;
	padding: 12px 18px;
	border: 0;
	border-bottom: 1px solid var( --smt-border );
	background: var( --smt-grad-soft );
	color: var( --smt-accent );
	font: inherit;
	font-size: 0.85rem;
	font-weight: 650;
	text-align: start;
	cursor: pointer;
}

.smt-ac__option {
	display: block;
	padding: 9px 18px;
	cursor: pointer;
}

.smt-ac__option.is-active,
.smt-ac__option:hover {
	background: var( --smt-surface-2 );
}

.smt-ac__text,
.smt-ac__cat {
	font-size: 0.9rem;
}

.smt-ac__cat::before {
	content: '›';
	margin-inline-end: 8px;
	color: var( --smt-faint );
}

.smt-ac__product {
	display: flex;
	align-items: center;
	gap: 12px;
}

.smt-ac__product img {
	width: 38px;
	height: 38px;
	object-fit: contain;
	border: 1px solid var( --smt-border );
	border-radius: 9px;
	background: var( --smt-surface-2 );
}

.smt-ac__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.smt-ac__title {
	overflow: hidden;
	font-size: 0.9rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.smt-ac__price {
	color: var( --smt-accent );
	font-size: 0.8rem;
	font-weight: 700;
}

.smt-ac__empty {
	margin: 0;
	padding: 16px;
	color: var( --smt-muted );
	font-size: 0.85rem;
	text-align: center;
}

/* Floating button and overlay, used when the theme has no search box */

.smt-fab {
	display: flex;
	position: fixed;
	z-index: 9998;
	inset-block-end: 24px;
	inset-inline-end: 24px;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: var( --smt-grad );
	color: var( --smt-accent-text );
	box-shadow: var( --smt-shadow );
	cursor: pointer;
}

.smt-overlay {
	display: flex;
	position: fixed;
	z-index: 9999;
	inset: 0;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 15vh 16px 0;
	background: var( --smt-surface );
}

.smt-overlay__input {
	width: min( 100%, 640px );
	padding: 14px 18px;
	border: 1.5px solid var( --smt-border-2 );
	border-radius: 14px;
	background: var( --smt-surface );
	color: inherit;
	font: inherit;
	font-size: 1.1rem;
}

.smt-overlay__close {
	position: absolute;
	inset-block-start: 16px;
	inset-inline-end: 16px;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.6rem;
	cursor: pointer;
}

/* Motion */

@keyframes smt-rise {
	from {
		opacity: 0;
		transform: translateY( 8px );
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes smt-shimmer {
	to {
		background-position: -200% 0;
	}
}

@keyframes smt-pulse {
	0%,
	100% {
		opacity: 0.35;
	}

	50% {
		opacity: 1;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.smt-answer,
	.smt-filterbar,
	.smt-section,
	.smt-skeleton span,
	.smt-pipe__step::before {
		animation: none;
	}

	.smt-sections ul.products li.product,
	.smt-chip,
	.smt-btn {
		transition: none;
	}
}
