/* =========================================================================
   FF Category Showcase — v1.1.1
   Tweak the look from your theme / Customizer › Additional CSS, e.g.:
   .ffcs { --ffcs-accent: #8a6a4a; --ffcs-sticky-top: 80px; }
   ========================================================================= */

.ffcs {
	--ffcs-bg: #ffffff;
	--ffcs-surface: #f6f3ef;
	--ffcs-ink: #1b1a19;
	--ffcs-muted: #6f6a64;
	--ffcs-line: #e7e2dc;
	--ffcs-accent: #1b1a19;
	--ffcs-accent-ink: #ffffff;
	--ffcs-sale: #b4432f;
	--ffcs-radius: 14px;
	--ffcs-gap: clamp(12px, 1.6vw, 22px);
	--ffcs-cols: 4;
	--ffcs-ratio: 1 / 1; /* your product photos are square (600×600) */
	--ffcs-sticky-top: 0px;
	--ffcs-ease: cubic-bezier(.2, .7, .2, 1);

	color: var(--ffcs-ink);
	margin-block: clamp(8px, 2vw, 24px) clamp(32px, 5vw, 64px);
	-webkit-font-smoothing: antialiased;
}

.ffcs *, .ffcs *::before, .ffcs *::after { box-sizing: border-box; }
.ffcs ul { list-style: none; margin: 0; padding: 0; }
.ffcs a { text-decoration: none; color: inherit; }

/* ---------- Sticky category navigation ---------- */
.ffcs-nav {
	position: sticky;
	top: var(--ffcs-sticky-top);
	z-index: 20;
	margin-block-end: clamp(20px, 3vw, 36px);
	padding-block: 10px;
	background: color-mix(in srgb, var(--ffcs-bg) 88%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	border-block-end: 1px solid var(--ffcs-line);
}
.admin-bar .ffcs-nav { top: calc(var(--ffcs-sticky-top) + 32px); }
@media (max-width: 782px) { .admin-bar .ffcs-nav { top: var(--ffcs-sticky-top); } }

.ffcs-nav__list {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding: 2px;
}
.ffcs-nav__list::-webkit-scrollbar { display: none; }

.ffcs-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--ffcs-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	background: var(--ffcs-bg);
	transition: background-color .25s var(--ffcs-ease), color .25s var(--ffcs-ease), border-color .25s var(--ffcs-ease);
}
.ffcs-chip:hover { border-color: var(--ffcs-ink); }
.ffcs-chip[aria-current="true"] {
	background: var(--ffcs-accent);
	border-color: var(--ffcs-accent);
	color: var(--ffcs-accent-ink);
}
.ffcs-chip__count {
	font-size: 12px;
	opacity: .6;
	font-variant-numeric: tabular-nums;
}

/* ---------- Section ---------- */
.ffcs-section {
	scroll-margin-top: calc(var(--ffcs-sticky-top) + 84px);
	padding-block: clamp(20px, 3vw, 36px);
	border-block-start: 1px solid var(--ffcs-line);
}
.ffcs-nav + .ffcs-section, .ffcs > .ffcs-section:first-child { border-block-start: 0; padding-block-start: 0; }

.ffcs-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	flex-wrap: wrap;
	margin-block-end: clamp(16px, 2vw, 24px);
}
.ffcs-head__text { min-width: 0; max-width: 62ch; }
.ffcs-head__eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ffcs-muted);
}
.ffcs-head__title {
	margin: 0;
	font-size: clamp(22px, 2.4vw, 32px);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
}
.ffcs-head__title a { background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1.5px; transition: background-size .35s var(--ffcs-ease); }
.ffcs-head__title a:hover { background-size: 100% 1.5px; }
.ffcs-head__desc { margin: 8px 0 0; font-size: 14px; line-height: 1.8; color: var(--ffcs-muted); }

.ffcs-head__actions { display: flex; align-items: center; gap: 14px; }

.ffcs-viewall {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 600;
	padding-block: 6px;
	border-block-end: 1.5px solid currentColor;
	white-space: nowrap;
}
.ffcs-viewall svg { transition: transform .3s var(--ffcs-ease); }
.ffcs-viewall:hover svg { transform: translateX(3px); }

.ffcs-arrows { display: none; gap: 8px; }
.ffcs.is-ready .ffcs-arrows { display: flex; }
.ffcs-section.no-overflow .ffcs-arrows { display: none; }

.ffcs-arrow {
	display: grid;
	place-items: center;
	inline-size: 42px;
	block-size: 42px;
	padding: 0;
	border: 1px solid var(--ffcs-line);
	border-radius: 50%;
	background: var(--ffcs-bg);
	color: var(--ffcs-ink);
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.ffcs-arrow:hover:not(:disabled) { background: var(--ffcs-ink); border-color: var(--ffcs-ink); color: var(--ffcs-bg); }
.ffcs-arrow:disabled { opacity: .35; cursor: default; }

/* RTL: mirror directional icons (two rules so an unsupported :dir() can't break the other) */
[dir="rtl"] .ffcs-arrow svg, [dir="rtl"] .ffcs-viewall svg { transform: scaleX(-1); }
.ffcs:dir(rtl) .ffcs-arrow svg, .ffcs:dir(rtl) .ffcs-viewall svg { transform: scaleX(-1); }
[dir="rtl"] .ffcs-viewall:hover svg { transform: scaleX(-1) translateX(3px); }
.ffcs:dir(rtl) .ffcs-viewall:hover svg { transform: scaleX(-1) translateX(3px); }

/* ---------- Track: carousel (default) ---------- */
.ffcs-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--ffcs-cols) - 1) * var(--ffcs-gap)) / var(--ffcs-cols));
	gap: var(--ffcs-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-block-end: 4px;
}
.ffcs-track::-webkit-scrollbar { display: none; }
.ffcs-item { scroll-snap-align: start; min-width: 0; }

/* ---------- Track: grid ---------- */
.ffcs--grid .ffcs-track {
	grid-auto-flow: row;
	grid-template-columns: repeat(var(--ffcs-cols), minmax(0, 1fr));
	grid-auto-columns: auto;
	overflow: visible;
	row-gap: calc(var(--ffcs-gap) * 1.6);
}

@media (max-width: 1024px) { .ffcs { --ffcs-cols: 3; } }
@media (max-width: 768px)  { .ffcs { --ffcs-cols: 2; } }
@media (max-width: 600px) {
	/* Carousel on phones: show 1.4 cards so people know they can swipe */
	.ffcs--carousel .ffcs-track { grid-auto-columns: 68%; }
	.ffcs-head { align-items: flex-start; }
	.ffcs-head__actions { width: 100%; justify-content: space-between; }
}

/* ---------- Product card ---------- */
.ffcs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
}
.ffcs-card__media {
	position: relative;
	aspect-ratio: var(--ffcs-ratio);
	overflow: hidden;
	border-radius: var(--ffcs-radius);
	background: var(--ffcs-surface);
	isolation: isolate;
}
.ffcs-card__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	margin: 0 !important;
	transition: transform .8s var(--ffcs-ease), opacity .5s var(--ffcs-ease);
}
.ffcs-card__img--hover { opacity: 0; }

/* Typographic tile for products without a featured image */
.ffcs-card__ph {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	text-align: center;
	background:
		repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 2px, transparent 2px 9px),
		linear-gradient(160deg, #eeebe6, #dcd6ce);
	transition: transform .8s var(--ffcs-ease);
}
.ffcs-card__ph span {
	font-size: clamp(16px, 1.6vw, 22px);
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(27, 26, 25, .55);
}

@media (hover: hover) and (pointer: fine) {
	.ffcs-card:hover .ffcs-card__img, .ffcs-card:hover .ffcs-card__ph { transform: scale(1.045); }
	.ffcs-card:hover .ffcs-card__media.has-hover .ffcs-card__img--hover { opacity: 1; }
}

.ffcs-card.is-oos .ffcs-card__img:not(.ffcs-card__img--hover) { filter: grayscale(.6); opacity: .75; }

.ffcs-badge {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 1;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	background: var(--ffcs-sale);
	color: #fff;
}
.ffcs-badge--muted { background: rgba(27, 26, 25, .78); }
.ffcs-badge--soft { background: var(--ffcs-bg); color: var(--ffcs-ink); }

.ffcs-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-block-start: 12px;
	flex: 1;
}
.ffcs-card__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Whole card is clickable through one real <a> (good for a11y and crawlers) */
.ffcs-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--ffcs-radius); }
.ffcs-card__link:focus-visible { outline: none; }
.ffcs-card__link:focus-visible::after { outline: 2px solid var(--ffcs-ink); outline-offset: 4px; }

.ffcs-card__price { font-size: 14px; font-weight: 600; color: var(--ffcs-ink); font-variant-numeric: tabular-nums; }
.ffcs-card__price del { color: var(--ffcs-muted); font-weight: 400; margin-inline-end: 6px; opacity: .8; }
.ffcs-card__price ins { text-decoration: none; color: var(--ffcs-sale); background: none; }

.ffcs-btn, .ffcs .added_to_cart {
	position: relative;
	z-index: 2; /* above the stretched card link */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	min-height: 40px;
	margin-block-start: auto;
	padding: 9px 18px;
	border: 1px solid var(--ffcs-ink);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: var(--ffcs-ink) !important;
	background: transparent;
	transition: background-color .2s, color .2s;
}
.ffcs-btn:hover { background: var(--ffcs-ink); color: var(--ffcs-bg) !important; }
.ffcs-btn.loading { opacity: .6; pointer-events: none; }
.ffcs-btn.added::after { content: " ✓"; margin-inline-start: 4px; }
.ffcs .added_to_cart { margin-block-start: 6px; border-color: transparent; padding-inline: 2px; text-decoration: underline; text-underline-offset: 4px; }
.ffcs-card__price { margin-block-end: 8px; }

/* ---------- "View all" tile at the end of each row ---------- */
.ffcs-more {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 8px;
	aspect-ratio: var(--ffcs-ratio);
	padding: 20px;
	text-align: center;
	border-radius: var(--ffcs-radius);
	background: var(--ffcs-surface);
	border: 1px dashed var(--ffcs-line);
	transition: background-color .3s var(--ffcs-ease);
}
.ffcs-more:hover { background: var(--ffcs-line); }
.ffcs-more__count { font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1; }
.ffcs-more__label { font-size: 14px; color: var(--ffcs-muted); }
.ffcs-more__cta { margin-block-start: 6px; font-size: 13px; font-weight: 700; border-block-end: 1.5px solid currentColor; padding-block-end: 2px; }
.ffcs--grid .ffcs-more { height: 100%; aspect-ratio: auto; min-height: 220px; }

/* ---------- Focus & motion ---------- */
.ffcs a:focus-visible, .ffcs button:focus-visible { outline: 2px solid var(--ffcs-ink); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	.ffcs *, .ffcs *::before, .ffcs *::after { transition: none !important; animation: none !important; }
}

/* Theme-proofing + smaller top gap on the shop page (XTRA theme) */
.ffcs ul, .ffcs li { list-style: none !important; }
.ffcs-shop-page .page_content { margin-top: 24px !important; }
