/**
 * Solkarra Bow Finder.
 *
 * Every token is scoped to .sbf-root rather than :root, so the widget carries
 * its own look onto whatever theme it lands in and cannot leak styles back out.
 * The three accent values come from the per-site settings as inline custom
 * properties, so each store can look like itself without a separate build.
 *
 * --sbf-accent is a background. --sbf-accent-ink is whatever text sits on top
 * of it, which is not always white: a light brand colour such as a coral needs
 * dark text to stay readable. --sbf-accent-dark is the button hover background
 * and also link text on white, so it is always dark enough to carry white text.
 */

.sbf-root {
	--sbf-accent: #8a5a2b;
	--sbf-accent-dark: #5d3c1c;
	--sbf-accent-ink: #ffffff;

	--sbf-ink: #1c1a17;
	--sbf-ink-soft: #5c564e;
	--sbf-line: #ddd6cc;
	--sbf-surface: #ffffff;
	--sbf-surface-alt: #faf7f2;
	--sbf-surface-sunk: #f2ede4;

	--sbf-green: #2f6b3f;
	--sbf-amber: #9a6510;
	--sbf-red: #9c2f22;

	--sbf-radius: 10px;
	--sbf-radius-sm: 6px;
	--sbf-gap: 1rem;
	--sbf-shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 8px 24px rgba(28, 26, 23, 0.06);

	box-sizing: border-box;
	color: var(--sbf-ink);
	font-size: 16px;
	line-height: 1.55;
	max-width: 68rem;
	margin-inline: auto;
}

.sbf-root *,
.sbf-root *::before,
.sbf-root *::after {
	box-sizing: inherit;
}

.sbf-root h2,
.sbf-root h3,
.sbf-root h4 {
	color: var(--sbf-ink);
	line-height: 1.2;
	margin: 0;
}

.sbf-root p {
	margin: 0;
}

.sbf-root ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sbf-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------------------------------------------------------------- Intro */

.sbf-boot,
.sbf-intro {
	background: var(--sbf-surface-alt);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	text-align: center;
}

.sbf-boot__heading,
.sbf-intro__heading {
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	letter-spacing: -0.01em;
}

.sbf-boot__body,
.sbf-intro__body {
	color: var(--sbf-ink-soft);
	margin: 0.75rem auto 0;
	max-width: 44ch;
}

.sbf-intro .sbf-btn {
	margin-top: 1.5rem;
}

/* ----------------------------------------------------------------- Step */

.sbf-step {
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.sbf-step__progress {
	color: var(--sbf-ink-soft);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.sbf-progress {
	background: var(--sbf-surface-sunk);
	border-radius: 999px;
	height: 4px;
	margin: 0.5rem 0 1.5rem;
	overflow: hidden;
}

.sbf-progress__fill {
	background: var(--sbf-accent);
	height: 100%;
	transition: width 240ms ease;
}

.sbf-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

.sbf-legend {
	display: block;
	padding: 0;
	width: 100%;
}

.sbf-step__heading {
	font-size: clamp(1.25rem, 3vw, 1.625rem);
	letter-spacing: -0.01em;
}

.sbf-step__heading:focus-visible {
	outline: 2px solid var(--sbf-accent);
	outline-offset: 4px;
}

.sbf-step__help {
	color: var(--sbf-ink-soft);
	margin-top: 0.5rem;
	max-width: 56ch;
}

/* -------------------------------------------------------------- Choices */

.sbf-choices {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	margin-top: 1.5rem;
}

.sbf-choices--compact {
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.sbf-choice {
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius-sm);
	cursor: pointer;
	display: flex;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.sbf-choice:hover {
	border-color: var(--sbf-accent);
}

.sbf-choice:has(.sbf-choice__input:checked) {
	background: var(--sbf-surface-alt);
	border-color: var(--sbf-accent);
	box-shadow: inset 0 0 0 1px var(--sbf-accent);
}

.sbf-choice:has(.sbf-choice__input:focus-visible) {
	outline: 2px solid var(--sbf-accent);
	outline-offset: 2px;
}

.sbf-choice__input {
	accent-color: var(--sbf-accent);
	flex: 0 0 auto;
	margin-top: 0.28rem;
}

.sbf-choice__body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.sbf-choice__label {
	font-weight: 600;
}

.sbf-choice__hint {
	color: var(--sbf-ink-soft);
	font-size: 0.875rem;
	line-height: 1.4;
}

/* --------------------------------------------------------------- Fields */

.sbf-sub {
	margin-top: 1.5rem;
}

.sbf-field {
	margin-top: 1.25rem;
	max-width: 26rem;
}

.sbf-field__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.sbf-field__input {
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius-sm);
	color: inherit;
	font: inherit;
	padding: 0.6rem 0.75rem;
	width: 100%;
}

.sbf-field__input:focus-visible {
	border-color: var(--sbf-accent);
	outline: 2px solid var(--sbf-accent);
	outline-offset: 1px;
}

.sbf-field__hint {
	color: var(--sbf-ink-soft);
	font-size: 0.875rem;
	margin-top: 0.4rem;
}

.sbf-estimate {
	background: var(--sbf-surface-alt);
	border-left: 3px solid var(--sbf-accent);
	border-radius: 0 var(--sbf-radius-sm) var(--sbf-radius-sm) 0;
	color: var(--sbf-ink-soft);
	font-size: 0.9375rem;
	margin-top: 1.25rem;
	padding: 0.75rem 1rem;
}

.sbf-estimate:empty {
	display: none;
}

/* -------------------------------------------------------------- Buttons */

.sbf-btn {
	border: 1px solid transparent;
	border-radius: var(--sbf-radius-sm);
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	padding: 0.7rem 1.35rem;
	text-align: center;
	text-decoration: none;
	transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.sbf-btn:focus-visible {
	outline: 2px solid var(--sbf-accent);
	outline-offset: 2px;
}

.sbf-btn--primary {
	background: var(--sbf-accent);
	border-color: var(--sbf-accent);
	color: var(--sbf-accent-ink);
}

.sbf-btn--primary:hover {
	background: var(--sbf-accent-dark);
	border-color: var(--sbf-accent-dark);
	color: #fff;
}

.sbf-btn--small {
	font-size: 0.8125rem;
	padding: 0.45rem 0.9rem;
}

/* Opaque rather than transparent: a ghost button also lands straight on the
   page background, where whatever the theme puts behind it is not ours to
   assume readable. */
.sbf-btn--ghost {
	background: var(--sbf-surface);
	border-color: var(--sbf-line);
	color: var(--sbf-ink);
}

.sbf-btn--ghost:hover {
	border-color: var(--sbf-accent);
	color: var(--sbf-accent-dark);
}

.sbf-btn--disabled,
.sbf-btn[disabled] {
	background: var(--sbf-surface-sunk);
	border-color: var(--sbf-line);
	color: var(--sbf-ink-soft);
	cursor: not-allowed;
}

.sbf-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-end;
	margin-top: 1.75rem;
}

/* -------------------------------------------------------------- Results */

.sbf-results {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.sbf-results__heading {
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	letter-spacing: -0.01em;
}

.sbf-results__heading:focus-visible {
	outline: 2px solid var(--sbf-accent);
	outline-offset: 4px;
}

.sbf-callout {
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	padding: 1.25rem 1.5rem;
}

.sbf-callout--accent {
	background: var(--sbf-surface-alt);
	border-left: 4px solid var(--sbf-accent);
}

.sbf-callout--warn {
	background: #fdf6ec;
	border-left: 4px solid var(--sbf-amber);
}

.sbf-callout__heading {
	font-size: 1.125rem;
}

.sbf-callout__body {
	color: var(--sbf-ink-soft);
	margin-top: 0.35rem;
}

.sbf-callout__meta {
	color: var(--sbf-ink-soft);
	font-size: 0.875rem;
	margin-top: 0.5rem;
}

.sbf-callout .sbf-btn {
	margin-top: 1rem;
}

.sbf-note {
	color: var(--sbf-ink-soft);
	font-size: 0.9375rem;
}

.sbf-note--soft {
	background: var(--sbf-surface-sunk);
	border-radius: var(--sbf-radius-sm);
	padding: 0.7rem 1rem;
}

/* ---------------------------------------------------------------- Cards */

.sbf-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.sbf-card {
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.sbf-card--hero {
	border-color: var(--sbf-accent);
	box-shadow: var(--sbf-shadow);
	grid-column: 1 / -1;
}

/* On a wide screen the hero goes two column, with the slot badge spanning
   both so it still reads as a label for the whole card. */
@media (min-width: 56rem) {
	.sbf-card--hero {
		display: grid;
		grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
		grid-template-rows: auto minmax(0, 1fr);
	}

	.sbf-card--hero .sbf-card__slot {
		grid-column: 1 / -1;
	}

	.sbf-card--hero .sbf-card__media {
		min-height: 100%;
	}

	/* A hero with no product image should not leave an empty column. */
	.sbf-card--hero:not(:has(.sbf-card__media)) {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sbf-card__slot {
	background: var(--sbf-accent);
	color: var(--sbf-accent-ink);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 0.45rem 1rem;
	text-transform: uppercase;
}

.sbf-card--alt .sbf-card__slot {
	background: var(--sbf-surface-sunk);
	color: var(--sbf-ink-soft);
}

.sbf-card__media {
	align-items: center;
	background: var(--sbf-surface-sunk);
	display: flex;
	justify-content: center;
	min-height: 11rem;
	overflow: hidden;
}

.sbf-card__media img {
	display: block;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	width: 100%;
}

.sbf-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.15rem 1.25rem 1.35rem;
}

.sbf-card__title {
	font-size: 1.0625rem;
	line-height: 1.3;
}

.sbf-card--hero .sbf-card__title {
	font-size: 1.375rem;
}

.sbf-card__link {
	color: inherit;
	text-decoration: none;
}

.sbf-card__link:hover {
	color: var(--sbf-accent-dark);
	text-decoration: underline;
}

.sbf-card__meta {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sbf-card__price {
	font-size: 1.0625rem;
	font-weight: 700;
}

.sbf-card__score {
	color: var(--sbf-ink-soft);
	font-size: 0.8125rem;
	margin-left: auto;
}

.sbf-card__store {
	color: var(--sbf-accent-dark);
	font-size: 0.8125rem;
	font-weight: 600;
}

.sbf-card__spec {
	color: var(--sbf-ink-soft);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
}

.sbf-card__blurb {
	color: var(--sbf-ink-soft);
	font-size: 0.9375rem;
}

.sbf-card__subheading {
	color: var(--sbf-ink-soft);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	margin-top: 0.25rem;
	text-transform: uppercase;
}

.sbf-pill {
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.6rem;
}

.sbf-pill--instock {
	background: #e8f2ea;
	color: var(--sbf-green);
}

.sbf-pill--onbackorder {
	background: #fdf1de;
	color: var(--sbf-amber);
}

.sbf-pill--outofstock {
	background: #f7e9e7;
	color: var(--sbf-red);
}

.sbf-reasons__item,
.sbf-caveats__item {
	font-size: 0.9375rem;
	line-height: 1.45;
	padding-left: 1.15rem;
	position: relative;
}

.sbf-reasons__item + .sbf-reasons__item,
.sbf-caveats__item + .sbf-caveats__item {
	margin-top: 0.3rem;
}

.sbf-reasons__item::before {
	color: var(--sbf-green);
	content: "\2713";
	left: 0;
	position: absolute;
}

.sbf-caveats__item::before {
	content: "\2022";
	left: 0.15rem;
	position: absolute;
}

.sbf-caveats__item--high {
	color: var(--sbf-red);
	font-weight: 600;
}

.sbf-caveats__item--high::before {
	color: var(--sbf-red);
	content: "\26A0";
	font-weight: 400;
	left: 0;
}

.sbf-caveats__item--soft {
	color: var(--sbf-ink-soft);
}

.sbf-caveats__item--soft::before {
	color: var(--sbf-amber);
}

.sbf-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: auto;
	padding-top: 0.75rem;
}

/* ------------------------------------------------ Strips and side panels */

.sbf-addons,
.sbf-more,
.sbf-sister,
.sbf-share,
.sbf-email {
	background: var(--sbf-surface-alt);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	padding: 1.25rem 1.5rem 1.5rem;
}

.sbf-sister {
	border-left: 4px solid var(--sbf-accent);
}

.sbf-section__heading {
	font-size: 1.125rem;
}

.sbf-section__body {
	color: var(--sbf-ink-soft);
	margin-top: 0.35rem;
	max-width: 60ch;
}

/* auto-fill, not auto-fit: auto-fit collapses the tracks nothing sits in, so a
   group holding a single thumb ring stretched that one card the full width of
   the panel and blew its thumbnail up to a hero image. auto-fill keeps the
   empty tracks, so an add-on card is the same size whether the group has one
   item in it or six. Bounding the track is also what keeps the thumbnail a
   sensible size, since it is a square of whatever the column turns out to be. */
.sbf-strip {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	margin-top: 1rem;
}

/* Below this a 13rem track leaves one column, which is a full-width square
   photograph on a phone. Two narrower ones read better. */
@media (max-width: 34rem) {
	.sbf-strip {
		grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
	}
}

.sbf-strip__item {
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius-sm);
	color: inherit;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 0.75rem;
	text-decoration: none;
	transition: border-color 140ms ease;
}

.sbf-strip__item:hover,
.sbf-strip__item:focus-within {
	border-color: var(--sbf-accent);
}

.sbf-strip__link {
	color: inherit;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	text-decoration: none;
}

.sbf-strip__item img {
	aspect-ratio: 1 / 1;
	border-radius: var(--sbf-radius-sm);
	display: block;
	object-fit: cover;
	width: 100%;
}

.sbf-strip__name {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.35;
}

.sbf-strip__meta {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.sbf-strip__price {
	color: var(--sbf-ink-soft);
	font-size: 0.8125rem;
}

.sbf-strip__store {
	color: var(--sbf-ink-soft);
	font-size: 0.75rem;
}

/* The button sits on the bottom edge whatever the name above it wraps to, so a
   row of cards lines up rather than stepping. */
.sbf-strip__item .sbf-btn {
	margin-top: auto;
}

/* ------------------------------------------------------------ Add-on rows */

.sbf-addons__group {
	border-top: 1px solid var(--sbf-line);
	font-size: 0.9375rem;
	letter-spacing: 0.02em;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	text-transform: uppercase;
}

.sbf-addons__group:first-of-type {
	border-top: 0;
	margin-top: 0.5rem;
	padding-top: 0;
}

.sbf-addons__note {
	color: var(--sbf-ink-soft);
	font-size: 0.8125rem;
	margin-top: 0.35rem;
	max-width: 60ch;
}

.sbf-sister .sbf-btn {
	margin-top: 1rem;
}

/* ----------------------------------------------- Everything else that fits */

.sbf-more__list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1rem;
}

.sbf-more__link {
	align-items: center;
	background: var(--sbf-surface);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius-sm);
	color: inherit;
	display: flex;
	gap: 0.85rem;
	padding: 0.6rem 0.85rem;
	text-decoration: none;
	transition: border-color 140ms ease;
}

.sbf-more__link:hover {
	border-color: var(--sbf-accent);
}

.sbf-more__link img {
	border-radius: var(--sbf-radius-sm);
	flex: 0 0 auto;
	height: 3rem;
	object-fit: cover;
	width: 3rem;
}

.sbf-more__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.sbf-more__name {
	font-weight: 600;
	line-height: 1.3;
}

.sbf-more__spec {
	color: var(--sbf-ink-soft);
	font-size: 0.75rem;
}

.sbf-more__meta {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-end;
}

.sbf-more__price {
	font-weight: 700;
}

.sbf-more__meta .sbf-card__score {
	margin-left: 0;
}

@media (max-width: 34rem) {
	.sbf-more__link {
		flex-wrap: wrap;
	}

	.sbf-more__meta {
		flex-basis: 100%;
		justify-content: flex-start;
	}
}

/* ------------------------------------------------------------- Controls */

.sbf-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.sbf-controls .sbf-note {
	flex-basis: 100%;
}

.sbf-share__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1rem;
}

.sbf-share__row .sbf-field__input {
	flex: 1 1 18rem;
}

.sbf-email__form {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	margin-top: 1rem;
	max-width: 32rem;
}

.sbf-email__form .sbf-field {
	margin-top: 0;
}

.sbf-consent {
	align-items: flex-start;
	display: flex;
	gap: 0.6rem;
}

.sbf-consent input {
	accent-color: var(--sbf-accent);
	margin-top: 0.28rem;
}

.sbf-consent__text {
	color: var(--sbf-ink-soft);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.sbf-email__form .sbf-btn {
	align-self: flex-start;
}

.sbf-email__status:empty {
	display: none;
}

.sbf-email__status {
	color: var(--sbf-ink-soft);
	font-size: 0.9375rem;
}

/* ------------------------------------------------------------- Noscript */

.sbf-noscript {
	background: var(--sbf-surface-alt);
	border: 1px solid var(--sbf-line);
	border-radius: var(--sbf-radius);
	padding: 1.25rem 1.5rem;
}

.sbf-noscript ul {
	list-style: disc;
	margin-top: 0.75rem;
	padding-left: 1.25rem;
}

.sbf-noscript li {
	margin-bottom: 0.25rem;
}

/* ----------------------------------------------------------- Dark theme */

/*
 * Keyed to the page, not to the operating system.
 *
 * This used to be a `prefers-color-scheme: dark` media query, which is wrong
 * for a widget: a shopper whose OS is set to dark got the dark palette dropped
 * into a light store page, so the results heading was white on white and the
 * ghost buttons disappeared. finder.js measures what is actually behind the
 * widget and sets data-sbf-scheme, so the palette follows the host theme.
 */
.sbf-root[data-sbf-scheme="dark"] {
	--sbf-ink: #f2ede5;
	--sbf-ink-soft: #b3aa9d;
	--sbf-line: #3a352e;
	--sbf-surface: #201d19;
	--sbf-surface-alt: #262219;
	--sbf-surface-sunk: #2e2921;
	--sbf-green: #7cc08d;
	--sbf-amber: #e0aa5a;
	--sbf-red: #e08a7c;
	--sbf-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.sbf-root[data-sbf-scheme="dark"] .sbf-callout--warn {
	background: #2e2617;
}

.sbf-root[data-sbf-scheme="dark"] .sbf-pill--instock {
	background: rgba(124, 192, 141, 0.16);
}

.sbf-root[data-sbf-scheme="dark"] .sbf-pill--onbackorder {
	background: rgba(224, 170, 90, 0.16);
}

.sbf-root[data-sbf-scheme="dark"] .sbf-pill--outofstock {
	background: rgba(224, 138, 124, 0.16);
}

.sbf-root[data-sbf-scheme="dark"] .sbf-card__slot,
.sbf-root[data-sbf-scheme="dark"] .sbf-btn--primary {
	color: #17140f;
}

/* ----------------------------------------------------------- Motion */

@media (prefers-reduced-motion: reduce) {
	.sbf-root *,
	.sbf-root *::before,
	.sbf-root *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
