/* ==========================================================================
   3RA Arrow Builder
   Structural rules only. Visual design lives in the theme (arrow-builder.css).
   ========================================================================== */

threerivers-arrow-builder,
.x-arrow-builder__dialog::backdrop {
	/* Entrances: a fast start that settles gently. Restated on the backdrop, which
	   doesn't inherit custom properties in older browsers. */
	--x-arrow-builder-ease-out: cubic-bezier(0.2, 0, 0, 1);
}

threerivers-arrow-builder {
	display: block;
	margin: auto;
	max-width: 100%;
	/* Holds a screen's worth of space before the script runs (the element is
	   empty until then), so the footer never sits in view and jumps down. */
	min-height: 100vh;
	width: var(--default-wrapper-width);

	button {

		&:not(:disabled) {
			cursor: pointer;
		}
	}
}

.t-main-content-element:has(threerivers-arrow-builder) {
	max-width: 100%;
	padding: 0;
}

html:not(.t-page-style--minimal):has(threerivers-arrow-builder) {
	/* The builder's own bar is sticky, so the theme's sticky site header steps aside.
	   --x-arrow-builder-bar-height and --x-arrow-builder-cart-bar-height are measured and set by the component. */
	--sticky-header-height: 0px;
	/* The arrow preview also sticks under the bar on mobile (its height is 0 while it isn't stuck);
	   the price / Add to Cart bar sticks to the bottom of the screen. */
	scroll-padding-bottom: calc(var(--x-arrow-builder-cart-bar-height, 0px) + var(--default-spacing-unit));
	scroll-padding-top: calc(var(--x-arrow-builder-bar-height, 0px) + var(--x-arrow-builder-preview-height, 0px) + var(--default-spacing-unit));

	@media ( min-width: 75em ) {
		/* The preview sits beside the steps and the cart bar is hidden, so only the top bar needs room. */
		scroll-padding-bottom: auto;
		scroll-padding-top: calc(var(--x-arrow-builder-bar-height, 0px) + var(--default-spacing-unit));
	}

	.t-site-header {
		/* Not sticky here, but it keeps its own layer above the builder's sticky bars (50),
		   so the mega menu and mobile menu open in front of the builder. */
		position: relative;
		z-index: 200;
	}

	.botdojo-container:not(:has(.botdojo-chat-button[ aria-label="Close chat" ])),
	[ id="google-merchantwidget-iframe-wrapper" ] {
		/* The closed BotDojo chat button and the Google Merchant Center badge drop below the
		   builder's sticky bars (50). The open chat window keeps BotDojo's own z-index (BotDojo
		   only changes the button's aria-label when it opens). Both widgets set their z-index
		   inline (the theme also forces the badge to 100 !important), so only !important wins. */
		/* stylelint-disable-next-line declaration-no-important */
		z-index: 40 !important;
	}

	@media ( max-width: 74.9375em ) {

		.botdojo-container,
		[ id="google-merchantwidget-iframe-wrapper" ] {
			/* No room for the BotDojo chat or the Google Merchant Center badge beside the builder
			   on mobile. Both set their display inline, so only !important wins. This stays a
			   max-width query: a min-width version would have to undo the !important on desktop,
			   and no stylesheet value can hand display back to the widgets' own inline styles. */
			/* stylelint-disable-next-line declaration-no-important */
			display: none !important;
		}
	}

	.t-site-footer {
		margin-top: 0;
	}
}

.x-arrow-builder [ hidden ] {
	display: none;
}

.x-arrow-builder__sr-only {
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.x-arrow-builder__body,
.x-arrow-builder__bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr);

	@media ( min-width: 75em ) {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

.x-arrow-builder__body {
	background-color: #F7F4EF;

	@media ( min-width: 75em ) {
		background-color: transparent;
	}
}

.x-arrow-builder__body,
.x-arrow-builder__sections,
.x-arrow-builder__section {
	/* An opened step scrolls flush under the sticky bar (and preview on mobile):
	   this cancels the breathing room scroll-padding-top adds for focused fields. */
	scroll-margin-top: calc(-1 * var(--default-spacing-unit));
}

.x-arrow-builder__preview {
	/* Arrow centered in the panel; on Review the specs card sits just under it and the two center together.
	   Mobile: a shorter card at the top of each step that sticks under the builder bar.
	   The 16px cream border stands in for a margin, so content scrolling underneath
	   doesn't show around the card while it's stuck. */
	align-items: center;
	background-color: #FEFEFD;
	border: 16px solid #F7F4EF;
	box-shadow: 0 1px 0 #E5DBCF;
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
	margin: 0;
	/* Tight on mobile: the zoom icon's room is inside the slides (see __slides), not here. */
	padding: 4px 16px 8px;
	position: sticky;
	top: var(--x-arrow-builder-bar-height, 0px);
	z-index: 10;

	&:has(.x-arrow-builder__specs) {
		/* On Review the specs card makes it too tall to keep on screen. Not stuck, it
		   gets more room above the arrow. */
		padding-bottom: 24px;
		padding-top: 16px;
		position: static;
	}

	@media ( min-width: 75em ) {
		/* The whole panel sticks below the builder bar and fills the rest of the screen
		   (its full-width background is set under "Full-width backgrounds" below). */
		align-self: start;
		border: 0;
		gap: 100px;
		height: calc(100vh - var(--x-arrow-builder-bar-height, 0px));
		padding: 20px;
		z-index: auto;

		&:has(.x-arrow-builder__specs) {
			/* The Review specs fit beside the steps, so the panel keeps sticking,
			   with the same padding as the other steps. */
			padding-bottom: 20px;
			padding-top: 20px;
			position: sticky;
		}
	}
}

/* Full-width backgrounds (desktop)
   The bar, the preview and the steps paint their backgrounds out to the edges
   of the screen while their content stays inside the builder (the step
   headings don't, so they read as contained tabs). A spread
   box-shadow does the painting (a border image on the bar); neither adds a
   horizontal scrollbar. On the shadows, clip-path keeps them to the element's
   own height, on the outer side only. This comes after the preview's own
   rule so its shadow replaces the mobile divider shadow. */
@media ( min-width: 75em ) {

	.x-arrow-builder__bar {
		/* A border image instead of a shadow, so the bottom border line goes out
		   with the background: the gradient's last 1px is the line (the bottom
		   slice), the rest fills the middle, and the outset widens both sideways. */
		border-image: linear-gradient(to top, #E5DBCF 1px, #F7F4EF 1px) 0 0 1 fill / 0 0 1px / 0 100vmax;
	}

	.x-arrow-builder__preview {
		box-shadow: 0 0 0 100vmax #FEFEFD;
		clip-path: inset(0 0 0 -100vmax);
	}

	.x-arrow-builder__sections {
		/* The step headings stay within the builder; only the column behind them extends. */
		box-shadow: 0 0 0 100vmax #F7F4EF;
		clip-path: inset(0 -100vmax 0 0);
	}
}

/* Arrow preview layers
   The retired builder's 1000 x 100 px canvas: every image at its own pixel
   size and position, so parts line up exactly. The component sets
   --x-arrow-builder-scale from the preview's width to shrink the whole
   canvas evenly.
   ========================================================================== */

/* Holds the preview and its zoom button. Unlike the layers it doesn't clip,
   so the zoom icon can sit outside the preview. */

.x-arrow-builder__frame {
	flex: 0 0 auto;
	max-width: 1000px;
	position: relative;
	width: 100%;
}

.x-arrow-builder__layers {
	aspect-ratio: 10 / 1;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.x-arrow-builder__canvas {
	height: 100px;
	left: 0;
	position: absolute;
	top: 0;
	transform: scale(var(--x-arrow-builder-scale, 1));
	transform-origin: 0 0;
	width: 1000px;
}

.x-arrow-builder__layer {
	height: 100px;
	position: absolute;
	top: 0;

	img {
		display: block;
	}
}

.x-arrow-builder__layer--point {
	left: 3px;
	top: 0px;
	transform: scale(0.95);
	width: 125px;
	z-index: 5;
}

.x-arrow-builder__layer--shaft {
	left: 125px;
	width: 830px;
	z-index: 5;
}

.x-arrow-builder__layer--point-collar {
	left: 123px;
	width: 34px;
	z-index: 6;
}

.x-arrow-builder__layer--cap {
	left: 602px;
	width: 350px;
	z-index: 6;
}

.x-arrow-builder__layer--cock-feather {
	left: 625px;
	width: 304px;
	z-index: 7;
}

.x-arrow-builder__layer--hen-feather1 {
	left: 625px;
	width: 304px;
	z-index: 8;
}

.x-arrow-builder__layer--hen-feather3 {
	left: 625px;
	width: 304px;
	z-index: 3;
}

.x-arrow-builder__layer--nock-collar {
	left: 934px;
	width: 16px;
	z-index: 6;
}

.x-arrow-builder__layer--nock {
	left: 950px;
	width: 50px;
	z-index: 5;
}

.x-arrow-builder__blank {
	inset: 0;
	position: absolute;

	img {
		display: block;
		height: 100%;
		object-fit: contain;
		width: 100%;
	}
}

/* Opens the preview in PhotoSwipe. Covers the whole slide; the zoom-in cursor is the cue. */

.x-arrow-builder__zoom {
	background: none;
	border: 0;
	cursor: zoom-in;
	inset: 0;
	padding: 0;
	position: absolute;
	z-index: 1;

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}
}

/* Preview slider: the arrow, then a photo of each chosen part
   The arrow stays in the page (just collapsed) while a photo shows, so the zoom and the
   picture saved with the build can still draw it. At every width the slides are a row to
   swipe through; phones and tablets show dots, and desktop shows thumbnails that scroll to a
   slide, the arrow's own thumbnail being a miniature of the preview.
   ========================================================================== */

.x-arrow-builder__gallery {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 2px;
	max-width: 1000px;
	width: 100%;

	@media ( min-width: 75em ) {
		gap: 8px;
	}
}

.x-arrow-builder__slides {
	/* The slides are a row to swipe through, each snapping into place. */
	align-items: center;
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	position: relative;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	width: 100%;

	/* A mouse drags the row (the script does it), so it can't pick up the images or select text. */
	@media ( hover: hover ) {
		cursor: grab;
	}

	&::-webkit-scrollbar {
		display: none;
	}

	img {
		-webkit-user-drag: none;
		user-select: none;
	}

	/* While dragging, and while it slides into place afterward, snapping is off so the browser doesn't fight the drag. */

	&.is-dragging {
		cursor: grabbing;
		scroll-snap-type: none;
		user-select: none;
	}
}

.x-arrow-builder__slide {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: center;
	scroll-snap-stop: always;
}

.x-arrow-builder__slide--part {
	--x-arrow-builder-part-height: 56px;

	align-items: center;
	display: flex;
	height: 56px;
	justify-content: center;
	position: relative;

	@media ( min-width: 75em ) {
		--x-arrow-builder-part-height: 280px;

		height: 280px;
	}
}

/* A chosen insert's product photo, fitted inside the slide at its own proportions. */

.x-arrow-builder__slide-image {
	display: block;
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
}

/* One part of the arrow on its own: a strip of the 1000 x 100 canvas, centered, as wide as the slide's height allows but never past its natural size (the canvas is 100px tall) or the slide. */

.x-arrow-builder__part {
	aspect-ratio: var(--x-arrow-builder-part-ratio);
	display: block;
	/* The layers' z-indexes stay inside the part, so the zoom button over it isn't covered. */
	isolation: isolate;
	max-width: 100%;
	position: relative;
	width: min(calc(var(--x-arrow-builder-part-ratio) * var(--x-arrow-builder-part-height, 100px)), calc(var(--x-arrow-builder-part-ratio) * 100px));
}

.x-arrow-builder__part-layer {
	display: block;
	height: 100%;
	position: absolute;
	top: 0;

	img {
		display: block;
		height: auto;
		width: 100%;
	}
}

.x-arrow-builder__gallery-nav {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 0;

	@media ( min-width: 75em ) {
		gap: 12px;
	}
}

.x-arrow-builder__dots {
	display: flex;
	gap: 2px;

	@media ( min-width: 75em ) {
		display: none;
	}
}

.x-arrow-builder__dot {
	/* A 24px target around a 10px dot. */
	background: none;
	border: 0;
	cursor: pointer;
	height: 24px;
	padding: 0;
	width: 24px;

	&:before {
		background-color: #E5DBCF;
		border-radius: 50%;
		content: "";
		display: block;
		height: 10px;
		margin: 7px;
		transition: background-color 0.15s ease;
		width: 10px;

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}

	&.is-active:before {
		background-color: #F8C364;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 0;
	}
}

.x-arrow-builder__thumbs {
	display: none;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;

	@media ( min-width: 75em ) {
		display: flex;
	}
}

.x-arrow-builder__thumb {
	align-items: center;
	background-color: #FEFEFD;
	border: 1px solid #EFE8DF;
	border-radius: 4px;
	box-sizing: border-box;
	color: #000;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	font-size: 13px;
	/* Every thumbnail is the same size, however wide its part is. */
	gap: 4px;
	height: 76px;
	justify-content: center;
	padding: 4px 4px 6px;
	width: 99px;

	.x-arrow-builder__thumb-part {
		--x-arrow-builder-part-height: 44px;

		align-items: center;
		display: flex;
		height: 44px;
		justify-content: center;
		width: 100%;

		img {
			display: block;
			max-height: 100%;
			max-width: 100%;
			object-fit: contain;
		}
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	&:hover {
		border-color: #F8C364;
	}

	&.is-active {
		background-color: #FEF6E7;
		border-color: #F8C364;
		outline: 1px solid #F8C364;

		.x-arrow-builder__thumb-label {
			color: #000;
			font-weight: 700;
		}
	}
}

/* The arrow's thumbnail is the preview itself, shrunk: the 1000 x 100 canvas scaled to the 89px of room inside a 99px thumbnail. */

.x-arrow-builder__thumb-arrow {
	display: block;
	height: 44px;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.x-arrow-builder__thumb-canvas {
	height: 100px;
	left: 0;
	position: absolute;
	top: calc(50% - 4.45px);
	transform: scale(0.089);
	transform-origin: 0 0;
	width: 1000px;
}

/* Review step: why Add to Cart is still off (the Inserts / Points step hasn't been opened)
   ========================================================================== */

.x-arrow-builder__cart-note {
	background: none;
	border: 0;
	color: #474A3E;
	cursor: pointer;
	display: block;
	font-family: inherit;
	font-size: 13px;
	margin: 16px 0 0;
	padding: 0;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 3px;

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}
}

/* FOC / Total Weight / Dynamic Spine card (Review step)
   ========================================================================== */

.x-arrow-builder__specs {
	background-color: #F7F4EF;
	border-radius: 4px;
	display: grid;
	flex: 0 0 auto;
	/* Stacked rows on mobile, so the labels don't wrap in narrow columns. */
	grid-template-columns: minmax(0, 1fr);
	margin: 0;
	max-width: 620px;
	padding: 4px 0;
	width: 100%;

	@media ( min-width: 75em ) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		padding: 16px 0;
	}

	> div {
		/* One row per spec on mobile: label on the left, value on the right. */
		align-items: center;
		display: flex;
		flex-direction: row;
		gap: 12px;
		justify-content: space-between;
		padding: 10px 16px;

		@media ( min-width: 75em ) {
			/* Value shows above its label; the markup keeps label-then-value for screen readers. */
			align-items: normal;
			flex-direction: column-reverse;
			gap: 4px;
			justify-content: flex-end;
			padding: 0 24px;
		}
	}

	> div + div {
		border-top: 1px solid #E5DBCF;

		@media ( min-width: 75em ) {
			border-left: 1px solid #E5DBCF;
			border-top: 0;
		}
	}

	dt {
		color: #474A3E;
		font-size: 12px;
		font-weight: 500;
	}

	dd {
		color: #292929;
		font-size: 15px;
		font-weight: 700;
		line-height: 1.2;
		margin: 0;

		@media ( min-width: 75em ) {
			font-size: 20px;
			font-weight: 400;
		}
	}
}

.x-arrow-builder__specs-card {
	/* The specs and the "estimates" note under them, as one item in the preview. */
	display: grid;
	flex: 0 0 auto;
	gap: 8px;
	max-width: 620px;
	width: 100%;
}

.x-arrow-builder__specs-note {
	color: #5E6164;
	font-size: 12px;
	line-height: 1.4;
	margin: 0;
	text-align: center;
}

.x-arrow-builder__section-toggle[ aria-disabled="true" ],
.x-arrow-builder__step[ aria-disabled="true" ] {
	cursor: not-allowed;
}

.x-arrow-builder__dialog::backdrop {
	background: rgb(0 0 0 / 50%);
}

/* Dialogs (Clear Arrow Builder, Add to Cart)
   ========================================================================== */

.x-arrow-builder__dialog {
	background-color: #FEFEFD;
	border: 0;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgb(0 0 0 / 20%);
	color: #292929;
	max-width: min(540px, calc(100vw - 32px));
	padding: 40px 32px 32px;
	text-align: center;

	@media ( min-width: 40em ) {
		padding: 44px 48px 36px;
	}
}

.x-arrow-builder__dialog-close-form {
	position: absolute;
	right: 16px;
	top: 16px;
}

.x-arrow-builder__dialog-close {
	background-color: #FEFEFD;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'%3E%3Cpath d='M1 1l6 6M7 1 1 7' stroke='%23292929' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid #8A8D80;
	border-radius: 50%;
	cursor: pointer;
	height: 28px;
	padding: 0;
	transition: border-color 0.15s ease;
	width: 28px;

	&:hover {
		border-color: #292929;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}
}

.x-arrow-builder__dialog-title {
	color: #121212;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 16px;

	@media ( min-width: 40em ) {
		font-size: 32px;
	}
}

.x-arrow-builder__dialog-body {
	font-size: 15px;
	line-height: 1.6;

	strong {
		display: block;
		font-weight: 700;
	}
}

.x-arrow-builder__dialog .x-arrow-builder__dialog-spinner {
	/* The loading screen's spinner (.x-arrow-builder__spinner), centered under the title while adding. */
	margin: 0 auto 16px;
}

.x-arrow-builder__dialog-fun {
	/* Room for the longest line, so the dialog doesn't jump as the lines change. */
	min-height: 1.6em;
}

.x-arrow-builder__dialog .x-arrow-builder__dialog-progress {
	/* The bar itself is styled by .x-arrow-builder__progress (shared with the loading screen). */
	margin: 8px auto 0;
	max-width: 22rem;
}

.x-arrow-builder__dialog-percent,
.x-arrow-builder__loading-count {
	/* "45% complete" in the cart dialog and "45% loaded" on the loading screen. */
	color: #292929;
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0 4px;
}

.x-arrow-builder__dialog-actions {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 24px;

	form {
		margin-bottom: 0;
	}
}

.x-arrow-builder__dialog-primary {
	background-color: #F8C364;
	border: 1px solid #F8C364;
	border-radius: 999px;
	color: #292929;
	cursor: pointer;
	display: inline-block;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 48px;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, scale 0.1s ease;

	&:hover {
		background-color: #F5B23F;
		border-color: #F5B23F;
	}

	&:active {
		scale: 0.97;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

.x-arrow-builder__dialog-secondary {
	background: none;
	border: 0;
	color: #292929;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	/* A roomier tap target than the text alone. */
	padding: 8px;
	text-decoration-line: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;

	&:hover {
		color: #4D5A31;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

/* Loading / load error
   ========================================================================== */

.x-arrow-builder__loading {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	justify-content: center;
	/* A full screen while products load, so the footer doesn't jump up into view. */
	min-height: 100vh;
	padding: 2rem 1rem;
	text-align: center;
}

.x-arrow-builder__spinner {
	animation: x-arrow-builder-spin 0.9s linear infinite;
	border: 0.25rem solid currentcolor;
	border-radius: 50%;
	border-right-color: transparent;
	display: block;
	height: 2.5rem;
	opacity: 0.6;
	width: 2.5rem;

	@media ( prefers-reduced-motion: reduce ) {
		animation: none;
	}
}

.x-arrow-builder__progress {
	/* Loading screen and Add to Cart progress: a rounded brand-yellow bar on a cream track. */
	appearance: none;
	background-color: #EFE8DF;
	border: 0;
	border-radius: 999px;
	color: #F8C364;
	display: block;
	height: 10px;
	max-width: 20rem;
	overflow: hidden;
	width: 100%;

	&::-webkit-progress-bar {
		background-color: #EFE8DF;
		border-radius: 999px;
	}

	&::-webkit-progress-value {
		background-color: #F8C364;
		border-radius: 999px;
		transition: width 0.3s ease;
	}

	&::-moz-progress-bar {
		background-color: #F8C364;
		border-radius: 999px;
	}

	&:not([ value ]) {
		/* Before the total is known (the first product page): a yellow band slides across the track. */
		animation: x-arrow-builder-indeterminate 1.4s ease-in-out infinite;
		background-image: linear-gradient(90deg, #F8C364, #F8C364);
		background-repeat: no-repeat;
		background-size: 35% 100%;
	}

	&:not([ value ])::-webkit-progress-bar {
		background-color: transparent;
	}

	&:not([ value ])::-moz-progress-bar {
		background-color: transparent;
	}

	@media ( prefers-reduced-motion: reduce ) {
		animation: none;

		&::-webkit-progress-value {
			transition: none;
		}

		&:not([ value ]) {
			/* No sliding: the band sits still in the middle of the track. */
			animation: none;
			background-position: center;
		}
	}

	@media ( forced-colors: active ) {
		/* Keep the system's own progress bar so it stays visible in high contrast. */
		appearance: auto;
	}
}

@keyframes x-arrow-builder-indeterminate {

	from {
		background-position: -40% 0;
	}

	to {
		background-position: 140% 0;
	}
}

@keyframes x-arrow-builder-spin {

	to {
		transform: rotate(360deg);
	}
}

/* Subtotal, Clear and Add to Cart: in the top bar on desktop, in the bottom
   bar (.x-arrow-builder__cart-bar) on mobile. */

.x-arrow-builder__bar,
.x-arrow-builder__cart-bar {

	.x-arrow-builder__total-ctas {
		align-items: center;
		border-right: 1px solid #E5DBCF;
		display: flex;
		flex-grow: 1;
		height: 100%;
		justify-content: space-between;
		padding: var(--inner-padding);
	}

	.x-arrow-builder__total {
		align-items: center;
		display: flex;
		flex-grow: 1;
		gap: 8px;
		height: 100%;
	}

	.x-arrow-builder__pricing {
		color: #292929;
		font-size: 20px;
		line-height: 34px; /* 170% */
	}

	.x-arrow-builder__add-to-cart {
		/* Overrides the theme's mm-theme-button-primary look for the bar's pill button. */
		background-color: #F8C364;
		border: 2px solid #F8C364;
		border-radius: 999px;
		color: #292929;
		cursor: pointer;
		flex-shrink: 0;
		font-family: inherit;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.2;
		min-width: 9.5rem;
		padding: 12px 32px;
		transition: color 150ms ease-in-out, background-color 150ms ease-in-out, border-color 150ms ease-in-out, box-shadow 150ms ease-in-out, text-decoration 150ms ease-in-out, scale 100ms ease;

		&:hover:not(:disabled) {
			background-color: transparent;
			border-color: #F8C364;
			color: #111111;
		}

		&:active:not(:disabled) {
			scale: 0.97;
		}

		&:focus-visible {
			outline: 2px solid #4D5A31;
			outline-offset: 2px;
		}

		&:disabled {
			background-color: #EFE8DF;
			border-color: #EFE8DF;
			color: #A19F94;
			cursor: not-allowed;
		}

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}
}

/* Top Bar */

.x-arrow-builder__bar {
	--inner-padding-v: 12px;
	--inner-padding-h: 32px;
	--inner-padding: var(--inner-padding-v) var(--inner-padding-h);
	background-color: #F7F4EF;
	border-bottom: 1px solid #E5DBCF;
	color: #5E5E5E;
	/* Mobile: title + contact on the first row, the step tabs under them. */
	grid-template-areas: "title contact" "steps steps";
	grid-template-columns: auto minmax(0, 1fr);
	/* Sticky only while the builder is on screen (its parent is the builder). */
	position: sticky;
	top: 0;
	/* Above the builder's own content (preview layers go up to 8) and the lowered chat / badge,
	   but below the theme's menus and overlays (100 and up). */
	z-index: 50;

	@media ( min-width: 75em ) {
		/* Restated: this rule comes after the shared two-column rule, so it would otherwise win there too. */
		grid-template-areas: none;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.x-arrow-builder__bar-left,
	.x-arrow-builder__bar-right {
		/* Mobile: their children become cells of the bar's grid. */
		display: contents;

		@media ( min-width: 75em ) {
			align-items: center;
			display: flex;
		}
	}

	.x-arrow-builder__bar-left {
		border-right: 1px solid #E5DBCF;
	}

	.x-arrow-builder__title {
		border-right: 1px solid #E5DBCF;
		display: flex;
		flex-flow: column;
		flex-shrink: 0;
		gap: 2px;
		grid-area: title;
		height: 100%;
		justify-content: center;
		padding: 12px 16px;

		@media ( min-width: 75em ) {
			justify-content: normal;
			padding: var(--inner-padding);
		}
	}

	.x-arrow-builder__eyebrow {
		display: none;
		font-size: 11px;
		font-weight: 700;
		line-height: normal;
		text-transform: uppercase;

		@media ( min-width: 75em ) {
			display: block;
		}
	}

	.x-arrow-builder__heading {
		color: #121212;
		font-size: 16px;
		font-weight: 600;
		line-height: 24px;
		margin-bottom: 0;

		@media ( min-width: 75em ) {
			font-size: 18px;
			line-height: 28px;
		}
	}

	.x-arrow-builder__contact {
		align-self: center;
		/* Phone icon beside the title; both lines start after it. */
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M9.18125 9.75C8.05278 9.75 6.93785 9.50399 5.83646 9.01198C4.73507 8.51997 3.73299 7.82257 2.83021 6.91979C1.92743 6.01701 1.23003 5.01493 0.738021 3.91354C0.246007 2.81215 0 1.69722 0 0.56875C0 0.40625 0.0541667 0.270833 0.1625 0.1625C0.270833 0.0541667 0.40625 0 0.56875 0H2.7625C2.88889 0 3.00174 0.0428819 3.10104 0.128646C3.20035 0.21441 3.25903 0.315972 3.27708 0.433333L3.62917 2.32917C3.64722 2.47361 3.64271 2.59549 3.61563 2.69479C3.58854 2.7941 3.53889 2.87986 3.46667 2.95208L2.15313 4.27917C2.33368 4.61319 2.54809 4.93594 2.79635 5.2474C3.04462 5.55885 3.31771 5.85903 3.61563 6.14792C3.89549 6.42778 4.18889 6.68733 4.49583 6.92656C4.80278 7.1658 5.12778 7.38472 5.47083 7.58333L6.74375 6.31042C6.825 6.22917 6.93108 6.16823 7.06198 6.1276C7.19288 6.08698 7.32153 6.07569 7.44792 6.09375L9.31667 6.47292C9.44306 6.50903 9.54688 6.57448 9.62813 6.66927C9.70938 6.76406 9.75 6.87014 9.75 6.9875V9.18125C9.75 9.34375 9.69583 9.47917 9.5875 9.5875C9.47917 9.69583 9.34375 9.75 9.18125 9.75ZM1.63854 3.25L2.53229 2.35625L2.30208 1.08333H1.09687C1.14201 1.45347 1.20521 1.8191 1.28646 2.18021C1.36771 2.54132 1.48507 2.89792 1.63854 3.25ZM6.48646 8.09792C6.83854 8.25139 7.1974 8.37326 7.56302 8.46354C7.92865 8.55382 8.29653 8.6125 8.66667 8.63958V7.44792L7.39375 7.19063L6.48646 8.09792Z' fill='%233A4225'/%3E%3C/svg%3E");
		background-position: 16px 11px;
		background-repeat: no-repeat;
		color: #474A3E;
		flex-shrink: 0;
		font-size: 11px;
		grid-area: contact;
		line-height: 16px;
		min-width: 0;
		padding: 8px 12px 8px 31px;

		a {
			color: #292929;
			text-decoration-line: underline;
			text-underline-offset: 2px;
			white-space: nowrap;
		}

		@media ( min-width: 75em ) {
			align-self: auto;
			background-position: var(--inner-padding-h) calc(var(--inner-padding-v) + 3px);
			min-width: auto;
			padding: var(--inner-padding);
			padding-left: calc(var(--inner-padding-h) + 15px);
		}
	}

	.x-arrow-builder__contact-title {
		color: #121212;
		font-size: 12px;
		font-weight: 600;
	}

	.x-arrow-builder__total-ctas {
		/* The bottom bar's copy is shown on mobile. */
		display: none;

		@media ( min-width: 75em ) {
			display: flex;
		}
	}
}

.x-arrow-builder__steps {
	background-color: #FAF8F5;
	border-top: 1px solid #E5DBCF;
	flex-grow: 1;
	grid-area: steps;
	overflow-x: auto;
	padding: 0 16px;
	scrollbar-width: none;

	@media ( min-width: 75em ) {
		background-color: transparent;
		border-top: 0;
		overflow-x: visible;
		padding: var(--inner-padding);
		scrollbar-width: auto;
	}

	ol {
		display: flex;
		flex-wrap: nowrap;
		gap: 16px;
		justify-content: space-between;
		list-style: none;
		margin: 0;
		padding: 0;

		@media ( min-width: 75em ) {
			flex-wrap: wrap;
			gap: 0;
		}
	}
}

.x-arrow-builder__step {
	background: none;
	border: 0;
	color: #737966;
	cursor: pointer;
	font-size: 12px;
	font-style: normal;
	font-weight: 500;
	line-height: 22px; /* 157.143% */
	/* Mobile: the active underline sits on the bar's bottom edge. */
	padding: 10px 0;
	position: relative;
	transition: color 0.15s ease;
	white-space: nowrap;

	@media ( min-width: 75em ) {
		font-size: 14px;
		padding: 0;
		white-space: normal;
	}

	&:before {
		/* An invisible bold copy of the label (data-label) sets the width, so the
		   tabs don't shift when the active one turns bold. The "/ ''" alt text keeps
		   screen readers from reading it; browsers without that syntax use the line above. */
		content: attr(data-label);
		content: attr(data-label) / "";
		display: block;
		font-weight: 600;
		height: 0;
		overflow: hidden;
		pointer-events: none;
		visibility: hidden;
	}

	&:after {
		/* The underline grows out from the middle of the step being opened. */
		background-color: #F8C364;
		bottom: 0;
		content: "";
		height: 2px;
		left: 0;
		opacity: 0;
		position: absolute;
		scale: 0 1;
		transition: opacity 0.2s ease, scale 0.2s ease;
		width: 100%;
	}

	&.is-active {
		color: #292929;
		font-weight: 600;

		&:after {
			opacity: 1;
			scale: 1;
		}

	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;

		&:after {
			transition: none;
		}
	}
}

.x-arrow-builder__row {
	margin-bottom: 20px;
	
	&:not(:last-child) {
		border-bottom: 1px solid #E5DBCF;
		padding-bottom: 20px;
	}
}

.x-arrow-builder__clear {
	background: none;
	border: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 20px; /* 166.667% */
	padding: 0;
	text-decoration-line: underline;
	text-decoration-skip-ink: auto;
	text-decoration-style: solid;
	/* 1px rather than auto, so the underline can thicken on hover (auto can't transition). */
	text-decoration-thickness: 1px;
	text-underline-offset: auto;
	text-underline-position: from-font;
	transition: text-decoration-thickness 0.15s ease;

	&:hover:not(:disabled) {
		text-decoration-thickness: 2px;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

.x-arrow-builder__row-title-group {
	align-items: center;
	display: flex;
	gap: 4px;
	margin-bottom: 8px;
}

.x-arrow-builder__row-title {
	color: #474A3E;
	display: block;
	font-size: 13px;
	font-weight: 600;
	line-height: 21px; /* 161.538% */
	overflow: unset;
	position: static;
	white-space: normal;
	width: auto;
}

.x-arrow-builder__error {
	color: #B13138;
	display: inline-flex;
	font-size: 13px;
	font-weight: 600;
	gap: 4px;
	line-height: 21px; /* 161.538% */

	.u-icon-warning {
		position: relative;
		top: 3px;
	}
}

/* Why an option the shopper clicked isn't available: where the error goes, as a notice rather than an error. */

.x-arrow-builder__row-title-group:has(.x-arrow-builder__notice) {
	flex-wrap: wrap;
}

.x-arrow-builder__notice {
	color: #474A3E;
	display: flex;
	flex-basis: 100%;
	font-size: 13px;
	gap: 4px;
	line-height: 21px;

	.u-icon-warning {
		color: #C98A1B;
		flex: none;
		position: relative;
		top: 3px;
	}
}

.x-arrow-builder__help-toggle {
	/* The icon draws at 16px; the button stays 24px to meet the WCAG 2.2 minimum target size. */
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8C0.5 3.85786 3.85786 0.5 8 0.5C12.1421 0.5 15.5 3.85786 15.5 8Z' fill='%23FEFEFD' stroke='%23EFE8DF'/%3E%3Cpath d='M6 12V11.0581H7.4375V7.42176H6.0625V6.47988H8.6875V11.0581H10V12H6ZM7.9875 5.49031C7.7625 5.49031 7.57083 5.41878 7.4125 5.27571C7.2625 5.12469 7.1875 4.94983 7.1875 4.75112C7.1875 4.53651 7.2625 4.35767 7.4125 4.2146C7.5625 4.07153 7.75417 4 7.9875 4C8.20417 4 8.39167 4.07551 8.55 4.22653C8.71667 4.37755 8.8 4.55241 8.8 4.75112C8.8 4.94983 8.71667 5.12469 8.55 5.27571C8.39167 5.41878 8.20417 5.49031 7.9875 5.49031Z' fill='%233A4225'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 16px 16px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	display: inline-block;
	flex-shrink: 0;
	height: 24px;
	padding: 0;
	transition: background-color 0.15s ease;
	vertical-align: middle;
	width: 24px;

	&:hover {
		background-color: #EFE8DF;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 0;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

.x-arrow-builder__help {
	background-color: #EFE8DF;
	border-radius: 4px;
	color: #474A3E;
	font-size: 12px;
	font-weight: 400;
	line-height: 22px; /* 183.333% */
	margin-bottom: 8px;
	padding: 18px 36px 18px 18px;
	position: relative;

	@media ( min-width: 75em ) {
		padding: 18px 30px 18px 18px;
	}

	.x-arrow-builder__help-content {

		p:last-child {
			margin-bottom: 0;
		}
	}

	.x-arrow-builder__help-close {
		background-color: #FAF8F5;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6' fill='none'%3E%3Cpath d='M5.29584 0L2.99962 2.29621L0.704912 0L0.000749494 0.704162L2.29621 2.99962L0 5.29584L0.704162 6L2.99962 3.70454L5.29584 5.99925L6 5.29509L3.70454 2.99962L5.99925 0.704912L5.29584 0Z' fill='%235E6164'/%3E%3C/svg%3E");
		background-position: center;
		background-repeat: no-repeat;
		/* 24px: the WCAG 2.2 minimum target size, like the help toggle. */
		border: 0;
		border-radius: 100%;
		cursor: pointer;
		height: 24px;
		padding: 0;
		position: absolute;
		right: 6px;
		top: 6px;
		transition: background-color 0.15s ease;
		width: 24px;

		@media ( min-width: 75em ) {
			height: 16px;
			width: 16px;
		}

		&:hover {
			background-color: #FEFEFD;
		}

		&:focus-visible {
			outline: 2px solid #4D5A31;
			outline-offset: 0;
		}

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}
}

.x-arrow-builder__sections {
	/* Mobile: the divider above is the preview's shadow, so it stays visible while the preview is stuck. */
	--inner-padding-v: 24px;
	--inner-padding-h: 16px;
	--inner-padding: var(--inner-padding-v) var(--inner-padding-h);
	background-color: #F7F4EF;
	display: flex;
	flex-flow: column;
	gap: 1px 0;

	@media ( min-width: 75em ) {
		--inner-padding-h: 48px;
	}
}

.x-arrow-builder__section:not(.is-open) {
	/* The step tabs replace the accordion on mobile. */
	display: none;

	@media ( min-width: 75em ) {
		display: block;
	}
}

.x-arrow-builder__section-heading {
	display: none;
	margin-bottom: 0;

	@media ( min-width: 75em ) {
		display: block;
	}

	.x-arrow-builder__section-toggle {
		background-color: #EFE8DF;
		border: 0;
		color: #2F312A;
		display: flex;
		font-size: 16px;
		font-weight: 700;
		justify-content: space-between;
		line-height: 26px; /* 162.5% */
		padding: 18px var(--inner-padding-h);
		position: relative;
		transition: background-color 0.15s ease;
		width: 100%;

		&:not([ aria-disabled="true" ]) {
			cursor: pointer;
		}

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}

		&:after {
			align-self: center;
			background-color: #FAF8F5;
			background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M4.25 5.75H0V4.25H4.25V0H5.75V4.25H10V5.75H5.75V10H4.25V5.75Z' fill='%234D5A31'/%3E%3C/svg%3E");
			background-position: center;
			background-repeat: no-repeat;
			border-radius: 100%;
			content: "";
			display: block;
			flex-shrink: 0;
			height: 24px;
			transition: background-color 0.15s ease, transform 0.2s ease;
			width: 24px;

			@media ( prefers-reduced-motion: reduce ) {
				transition: none;
			}
		}

		&:not([ aria-disabled="true" ]):hover {
			/* The bar darkens a shade and the circle brightens, in the builder's neutrals. */
			background-color: #E5DBCF;

			&:after {
				background-color: #FEFEFD;
			}
		}

		&[ aria-expanded="true" ] {

			&:after {
				/* 12px canvas (path shifted 0.5px) so the 11px minus centers on a whole pixel.
				   The half turn spins the plus into the minus (the minus looks the same turned over). */
				background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='2' viewBox='-0.5 0 12 2' fill='none'%3E%3Cpath d='M4.63636 1.63636H0V0H4.63636H6.27273H10.9091V1.63636H6.27273H4.63636Z' fill='%234D5A31'/%3E%3C/svg%3E");
				transform: rotate(180deg);
			}
		}
	}
}

.x-arrow-builder__panel {
	color: #474A3E;
	padding: var(--inner-padding);
}

.x-arrow-builder__panel-heading {
	/* On mobile the toggles are hidden, so this keeps a heading per step for screen readers. */
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;

	@media ( min-width: 75em ) {
		/* The accordion toggle is the step's heading on desktop. */
		display: none;
	}
}

.x-arrow-builder__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;

	@media ( max-width: 74.9375em ) {

		.x-arrow-builder__choices:not([ data-row="fletchStyle" ], [ data-row="fletchShape" ], [ data-row="fletchWing" ], [ data-row="fletchLength" ]) & {
			/* Stacked in one column (Brand too: one across on mobile). Fletch Style (two short choices) stays side by side, like the wing pill and length circles;
			   Feather Shape sits three across (its own rule below).
			   This stays a max-width query: its broad selector also reaches the radio-list rows, which stack
			   on desktop too, so a min-width "undo" would fight their own rules. */
			flex-direction: column;
			flex-wrap: nowrap;

			.x-arrow-builder__option {
				flex: none;
			}
		}
	}
}

.x-arrow-builder__option {
	background: #FEFEFD;
	border: 1px solid #EFE8DF;
	border-radius: 4px;
	color: #474A3E;
	flex: 1 1 0;
	font-size: 13px;
	font-weight: 500;
	line-height: normal;
	min-width: 7rem;
	outline: 1px solid transparent;
	position: relative;
	text-align: center;
	/* outline-offset: the Feather Length ring eases out from the circle when picked.
	   scale: the box presses in while it's held. */
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, outline-color 0.15s ease, outline-offset 0.15s ease, scale 0.1s ease;

	input {
		/* The radio stays in the page for keyboard and screen-reader use; the box is the visual. */
		border: 0;
		clip: rect(0 0 0 0);
		height: 1px;
		margin: 0;
		overflow: hidden;
		padding: 0;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}

	.x-arrow-builder__option-label {
		/* Padding lives on the label so the whole box selects the option. */
		cursor: pointer;
		display: block;
		padding: 15px 8px;
	}

	&:hover:not(.is-selected, :has(input:disabled)),
	&:not(.is-selected):has(input:focus-visible) {
		background-color: #FFFBF3;
		border-color: #F8C364;
	}

	&:has(input:focus-visible) {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	&:active:not(:has(input:disabled)) {
		scale: 0.98;
	}

	&.is-selected {
		background-color: #FEF6E7;
		border-color: #F8C364;
		color: #292929;
		font-weight: 600;
		outline: 1px solid #F8C364;

		&:after {
			background-color: #F8C364;
			background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4.2 3.6 6.8 9 1.2' stroke='%23292929' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
			background-position: center;
			background-repeat: no-repeat;
			border: 2px solid #FAF8F5;
			border-radius: 100%;
			content: "";
			height: 20px;
			pointer-events: none;
			position: absolute;
			right: -8px;
			top: -8px;
			width: 20px;
		}
	}

	&:has(input:disabled) {
		opacity: 0.55;

		.x-arrow-builder__option-label {
			cursor: not-allowed;
		}
	}

	@media ( forced-colors: active ) {

		&.is-selected {
			outline: 2px solid highlight;
		}
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

/* Feather Shape: three across on mobile
   A grid, so the columns stay equal (the flex boxes' 7rem minimum would wrap
   them onto more rows on a phone); long names wrap inside their box. Desktop
   keeps the shared flex row. Any number of options wraps onto further rows of three.
   ========================================================================== */

.x-arrow-builder__choices[ data-row="fletchShape" ] .x-arrow-builder__options {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));

	@media ( min-width: 75em ) {
		display: flex;
	}

	/* No 7rem minimum on desktop either: it could push a narrow row down to two across. */
	.x-arrow-builder__option {
		min-width: 0;
	}
}

/* Feather Shape: one third of the row per option (a quarter with more than three, on desktop)
   A lone option keeps the width it has when three are shown, instead of stretching across the row.
   Applies to the flex row; on mobile Shape is a grid, which ignores flex.
   ========================================================================== */

.x-arrow-builder__choices[ data-row="fletchShape" ] {

	.x-arrow-builder__option {
		flex: 0 0 calc(( 100% - 16px ) / 3);
	}

	/* Desktop: four across when there are more than three. Mobile keeps its three-column grid. */
	@media ( min-width: 75em ) {

		.x-arrow-builder__options:has(.x-arrow-builder__option:nth-child(4)) .x-arrow-builder__option {
			flex-basis: calc(( 100% - 24px ) / 4);
		}
	}
}

/* Brand: one across on mobile (the shared stacked column); on desktop three across, or four with more than three
   A lone option keeps the width it has when three are shown. No 7rem minimum, so a narrow row can't drop to fewer across.
   ========================================================================== */

@media ( min-width: 75em ) {

	.x-arrow-builder__choices[ data-row="fletchBrand" ] .x-arrow-builder__option {
		flex: 0 0 calc(( 100% - 16px ) / 3);
		min-width: 0;
	}

	.x-arrow-builder__choices[ data-row="fletchBrand" ] .x-arrow-builder__options:has(.x-arrow-builder__option:nth-child(4)) .x-arrow-builder__option {
		flex-basis: calc(( 100% - 24px ) / 4);
	}
}

/* Wing Side: one pill, the selected half filled
   ========================================================================== */

.x-arrow-builder__row[ data-row="fletchWing" ] {

	.x-arrow-builder__options {
		background-color: #FEFEFD;
		border: 1px solid #EFE8DF;
		border-radius: 999px;
		flex-wrap: nowrap;
		gap: 0;
		padding: 2px;
	}

	.x-arrow-builder__option {
		background-color: transparent;
		border: 0;
		border-radius: 999px;
		/* Each side is half the pill, so a lone side doesn't fill it. */
		flex: 0 0 50%;
		min-width: 0;

		.x-arrow-builder__option-label {
			padding: 12px 8px;
		}

		&:hover:not(.is-selected, :has(input:disabled)),
		&:not(.is-selected):has(input:focus-visible) {
			background-color: #FDEFD3;
		}

		&.is-selected {
			background-color: #F8C364;

			&:after {
				content: none;
			}
		}
	}
}

/* Feather Length: round buttons
   ========================================================================== */

.x-arrow-builder__row[ data-row="fletchLength" ] {

	.x-arrow-builder__option {
		border-radius: 50%;
		flex: 0 0 48px;
		font-size: 12px;
		font-weight: 600;
		height: 48px;
		min-width: 0;
		/* One ring that moves instead of the border and the ring swapping: it's always 2px
		   (transparent until hover), so only its color and offset animate. Hover shows it
		   faintly against the circle; picking pushes it out and makes it solid. */
		outline-width: 2px;
		transition: background-color 0.15s ease, outline-color 0.2s var(--x-arrow-builder-ease-out), outline-offset 0.2s var(--x-arrow-builder-ease-out), scale 0.1s ease;

		&:hover:not(.is-selected, :has(input:disabled), :has(input:focus-visible)) {
			border-color: #EFE8DF;
			outline-color: rgb(248 195 100 / 50%);
		}

		@media ( prefers-reduced-motion: reduce ) {
			/* Restated: this rule outranks the shared option rule's reduced-motion reset. */
			transition: none;
		}

		.x-arrow-builder__option-label {
			align-items: center;
			border-radius: 50%;
			display: flex;
			height: 100%;
			justify-content: center;
			padding: 0;
		}

		&.is-selected {
			/* The circle keeps its light border; a yellow ring sits just outside it. */
			background-color: #FEFEFD;
			border-color: #EFE8DF;
			outline: 2px solid #F8C364;
			outline-offset: 2px;

			&:after {
				content: none;
			}

			&:has(input:focus-visible) {
				/* The ring takes the focus color, so keyboard focus still shows on the selected length. */
				outline-color: #4D5A31;
			}
		}
	}
}

/* Price not available yet: blurred placeholder (hidden from screen readers in the markup)
   ========================================================================== */

.x-arrow-builder__option-detail--pending {
	filter: blur(4px);
	pointer-events: none;
	user-select: none;

	@media ( forced-colors: active ) {
		visibility: hidden;
	}
}

/* Fletch Service: radio cards (circle, title, price)
   ========================================================================== */

.x-arrow-builder__row[ data-row="fletchService" ] {

	.x-arrow-builder__option {
		text-align: left;

		.x-arrow-builder__option-label {
			align-items: center;
			column-gap: 10px;
			display: grid;
			/* Mobile: one line, circle, name, price on the right. */
			grid-template-columns: 18px minmax(0, 1fr) auto;
			padding: 14px 16px;
			row-gap: 2px;

			@media ( min-width: 75em ) {
				/* Price under the name, beside the circle. */
				grid-template-columns: 18px minmax(0, 1fr);
			}

			&:before {
				/* The same radio as the Nock list: the dot is always drawn but sized 0, and picking
				   the option grows it from the center. Selected it's 8px (an even size in the 16px
				   inside, so it centers on whole pixels) and the ring turns yellow. */
				align-self: center;
				background-color: #FEFEFD;
				background-image: radial-gradient(circle closest-side, #3A4225 80%, transparent 90%);
				background-position: center;
				background-repeat: no-repeat;
				background-size: 0 0;
				border: 1px solid #A5A495;
				border-radius: 50%;
				box-sizing: border-box;
				content: "";
				height: 18px;
				transition: background-size 0.15s ease, border-color 0.15s ease;
				width: 18px;

				@media ( prefers-reduced-motion: reduce ) {
					transition: none;
				}

				@media ( min-width: 75em ) {
					align-self: start;
					grid-row: span 2;
				}
			}
		}

		.x-arrow-builder__option-text {
			color: #292929;
			font-weight: 500;
		}

		.x-arrow-builder__option-detail {
			color: #474A3E;
			font-weight: 400;
		}

		&.is-selected {

			&:after {
				content: none;
			}

			.x-arrow-builder__option-label:before {
				background-size: 8px 8px;
				border-color: #F8C364;
			}

			.x-arrow-builder__option-detail {
				color: #292929;
				font-weight: 700;
			}
		}
	}
}

/* Toggle rows (Uni-Bushing, Nock Collar, Field Points, Point Collar, Weight Tubes)
   ========================================================================== */

.x-arrow-builder__switch {
	/* Mobile: image, title and toggle line up along the top; the title wraps beside the image. */
	align-items: flex-start;
	display: flex;
	gap: 12px;

	@media ( min-width: 75em ) {
		align-items: center;
	}

	.x-arrow-builder__row-title-group {
		/* Plain text flow, so the help icon follows the title's last word even when it wraps. */
		display: block;
		flex: 1 1 auto;
		min-width: 0;
	}

	.x-arrow-builder__row-title {
		color: #292929;
		cursor: pointer;
		display: inline;
		font-size: 13px;
		font-weight: 600;
	}

	.x-arrow-builder__help-toggle {
		margin-left: 2px;
	}
}

.x-arrow-builder__switch-image {
	background-color: #FEFEFD;
	border-radius: 2px;
	flex: 0 0 50px;
	height: 50px;
	object-fit: contain;
	width: 50px;

	@media ( min-width: 75em ) {
		flex-basis: 52px;
		height: 52px;
		width: 52px;
	}
}

.x-arrow-builder__switch-input {
	/* The real checkbox, restyled as a switch, so keyboard and screen-reader behavior stays native. */
	appearance: none;
	background-color: #858878;
	border: 1px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	flex: 0 0 auto;
	height: 24px;
	margin: 0;
	position: relative;
	transition: background-color 0.15s ease;
	width: 44px;

	&:before {
		background-color: #FEFEFD;
		border-radius: 50%;
		box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
		content: "";
		height: 18px;
		left: 2px;
		position: absolute;
		top: 2px;
		transition: transform 0.15s ease, width 0.15s ease;
		width: 18px;
	}

	&:checked {
		background-color: #292929;

		&:before {
			transform: translateX(20px);
		}
	}

	&:active:not(:disabled) {
		/* The knob stretches while held, toward the side it's about to slide to;
		   when on, it shifts left by the stretch so it stays inside the track. */

		&:before {
			width: 22px;
		}

		&:checked:before {
			transform: translateX(16px);
		}
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	&:disabled {
		background-color: #E5DBCF;
		cursor: not-allowed;

		&:before {
			background-color: #F7F4EF;
			box-shadow: none;
		}
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;

		&:before {
			transition: none;
		}
	}

	@media ( forced-colors: active ) {
		/* High-contrast mode drops the track and knob colors, so on and off would look the same.
		   Draw them in system colors instead: an outlined track, and a knob that fills with
		   Highlight when on and turns GrayText when disabled. */
		background-color: Canvas;
		border-color: ButtonText;
		forced-color-adjust: none;

		&:before {
			background-color: ButtonText;
			box-shadow: none;
		}

		&:checked {
			background-color: Highlight;
			border-color: Highlight;

			&:before {
				background-color: HighlightText;
			}
		}

		&:disabled {
			background-color: Canvas;
			border-color: GrayText;

			&:before {
				background-color: GrayText;
			}
		}
	}
}

.x-arrow-builder__switch-row:has(.x-arrow-builder__switch-input:disabled) {

	.x-arrow-builder__row-title {
		color: #737966;
		cursor: not-allowed;
	}
}

/* The same gap above the help panel as a titled row's title group leaves. */

.x-arrow-builder__switch-row .x-arrow-builder__help {
	margin-top: 8px;
}

/* A line under a Review table, e.g. that the included nock's color varies. */

.x-arrow-builder__summary-note {
	color: #737966;
	font-size: 13px;
	margin: 8px 0 0;
}

.x-arrow-builder__switch-row .x-arrow-builder__note {
	color: #737966;
	font-size: 12px;
	margin-top: 6px;
	/* Lines up with the title: image (50px mobile, 52px desktop) + 12px gap. */
	padding-left: 62px;

	@media ( min-width: 75em ) {
		padding-left: 64px;
	}
}

/* Radio lists: Nock, Inserts, Field Points, Weight Tubes
   (circle, name, price on the right; scrolls when long)
   ========================================================================== */

.x-arrow-builder__row[ data-row="nock" ] {
	/* Nock sits in its own white panel. */
	background-color: #FEFEFD;
	border-radius: 4px;
	padding: 18px;
}

.x-arrow-builder__choices:is([ data-row="nock" ], [ data-row="insert" ], [ data-row="points" ], [ data-row="weights" ]) {

	.x-arrow-builder__options {
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 6px;
		/* The padding keeps the selected outline from being clipped by the scroll box; the margin cancels it so the cards line up with the title. */
		margin-inline: -3px;
		/* Tall enough for about five rows plus part of the next, so a long list shows it scrolls. */
		max-height: 280px;
		overflow-y: auto;
		padding: 3px;
	}

	.x-arrow-builder__option {
		flex: none;
		min-width: 0;
		text-align: left;

		&.is-selected:after {
			content: none;
		}
	}

	.x-arrow-builder__option-label {
		align-items: center;
		display: flex;
		gap: 10px;
		padding: 12px 16px;

		&:before {
			/* Same growing dot as Fletch Service. */
			background-color: #FEFEFD;
			background-image: radial-gradient(circle closest-side, #3A4225 80%, transparent 90%);
			background-position: center;
			background-repeat: no-repeat;
			background-size: 0 0;
			border: 1px solid #A5A495;
			border-radius: 50%;
			box-sizing: border-box;
			content: "";
			flex: 0 0 18px;
			height: 18px;
			transition: background-size 0.15s ease, border-color 0.15s ease;

			@media ( prefers-reduced-motion: reduce ) {
				transition: none;
			}
		}
	}

	.x-arrow-builder__option-image {
		flex: 0 0 auto;
		width: auto;
	}

	.x-arrow-builder__option-text {
		color: #292929;
		flex: 1 1 auto;
		font-weight: 500;
	}

	.x-arrow-builder__option-note {
		color: #737966;
		display: block;
		font-size: 12px;
		font-weight: 400;
	}

	.x-arrow-builder__option-detail {
		color: #474A3E;
		flex: 0 0 auto;
		font-weight: 400;
	}

	.x-arrow-builder__option.is-selected {

		.x-arrow-builder__option-label:before {
			background-size: 8px 8px;
			border-color: #F8C364;
		}

		.x-arrow-builder__option-detail {
			color: #292929;
			font-weight: 700;
		}
	}
}

/* Installation service checkbox card (inserts, weight tubes)
   ========================================================================== */

.x-arrow-builder__row:has(+ .x-arrow-builder__check) {
	/* The install service belongs to the options above it, so its dashed line is the only divider between them. */
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.x-arrow-builder__check {
	border-top: 1px dashed #E5DBCF;
	margin-bottom: 20px;
	margin-top: 12px;
	padding: 12px 0 0;
	position: relative;

	&:not(:last-child) {
		/* Ends like a row, so the next row (or the step buttons) gets the usual gap and divider. */
		border-bottom: 1px solid #E5DBCF;
		padding-bottom: 20px;
	}

	input {
		/* The real checkbox stays for keyboard and screen readers; the label draws the box. */
		height: 1px;
		margin: 0;
		opacity: 0;
		position: absolute;
		width: 1px;
	}

	label {
		align-items: center;
		background-color: #FEFEFD;
		border: 1px solid #EFE8DF;
		border-radius: 4px;
		color: #474A3E;
		cursor: pointer;
		display: flex;
		font-size: 13px;
		gap: 10px;
		padding: 12px 16px;
		transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;

		&:before {
			background-color: #FEFEFD;
			background-position: center;
			background-repeat: no-repeat;
			border: 1px solid #8A8D80;
			border-radius: 2px;
			box-sizing: border-box;
			content: "";
			flex: 0 0 18px;
			height: 18px;
			transition: background-color 0.15s ease, border-color 0.15s ease;
		}
	}

	.x-arrow-builder__price {
		color: #474A3E;
		margin-left: auto;
	}

	input:checked + label {
		background-color: #FEF6E7;
		border-color: #F8C364;
		color: #292929;

		&:before {
			background-color: #292929;
			background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath d='M1 4.2 3.6 6.8 9 1.2' stroke='%23FEFEFD' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
			border-color: #292929;
		}

		.x-arrow-builder__price {
			color: #292929;
			font-weight: 700;
		}
	}

	input:focus-visible + label {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	label:hover {
		border-color: #F8C364;
	}

	@media ( forced-colors: active ) {

		input:checked + label {
			outline: 2px solid highlight;
		}
	}

	@media ( prefers-reduced-motion: reduce ) {

		label,
		label:before {
			transition: none;
		}
	}
}

/* The Field Points and Weight Tubes lists belong to the switch above them, so
   the divider between them is dashed, like the install service checkbox's.
   ========================================================================== */

.x-arrow-builder__switch-row:is([ data-row="points" ], [ data-row="weights" ]):has(+ .x-arrow-builder__choices) {
	border-bottom: 1px dashed #E5DBCF;
	/* 12px each side of the line, as the checkbox has. Below, the list's hidden title group adds 8px, so 4px here. */
	margin-bottom: 4px;
	padding-bottom: 12px;
}

/* Feather Colors: pricing note while shape, wing, length or brand is still open
   ========================================================================== */

.x-arrow-builder__row-note {
	color: #737966;
	font-size: 12px;
	line-height: 1.5;
	margin: 0 0 12px;
}

.x-arrow-builder__row-note-emphasis {
	color: #474A3E;
	font-weight: 500;
}

/* Fields a pick changed on its own (e.g. Wood fills in Manufacturer and Model)
   Highlighted for a moment, outside the field so its own background stays.
   With reduced motion it's a steady outline for the same time instead.
   ========================================================================== */

threerivers-arrow-builder [ data-auto-updated ] {
	border-radius: 4px;

	@media ( prefers-reduced-motion: no-preference ) {
		animation: x-arrow-builder-auto-updated 0.6s ease-out;
	}

	@media ( prefers-reduced-motion: reduce ) {
		box-shadow: 0 0 0 4px #FEF6E7, 0 0 0 6px #F8C364;
	}

	@media ( forced-colors: active ) {
		outline: 2px solid highlight;
		outline-offset: 4px;
	}
}

@keyframes x-arrow-builder-auto-updated {

	0%,
	40% {
		box-shadow: 0 0 0 4px #FEF6E7, 0 0 0 6px #F8C364;
	}

	100% {
		box-shadow: 0 0 0 4px rgb(254 246 231 / 0%), 0 0 0 6px rgb(248 195 100 / 0%);
	}
}

/* Previous / Continue
   ========================================================================== */

.x-arrow-builder__step-nav {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 24px;

	button {
		border-radius: 999px;
		cursor: pointer;
		font-family: inherit;
		font-size: 14px;
		font-weight: 600;
		padding: 12px 16px;
		transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, scale 0.1s ease;

		&:active:not(:disabled) {
			scale: 0.97;
		}

		&:focus-visible {
			outline: 2px solid #4D5A31;
			outline-offset: 2px;
		}

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}

	.x-arrow-builder__previous {
		background-color: #FEFEFD;
		border: 2px solid #F8C364;
		color: #292929;

		&:hover:not(:disabled) {
			background-color: #FEF6E7;
		}

		&:disabled {
			background-color: #EFE8DF;
			border-color: #EFE8DF;
			color: #8A8D80;
			cursor: not-allowed;
		}
	}

	.x-arrow-builder__continue,
	.x-arrow-builder__add-to-cart {
		background-color: #F8C364;
		border: 2px solid #F8C364;
		color: #292929;

		&:hover:not(:disabled, .is-incomplete) {
			background-color: #F5B23F;
			border-color: #F5B23F;
		}

		&.is-incomplete,
		&:disabled {
			/* .is-incomplete is still clickable: pressing it points the shopper to what's missing. */
			background-color: #EFE8DF;
			border-color: #EFE8DF;
			color: #5E6164;
		}

		&:disabled {
			cursor: not-allowed;
		}
	}
}

/* Review Arrow summaries
   ========================================================================== */

.x-arrow-builder__summary {
	/* Edit sits in its own column; row prices stop where the section total does. */
	--edit-column: 32px;
	--heading-gap: 16px;

	display: grid;
	gap: 16px;
	/* No summary images on mobile. */
	grid-template-columns: minmax(0, 1fr);
	margin-bottom: 24px;

	@media ( min-width: 40em ) {
		gap: 13px;
	}

	@media ( min-width: 75em ) {
		grid-template-columns: 97px minmax(0, 1fr);
	}
}

.x-arrow-builder__summary-image {
	aspect-ratio: 1;
	background-color: #FEFEFD;
	display: none;
	object-fit: contain;
	width: 100%;

	@media ( min-width: 75em ) {
		display: block;
	}
}

.x-arrow-builder__summary-heading {
	align-items: center;
	background-color: #EFE8DF;
	display: flex;
	gap: var(--heading-gap);
	padding: 8px 12px;

	h3 {
		color: #292929;
		flex: 1 1 auto;
		font-size: 13px;
		font-weight: 700;
		margin: 0;

		@media ( min-width: 75em ) {
			font-size: 16px;
		}
	}

	.x-arrow-builder__price {
		color: #292929;
		font-size: 15px;
		font-weight: 700;
	}

	.x-arrow-builder__edit {
		min-width: var(--edit-column);
		text-align: right;
	}
}

.x-arrow-builder__edit {
	background: none;
	border: 0;
	color: #474A3E;
	cursor: pointer;
	font-family: inherit;
	font-size: 12px;
	padding: 0;
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: text-decoration-thickness 0.15s ease;

	&:hover {
		text-decoration-thickness: 2px;
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

.x-arrow-builder__summary-table {
	border-collapse: collapse;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	width: 100%;

	@media ( min-width: 75em ) {
		font-size: 14px;
	}

	thead {
		/* Column headers are for screen readers only. */
		border: 0;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}

	tbody th,
	tbody td {
		border-bottom: 1px dashed #E5DBCF;
		padding: 18px 12px;
		text-align: left;
		vertical-align: middle;
	}

	tbody th {
		color: #5E6164;
		font-weight: 500;
		width: 38%;
	}

	.x-arrow-builder__summary-value {
		color: #292929;
		font-weight: 600;
	}

	.x-arrow-builder__summary-value-inner {
		align-items: flex-start;
		display: inline-flex;
		gap: 8px;
	}

	.x-arrow-builder__swatch {
		border-radius: 2px;
		flex: 0 0 18px;
		height: 18px;
		/* Centered on the first line of a name that wraps. */
		margin-top: calc((1lh - 18px) / 2);
		width: 18px;
	}

	.x-arrow-builder__summary-price {
		color: #474A3E;
		/* Narrow screens need the room more than the line-up with the section total, so row prices sit on the right edge. */
		padding-right: 12px;
		text-align: right;
		white-space: nowrap;

		@media ( min-width: 75em ) {
			/* Row prices stop where the section total does. */
			padding-right: calc(12px + var(--heading-gap) + var(--edit-column));
		}
	}
}

/* Select rows (Manufacturer / Model / Deflection, Length / Package Count)
   ========================================================================== */

.x-arrow-builder__fields {
	display: grid;
	gap: 8px;

	@media ( min-width: 40em ) {
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
	}
}

.x-arrow-builder__select {
	appearance: none;
	background-color: #FEFEFD;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235E6164' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: right 16px center;
	background-repeat: no-repeat;
	border: 1px solid #EFE8DF;
	border-radius: 4px;
	color: #292929;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	height: 44px;
	line-height: normal;
	padding: 0 40px 0 16px;
	text-overflow: ellipsis;
	transition: border-color 0.15s ease;
	width: 100%;

	&:has(option[ value="" ]:checked) {
		color: #737966;
	}

	&:hover:not(:disabled) {
		border-color: #F8C364;
	}

	&:focus-visible {
		border-color: #F8C364;
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}

	&:disabled {
		cursor: not-allowed;
		opacity: 0.55;
	}

	option {
		color: #292929;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}
}

/* Color pickers (Cock / Hen Color, Arrow Wrap Color)
   ========================================================================== */

.x-arrow-builder__pickers {
	background-color: #FEFEFD;
	border-radius: 4px;
}

.x-arrow-builder__picker + .x-arrow-builder__picker {
	border-top: 1px dashed #E5DBCF;
}

.x-arrow-builder__picker-toggle {
	align-items: center;
	background: none;
	border: 0;
	border-radius: 4px;
	color: #292929;
	column-gap: 10px;
	cursor: pointer;
	display: grid;
	font-family: inherit;
	font-size: 13px;
	/* Fixed price and swatch columns keep every picker row aligned, priced or not. */
	grid-template-columns: minmax(0, 2.5fr) minmax(0, 2fr) 5.25rem 24px 12px;
	padding: 16px 12px;
	text-align: left;
	transition: background-color 0.15s ease;
	width: 100%;

	&:hover {
		background-color: #FAF8F5;
	}

	@media ( prefers-reduced-motion: reduce ) {
		transition: none;
	}

	@media ( min-width: 75em ) {
		column-gap: 16px;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 8rem 28px 12px;
		padding: 16px 18px;
	}

	&:after {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235E6164' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		content: "";
		height: 7px;
		transition: transform 0.15s ease;
		width: 12px;

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}

	&[ aria-expanded="true" ]:after {
		transform: rotate(180deg);
	}

	&:focus-visible {
		outline: 2px solid #4D5A31;
		outline-offset: -2px;
	}

	.x-arrow-builder__swatch {
		border-radius: 2px;
		height: 24px;
		width: 24px;

		@media ( min-width: 75em ) {
			height: 28px;
			width: 28px;
		}
	}

	/* A chosen color's swatch clears it when clicked. */

	&[ data-has-value ] .x-arrow-builder__swatch:hover {
		cursor: pointer;
		outline: 2px solid #4D5A31;
		outline-offset: 2px;
	}
}

.x-arrow-builder__picker-label {
	font-weight: 500;
}

.x-arrow-builder__picker-value {
	font-size: 12px;
	overflow: hidden;
	text-decoration-line: underline;
	text-overflow: ellipsis;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.x-arrow-builder__picker-price {
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}

.x-arrow-builder__swatch {
	border-radius: 4px;
	display: block;
	object-fit: cover;
}

/* Swatch images stay hidden until loaded (data-loaded is set on load), so a missing file never shows as a broken image before it falls back to its color. Specific enough to beat the unavailable swatch's dimming until then. */

img:is(.x-arrow-builder__swatch, .x-arrow-builder__swatch-preview):not([ data-loaded ]) {
	opacity: 0;
}

.x-arrow-builder__swatch--empty {
	/* No color picked yet (or no swatch for the color): an empty slot, not a color. */
	background-color: #FEFEFD;
	border: 1px dashed #A5A495;
}

.x-arrow-builder__picker-panel {
	border: 0;
	border-top: 1px dashed #E5DBCF;
	margin: 0 12px;
	min-width: 0;
	padding: 16px 0 18px;

	@media ( min-width: 75em ) {
		margin: 0 18px;
	}
}

/* Mobile: an open picker is a sheet rising over a dimmed page (a strip of it shows above), with a
   round close button, until a color is picked (a pick closes it) or it is closed. Desktop keeps the
   inline panel, and hides the header.
   ========================================================================== */

.x-arrow-builder__picker-head,
.x-arrow-builder__picker-foot {
	display: none;
}

@media ( max-width: 74.9375em ) {

	/* The page behind the open picker stays put, so a swipe scrolls the picker. */

	html.x-arrow-builder-picker-open {
		overflow: hidden;
	}

	.x-arrow-builder__picker-panel {
		background-color: #FEFEFD;
		border: 0;
		border-radius: 16px 16px 0 0;
		/* The dimmed page: a shadow spread far past the sheet. */
		box-shadow: 0 0 0 100vmax rgb(0 0 0 / 55%);
		inset: 8vh 0 0;
		margin: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		/* No bottom padding: the sticky footer has to sit flush with the sheet's bottom edge, or swatches show beneath it. */
		padding: 0 16px;
		position: fixed;
		z-index: 300;
	}

	.x-arrow-builder__picker-head {
		align-items: center;
		background-color: #FEFEFD;
		border-bottom: 1px solid #E5DBCF;
		display: flex;
		gap: 12px;
		justify-content: space-between;
		margin: 0 -16px 16px;
		padding: 16px;
		position: sticky;
		top: 0;
		/* Above the swatches (the unavailable strike line is 1, a hovered swatch 3). */
		z-index: 10;
	}

	.x-arrow-builder__picker-head-title {
		color: #292929;
		font-size: 16px;
		font-weight: 600;
	}

	.x-arrow-builder__picker-close {
		align-items: center;
		background-color: #FEFEFD;
		border: 1px solid #A5A495;
		border-radius: 50%;
		color: #292929;
		cursor: pointer;
		display: flex;
		flex: 0 0 auto;
		height: 44px;
		justify-content: center;
		padding: 0;
		width: 44px;

		svg {
			height: 16px;
			width: 16px;
		}

		&:focus-visible {
			outline: 2px solid #4D5A31;
			outline-offset: 2px;
		}
	}

	/* The sheet's footer stays at the bottom edge: Select a Color (disabled) until a color is picked, then Apply Color. */

	.x-arrow-builder__picker-foot {
		background-color: #F7F4EF;
		bottom: 0;
		display: block;
		margin: 16px -16px 0;
		padding: 24px 16px;
		position: sticky;
		z-index: 10;
	}

	.x-arrow-builder__picker-apply {
		background-color: #F8C364;
		border: 0;
		border-radius: 999px;
		color: #292929;
		cursor: pointer;
		font-size: 16px;
		font-weight: 600;
		height: 43px;
		width: 100%;

		&:disabled {
			background-color: #EFE8DF;
			color: #8B8A7A;
			cursor: not-allowed;
		}

		&:focus-visible {
			outline: 2px solid #4D5A31;
			outline-offset: 2px;
		}
	}

	.x-arrow-builder__picker-panel .x-arrow-builder__options--swatches {
		/* The screen is the scroll box now. */
		max-height: none;
		overflow-y: visible;
	}
}

.x-arrow-builder__options--swatches {
	/* Mobile: four cards per row, each up to 116px (narrower on small phones);
	   tablet: as many 116px cards as fit. Spread evenly across the row; each is
	   the swatch with its name and price under it (the desktop hover card's
	   content, always shown, since touch has no hover), in a box capped at 40vh
	   that scrolls. The padding keeps the selected ring from being clipped by the
	   scroll box; the margin cancels it so the cards line up.
	   Desktop: 13 small swatches per row, name and price in a hover card. */
	display: grid;
	gap: 12px 8px;
	grid-template-columns: repeat(4, minmax(0, 116px));
	justify-content: space-between;
	margin: -4px;
	max-height: 40vh;
	overflow-y: auto;
	padding: 4px;

	@media ( min-width: 40em ) {
		/* Tablet: room for more than three, so 116px cards, as many per row as fit. */
		grid-template-columns: repeat(auto-fill, 116px);
	}

	@media ( min-width: 75em ) {
		gap: 8px 11px;
		grid-template-columns: repeat(13, minmax(0, 1fr));
		justify-content: normal;
		margin: 0;
		/* No scroll box: it would clip the hover cards. */
		max-height: none;
		overflow-y: visible;
		padding: 0;
	}

	.x-arrow-builder__option {
		background: none;
		border: 0;
		border-radius: 4px;
		flex: none;
		min-width: 0;
		text-align: left;
		width: 100%;

		@media ( min-width: 75em ) {
			aspect-ratio: 1;
			max-width: 36px;
		}

		&.is-selected:after {
			content: none;
			outline: none;
		}

		&.is-selected {
			outline: 0;

			.x-arrow-builder__swatch {
				outline: 2.5px solid #292929;
				outline-offset: 2px;
			}
		}

		&:hover,
		&:has(input:focus-visible) {
			/* Lift the active swatch so its hover card sits above the neighboring swatches. */
			z-index: 3;
		}

		&:has(input:disabled) {
			/* Opacity on the box would trap the hover card in its own stacking context (and fade it), so dim only the swatch. */
			opacity: 1;

			.x-arrow-builder__swatch {
				opacity: 0.55;
			}

			.x-arrow-builder__option-label:before {
				/* A soft "/" strike corner to corner: a faint white strand beside a faint charcoal one, so it
				   shows on light and dark colors alike without being harsh, and reads as unavailable
				   without relying on the fade alone. Square and pinned to the top, so on the mobile
				   cards it crosses only the swatch, not the name and price under it. */
				aspect-ratio: 1;
				background-image: linear-gradient(
					to bottom right,
					transparent calc(50% - 1px),
					rgb(254 254 253 / 75%) calc(50% - 1px),
					rgb(254 254 253 / 75%) 50%,
					rgb(41 41 41 / 35%) 50%,
					rgb(41 41 41 / 35%) calc(50% + 1px),
					transparent calc(50% + 1px)
				);
				border-radius: 4px;
				content: "";
				inset: 0 0 auto;
				pointer-events: none;
				position: absolute;
				z-index: 1;
			}
		}
	}

	.x-arrow-builder__option-label {
		/* Mobile: the swatch, then the name and price filling the rest of the card
		   (cards in a row share its height), so the price can sit at the bottom. */
		display: grid;
		gap: 6px;
		grid-template-rows: auto 1fr;
		height: 100%;
		padding: 0;

		@media ( min-width: 75em ) {
			display: block;
		}
	}

	.x-arrow-builder__swatch {
		aspect-ratio: 1;
		border-radius: 4px;
		/* An unseen ring, so the selected one eases out from the swatch instead of snapping on. */
		outline: 1.5px solid transparent;
		outline-offset: 0;
		transition: outline-color 0.15s ease, outline-offset 0.15s ease, scale 0.15s ease;
		width: 100%;

		@media ( prefers-reduced-motion: reduce ) {
			transition: none;
		}
	}

	@media ( hover: hover ) {
		/* Mouse only: on touch the lift would stay stuck on the last swatch tapped. */

		.x-arrow-builder__option:not(:has(input:disabled)):hover .x-arrow-builder__swatch {
			scale: 1.08;
		}
	}

	.x-arrow-builder__swatch-info {
		/* Name and price. Mobile: shown under the swatch. Desktop: read by screen
		   readers, shown as a card on hover/focus. */
		display: flex;
		flex-direction: column;
		gap: 2px;

		@media ( min-width: 75em ) {
			border: 0;
			clip: rect(0 0 0 0);
			clip-path: inset(50%);
			display: block;
			gap: 4px;
			height: 1px;
			margin: -1px;
			overflow: hidden;
			padding: 0;
			position: absolute;
			white-space: nowrap;
			width: 1px;
		}
	}

	@media ( min-width: 75em ) {

		.x-arrow-builder__option:not([ data-info-dismissed ]):hover .x-arrow-builder__swatch-info,
		.x-arrow-builder__option:not([ data-info-dismissed ]):has(input:focus-visible) .x-arrow-builder__swatch-info {
			/* data-info-dismissed: Escape hid the card until the pointer or focus leaves the swatch. */
			background-color: #FEFEFD;
			border-radius: 4px;
			box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
			clip: auto;
			clip-path: none;
			display: grid;
			height: auto;
			left: 50%;
			margin: 0;
			overflow: visible;
			padding: 8px;
			text-align: left;
			top: calc(100% + 8px);
			transform: translateX(-50%);
			white-space: normal;
			width: 132px;
			z-index: 2;
		}
	}

	.x-arrow-builder__swatch-preview {
		/* The card's big swatch is desktop only; on mobile the card's own swatch is already full width. */
		border-radius: 2px;
		display: none;
		height: 116px;
		object-fit: cover;
		width: 116px;

		@media ( min-width: 75em ) {
			display: block;
		}
	}

	.x-arrow-builder__swatch-preview--empty {
		background-color: #F7F4EF;
	}

	.x-arrow-builder__option-text {
		color: #474A3E;
		/* Mobile: the name fills the card's spare height, pushing the note and price to the bottom. */
		flex-grow: 1;
		font-size: 11px;
		font-weight: 400;
		line-height: 1.3;
		/* Long color names wrap inside the narrow mobile card instead of widening it. */
		overflow-wrap: anywhere;

		@media ( min-width: 75em ) {
			margin-top: 4px;
		}
	}

	.x-arrow-builder__option-detail {
		/* Mobile: last in the card, after any "Not Available" note; the name above them
		   takes up the spare height, so the note and price sit together at the bottom and
		   line up across a row however the names wrap. */
		color: #292929;
		font-size: 12px;
		font-weight: 700;
		order: 1;

		@media ( min-width: 75em ) {
			font-size: 13px;
			order: 0;
		}
	}

	.x-arrow-builder__swatch-unavailable {
		/* Why a struck-through swatch can't be picked; read by screen readers with the color, too.
		   Mobile shows the short note (--short, hidden from screen readers) on the narrow card and
		   keeps the full sentence for screen readers only; desktop's hover card shows the full one. */
		color: #5E6164;
		font-size: 11px;
		font-style: italic;
		line-height: 1.3;

		&:not(.x-arrow-builder__swatch-unavailable--short) {

			@media ( max-width: 74.9375em ) {
				border: 0;
				clip: rect(0 0 0 0);
				clip-path: inset(50%);
				height: 1px;
				margin: -1px;
				overflow: hidden;
				padding: 0;
				position: absolute;
				white-space: nowrap;
				width: 1px;
			}
		}
	}

	.x-arrow-builder__swatch-unavailable--short {

		@media ( min-width: 75em ) {
			display: none;
		}
	}
}

/* Bottom bar: the mobile copy of Subtotal / Clear / Add to Cart, last in the
   builder so it can stick to the bottom of the screen while the builder is in
   view. Desktop uses the copy in the top bar.
   ========================================================================== */

.x-arrow-builder__cart-bar {
	bottom: 0;
	position: sticky;
	/* Same level as the top bar: below the theme's menus and overlays. */
	z-index: 50;

	@media ( min-width: 75em ) {
		display: none;
	}

	.x-arrow-builder__total-ctas {
		background-color: #4D5A31;
		border-right: 0;
		gap: 12px;
		height: auto;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.x-arrow-builder__pricing {
		color: #FEFEFD;
		font-size: 18px;
		line-height: 28px;
	}

	.x-arrow-builder__clear {
		color: #FEFEFD;
		cursor: pointer;

		&:disabled {
			cursor: not-allowed;
			opacity: 0.55;
		}

		&:focus-visible {
			outline: 2px solid #FEFEFD;
			outline-offset: 2px;
		}
	}

	.x-arrow-builder__add-to-cart {
		min-width: 0;
		padding: 12px 28px;

		&:focus-visible {
			outline-color: #FEFEFD;
		}

		&:disabled {
			background-color: rgb(254 254 253 / 30%);
			border-color: transparent;
			color: #2F312A;
		}
	}
}

/* Entrances
   Parts that appear ease in: an opened step, the help and color panels, the
   swatch hover cards, the lists a switch reveals, errors, the checkmark on a
   picked option, each arrow part as it's added to the preview, the Review
   specs and the dialogs. Each runs when its element is added (Lit inserts
   it) or stops being display: none ([ hidden ] toggles). `translate` and
   `scale` stack on top of any `transform` the element already has (the hover
   card's centering). Nothing moves when the shopper asks for reduced motion.
   ========================================================================== */

@media ( prefers-reduced-motion: no-preference ) {

	.x-arrow-builder__panel,
	.x-arrow-builder__specs-card,
	.x-arrow-builder__switch-row + .x-arrow-builder__choices,
	.x-arrow-builder__check {
		animation: x-arrow-builder-rise-in 0.2s var(--x-arrow-builder-ease-out);
	}

	.x-arrow-builder__help,
	.x-arrow-builder__picker-panel {
		animation: x-arrow-builder-drop-in 0.2s var(--x-arrow-builder-ease-out);
	}

	.x-arrow-builder__options--swatches .x-arrow-builder__option:not([ data-info-dismissed ]):hover .x-arrow-builder__swatch-info,
	.x-arrow-builder__options--swatches .x-arrow-builder__option:not([ data-info-dismissed ]):has(input:focus-visible) .x-arrow-builder__swatch-info {
		/* Desktop only: on mobile the name and price are always shown, so a tap shouldn't replay this. */
		@media ( min-width: 75em ) {
			animation: x-arrow-builder-rise-in 0.15s var(--x-arrow-builder-ease-out);
		}
	}

	.x-arrow-builder__error,
	.x-arrow-builder__layer img {
		animation: x-arrow-builder-fade-in 0.2s var(--x-arrow-builder-ease-out);
	}

	.x-arrow-builder__option.is-selected:after {
		animation: x-arrow-builder-pop-in 0.2s var(--x-arrow-builder-ease-out);
	}

	.x-arrow-builder__dialog[ open ] {
		animation: x-arrow-builder-rise-in 0.2s var(--x-arrow-builder-ease-out);

		&::backdrop {
			animation: x-arrow-builder-fade-in 0.2s var(--x-arrow-builder-ease-out);
		}
	}
}

/* Each starts from its `from` state and ends on the element's own styles. */

@keyframes x-arrow-builder-fade-in {

	from {
		opacity: 0;
	}
}

@keyframes x-arrow-builder-rise-in {

	from {
		opacity: 0;
		translate: 0 6px;
	}
}

@keyframes x-arrow-builder-drop-in {

	from {
		opacity: 0;
		translate: 0 -4px;
	}
}

@keyframes x-arrow-builder-pop-in {

	from {
		opacity: 0;
		scale: 0.4;
	}
}
