/**
 * Figma Product Listing template styles (node 7135:609).
 *
 * Layers on top of figma-home.css, which supplies the tokens, header, footer,
 * newsletter and product-card rules.
 */

/* Hero (7135:712) — 1440x272 ------------------------------------------------ */

.fsx-lhero {
	background: #eae7f1;
	padding: 36px 0 32px;
}

.fsx-crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	line-height: 20px;
	color: var(--g600);
	margin-bottom: 16px;
}

.fsx-crumbs a {
	color: var(--g600);
	transition: color 160ms ease;
}

.fsx-crumbs a:hover,
.fsx-crumbs a[aria-current] {
	color: var(--p500);
}

.fsx-crumbs span {
	color: var(--g300);
}

.fsx-lhero__title {
	margin: 0;
	font-family: "Clash Display", "Public Sans", sans-serif;
	font-weight: 600;
	font-size: 48px;
	line-height: 68px;
	color: var(--g800);
}

.fsx-lhero__lede {
	max-width: 862px;
	margin-top: 12px;
	font-size: 20px;
	line-height: 30px;
	color: var(--g600);
}

/* Layout (7135:6896) — 334 sidebar + 962 results, 144 gutter ---------------- */

.fsx-listing {
	padding: 20px 0 60px;
}

.fsx-listing__grid {
	display: grid;
	grid-template-columns: 334px 1fr;
	gap: 44px;
	align-items: start;
}

/* Filter sidebar (7135:6897) ------------------------------------------------ */

.fsx-filters {
	position: sticky;
	top: 96px;
	background: #fff;
	border: 1px solid var(--g200);
	border-radius: 14px;
	padding: 22px 20px;
}

.fsx-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 18px;
}

.fsx-filters__title {
	font-family: "Clash Display", "Public Sans", sans-serif;
	font-weight: 600;
	font-size: 20px;
	line-height: 28px;
	color: var(--ink);
}

.fsx-clear {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: none;
	padding: 0;
	font-family: inherit;
	font-size: 16px;
	line-height: 24px;
	color: var(--p500);
	cursor: pointer;
	transition: opacity 160ms ease;
}

.fsx-clear:hover {
	opacity: 0.72;
}

/* Circular reset arrow shown beside "Clear Filters" in the Figma sidebar. */
.fsx-clear__icon {
	width: 15px;
	height: 15px;
	border: 1.6px solid currentColor;
	border-radius: 50%;
	border-right-color: transparent;
	position: relative;
	transition: transform 300ms ease;
}

.fsx-clear__icon::after {
	content: "";
	position: absolute;
	top: -2px;
	right: -1px;
	border: 3px solid transparent;
	border-bottom-color: currentColor;
	transform: rotate(45deg);
}

.fsx-clear:hover .fsx-clear__icon {
	transform: rotate(-180deg);
}

/* The live store exposes ~24 categories against the design's 5 rows, so the
   list scrolls rather than pushing the sidebar past the results column. */
.fsx-cats-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 340px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.fsx-cats-list::-webkit-scrollbar {
	width: 6px;
}

.fsx-cats-list::-webkit-scrollbar-thumb {
	background: var(--g300);
	border-radius: 3px;
}

.fsx-cats-list li + li {
	border-top: 1px solid var(--g200);
}

/* Figma "Component 3", Property 1=Default / Active. */
.fsx-catrow {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: none;
	padding: 15px 14px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 18px;
	line-height: 26px;
	color: var(--g800);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.fsx-catrow:hover {
	background: var(--p50);
	color: var(--p500);
}

.fsx-catrow:focus-visible {
	outline: 2px solid var(--p500);
	outline-offset: -2px;
}

.fsx-catrow.is-active {
	background: var(--g100, #f4f4f5);
	color: var(--p500);
	font-weight: 500;
}

.fsx-fgroup {
	padding-top: 26px;
}

/* Dual-handle price range --------------------------------------------------- */

.fsx-range {
	position: relative;
	height: 32px;
	margin-top: 18px;
}

.fsx-range__track {
	position: absolute;
	top: 14px;
	left: 0;
	right: 0;
	height: 4px;
	border-radius: 4px;
	background: var(--g200);
}

.fsx-range__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--p500);
	border-radius: 4px;
}

.fsx-range input[type="range"] {
	position: absolute;
	top: 6px;
	left: 0;
	width: 100%;
	margin: 0;
	height: 20px;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.fsx-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--p500);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
	cursor: grab;
	transition: transform 140ms ease;
}

.fsx-range input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.12);
}

.fsx-range input[type="range"]::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--p500);
	cursor: grab;
}

.fsx-range__vals {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--g700);
}

.fsx-range__ticks {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
	font-size: 12px;
	color: var(--g500);
}

/* Results bar (7135:7739) --------------------------------------------------- */

.fsx-results__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid var(--g200);
	border-radius: 14px;
	flex-wrap: wrap;
}

.fsx-results__count {
	font-size: 15px;
	line-height: 22px;
	color: var(--g600);
}

.fsx-results__count b {
	font-weight: 600;
	color: var(--g800);
}

.fsx-results__tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.fsx-searchbox {
	position: relative;
	display: flex;
	align-items: center;
}

.fsx-searchbox input {
	width: 240px;
	height: 40px;
	padding: 0 34px 0 36px;
	border: 1px solid var(--g300);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	color: var(--g800);
	transition: border-color 160ms ease, width 200ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.fsx-searchbox input::-webkit-search-cancel-button {
	display: none;
}

.fsx-searchbox input::placeholder {
	color: var(--g500);
}

.fsx-searchbox input:hover {
	border-color: var(--p300, #806caa);
}

.fsx-searchbox input:focus {
	outline: none;
	border-color: var(--p500);
	box-shadow: 0 0 0 3px rgba(65, 36, 128, 0.12);
}

/* Magnifier drawn in CSS — no exported asset for this control. */
.fsx-searchbox__icon {
	position: absolute;
	left: 13px;
	width: 11px;
	height: 11px;
	border: 1.6px solid var(--g500);
	border-radius: 50%;
	pointer-events: none;
}

.fsx-searchbox__icon::after {
	content: "";
	position: absolute;
	top: 10px;
	left: 8px;
	width: 1.6px;
	height: 6px;
	background: var(--g500);
	transform: rotate(-45deg);
}

.fsx-searchbox__clear {
	position: absolute;
	right: 10px;
	width: 16px;
	height: 16px;
	border: 0;
	border-radius: 50%;
	background: var(--g200);
	cursor: pointer;
}

.fsx-searchbox__clear::before,
.fsx-searchbox__clear::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 8px;
	height: 1.5px;
	background: var(--g600);
}

.fsx-searchbox__clear::before { transform: rotate(45deg); }
.fsx-searchbox__clear::after  { transform: rotate(-45deg); }

.fsx-searchbox__clear:hover {
	background: var(--p50);
}

/* Sort dropdown (7135:7742) */

.fsx-sort {
	position: relative;
}

.fsx-sort__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 14px;
	min-width: 210px;
	border: 1px solid var(--g300);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.fsx-sort__btn:hover {
	border-color: var(--p300, #806caa);
}

.fsx-sort__btn:focus-visible {
	outline: 2px solid var(--p500);
	outline-offset: 2px;
}

.fsx-sort__label {
	color: var(--g500);
}

.fsx-sort__value {
	flex: 1 1 auto;
	text-align: left;
	font-weight: 500;
	color: var(--g800);
}

.fsx-sort__chev {
	width: 10px;
	height: 10px;
	border-right: 1.5px solid var(--g600);
	border-bottom: 1.5px solid var(--g600);
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform 200ms ease;
}

.fsx-sort__btn[aria-expanded="true"] .fsx-sort__chev {
	transform: rotate(-135deg) translate(-2px, -2px);
}

.fsx-sort__menu {
	position: absolute;
	z-index: 30;
	top: calc(100% + 6px);
	left: 0;
	width: 210px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--g200);
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
	animation: fsx-menu-in 160ms ease both;
}

@keyframes fsx-menu-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.fsx-sort__menu li {
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	color: var(--g700);
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.fsx-sort__menu li:hover,
.fsx-sort__menu li:focus-visible {
	background: var(--p50);
	color: var(--p500);
	outline: none;
}

.fsx-sort__menu li[aria-selected="true"] {
	background: var(--p500);
	color: #fff;
}

/* Results grid (7135:7550) — 3 columns of 305 ------------------------------- */

.fsx-results__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.fsx-results__grid .fsx-card {
	animation: fsx-card-in 300ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.fsx-results__grid .fsx-card:nth-child(1) { animation-delay: 0ms; }
.fsx-results__grid .fsx-card:nth-child(2) { animation-delay: 30ms; }
.fsx-results__grid .fsx-card:nth-child(3) { animation-delay: 60ms; }
.fsx-results__grid .fsx-card:nth-child(4) { animation-delay: 45ms; }
.fsx-results__grid .fsx-card:nth-child(5) { animation-delay: 75ms; }
.fsx-results__grid .fsx-card:nth-child(6) { animation-delay: 105ms; }
.fsx-results__grid .fsx-card:nth-child(7) { animation-delay: 90ms; }
.fsx-results__grid .fsx-card:nth-child(8) { animation-delay: 120ms; }
.fsx-results__grid .fsx-card:nth-child(9) { animation-delay: 150ms; }

/* Out-of-stock cards */

/* Dim the photo only — the badge sits inside .fsx-card__media and must stay
   at full contrast. */
.fsx-card.is-out .fsx-card__media img {
	opacity: 0.55;
}

.fsx-empty {
	padding: 48px 0;
	text-align: center;
	font-size: 16px;
	color: var(--g600);
}

/* Pagination (7139:2248) ---------------------------------------------------- */

.fsx-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--g200);
}

.fsx-pager__nav {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--g300);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--g700);
	cursor: pointer;
	transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.fsx-pager__nav:hover:not(:disabled) {
	border-color: var(--p500);
	color: var(--p500);
}

.fsx-pager__nav:disabled {
	opacity: 0.4;
	cursor: default;
}

.fsx-pager__nav:focus-visible {
	outline: 2px solid var(--p500);
	outline-offset: 2px;
}

.fsx-pager__nums {
	display: flex;
	align-items: center;
	gap: 4px;
}

.fsx-pager__num {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 8px;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--g600);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.fsx-pager__num:hover {
	background: var(--p50);
	color: var(--p500);
}

.fsx-pager__num:focus-visible {
	outline: 2px solid var(--p500);
	outline-offset: 2px;
}

.fsx-pager__num.is-current {
	background: var(--p500);
	color: #fff;
}

.fsx-pager__gap {
	width: 32px;
	text-align: center;
	color: var(--g500);
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
	.fsx-listing__grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.fsx-filters {
		position: static;
	}

	.fsx-results__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.fsx-lhero__title {
		font-size: 36px;
		line-height: 48px;
	}
}

@media (max-width: 900px) {
	.fsx-results__tools {
		width: 100%;
		flex-wrap: wrap;
	}

	.fsx-searchbox {
		flex: 1 1 200px;
	}

	.fsx-searchbox input {
		width: 100%;
	}
}

@media (max-width: 640px) {
	.fsx-results__grid {
		grid-template-columns: 1fr;
	}


	.fsx-pager {
		flex-direction: column;
	}
}

/* Corner badges (Figma shows Sale and Coming Soon variants) ------------------ */

.fsx-card__media {
	position: relative;
}

.fsx-badge-tag {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	line-height: 18px;
	color: #fff;
	letter-spacing: 0.01em;
}

.fsx-badge-tag--sale {
	background: var(--p500);
}

.fsx-badge-tag--oos {
	background: #000;
}

/* Price ranges ------------------------------------------------------------- */

/* The Figma card assumed a single figure at 24px. A variable product's range
   ("$43.20 – $279.20") does not fit beside the cart button at that size, so it
   steps down rather than truncating or wrapping under it. */
.fsx-card__price.is-range {
	font-size: 18px;
	line-height: 24px;
	letter-spacing: -0.01em;
}

@media (max-width: 1100px) {
	.fsx-card__price.is-range {
		font-size: 17px;
	}
}

/* Mobile corrections ------------------------------------------------------ */

/* Desktop keeps the Figma sidebar exactly as it was: panel always open, no
   handle. The toggle only exists at phone widths. */
.fsx-filters__toggle {
	display: none;
}

@media (max-width: 640px) {
	/* Two-up product cards. One-up gave a 350x384 card, so barely one and a
	   half products fit a screen and the page ran to ~6,900px. */
	.fsx-results__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.fsx-card__title {
		font-size: 15px;
		line-height: 20px;
	}

	.fsx-card__price,
	.fsx-card__price.is-range {
		font-size: 15px;
		line-height: 20px;
	}

	.fsx-card__foot {
		gap: 8px;
	}

	/* The filter panel sits above the results, so at full height a shopper
	   scrolled the whole category list before reaching a single product.
	   Collapsed by default, opened by the handle. */
	.fsx-filters {
		padding: 0;
		overflow: hidden;
	}

	.fsx-filters__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		min-height: 52px;
		padding: 0 18px;
		border: 0;
		background: none;
		font-family: inherit;
		font-size: 16px;
		font-weight: 600;
		color: var(--ink);
		cursor: pointer;
	}

	.fsx-filters__chev {
		width: 9px;
		height: 9px;
		border-right: 2px solid var(--p500);
		border-bottom: 2px solid var(--p500);
		transform: rotate(45deg) translate(-2px, -2px);
		transition: transform 180ms ease;
	}

	.fsx-filters__toggle[aria-expanded="true"] .fsx-filters__chev {
		transform: rotate(225deg) translate(-2px, -2px);
	}

	.fsx-filters__body {
		display: none;
		padding: 0 18px 18px;
	}

	.fsx-filters__body.is-open {
		display: block;
	}

	/* Nested scrolling inside a scrolling page is awkward on touch; with the
	   panel collapsed by default the list can simply run its full length. */
	.fsx-cats-list {
		max-height: none;
		overflow-y: visible;
	}
}
