/*
 * AquaNetica Marketplace: the Featured band (1.18.0, restyled 1.19.0).
 *
 * One band per section (Used, New, Feed), above search and filters. Plain CSS
 * scroll-snap, no carousel library. Own aqnm-fband / aqnm-fcard names only,
 * never shared selectors, because the cache plugin combines stylesheets. It
 * carries its own tokens because the Feed page does not load marketplace.css.
 *
 * 1.19.0 matches the live marketplace page rather than the plugin's teal:
 * white band, the page's grey line, dark pills, the grid card's rounded
 * light-grey photo frame, and headings at weight 400.
 *
 * Layout by how many are featured (class set by the PHP):
 *   --n1    one wide horizontal card, photo left about 45%, details right
 *   --n2    two cards at the three-up size, left aligned
 *   --n3    one full row of three
 *   --nmany a carousel, three visible on desktop, arrows
 * Desktop 1024px and up shows three per row, tablet 768 to 1023 two, phones
 * one card at about 85% of the screen with the next one peeking in.
 */

.aqnm-fband {
	--fb-ink: rgb(17, 20, 24);
	--fb-muted: rgb(111, 111, 106);
	--fb-line: rgb(214, 220, 223);
	--fb-bg: #fff;
	--fb-frame: rgb(245, 247, 248);
	--fb-primary: rgb(43, 43, 43);
	--fb-primary-hover: rgb(17, 20, 24);
	--fb-primary-ink: #fff;
	--fb-pill-bg: #fff;
	--fb-badge: rgb(43, 43, 43);
	--fb-gap: 22px;

	box-sizing: border-box;
	margin: 8px 0 32px;
	padding: 24px 24px 26px;
	background: var(--fb-bg);
	border: 1px solid var(--fb-line);
	border-radius: 18px;
	color: var(--fb-ink);
	font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.aqnm-fband *, .aqnm-fband *::before, .aqnm-fband *::after { box-sizing: border-box; }

/* Hidden while a buyer searches or filters. The browse scripts set this. */
[data-aqnm-filtering="1"] .aqnm-fband { display: none; }

.aqnm-fband-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; margin: 0 0 18px; min-height: 44px;
}
/* Same as the page's section headings ("Browse new equipment"). */
.aqnm-fband-title {
	margin: 0; padding: 0;
	font-family: inherit; font-size: 20px; line-height: 1.1;
	font-weight: 400; letter-spacing: -0.035em; text-transform: none;
	color: var(--fb-ink);
}
.aqnm-fband .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Arrows: the page's secondary pill ("List an item"), as 44px circles. */
.aqnm-fband-nav { display: flex; gap: 8px; }
.aqnm-fband-nav[hidden] { display: none; }
.aqnm-fband-arrow {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; min-width: 44px; padding: 0; margin: 0;
	border-radius: 999px; border: 1px solid var(--fb-line);
	background: var(--fb-pill-bg); color: var(--fb-ink);
	box-shadow: none; cursor: pointer; line-height: 1;
	transition: border-color .15s ease, background-color .15s ease;
}
.aqnm-fband-arrow:hover:not([aria-disabled="true"]) { border-color: var(--fb-ink); background: var(--fb-pill-bg); color: var(--fb-ink); }
.aqnm-fband-arrow:focus-visible { outline: 2px solid var(--fb-ink); outline-offset: 2px; }
.aqnm-fband-arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
.aqnm-fband-arrow svg { display: block; }

/* The track: native horizontal scroll with snap points. */
.aqnm-fband-track {
	list-style: none; margin: 0; padding: 2px;
	display: flex; gap: var(--fb-gap);
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.aqnm-fband-track::-webkit-scrollbar { display: none; }
.aqnm-fband-track:focus-visible { outline: 2px solid var(--fb-ink); outline-offset: 4px; border-radius: 12px; }
@media (prefers-reduced-motion: no-preference) {
	.aqnm-fband-track { scroll-behavior: smooth; }
}

/* Desktop: three per row. */
.aqnm-fband-item {
	flex: 0 0 calc((100% - 2 * var(--fb-gap)) / 3);
	min-width: 0; margin: 0; padding: 0;
	scroll-snap-align: start;
	display: flex;
}

/* The card: the grid card's language. No box, a rounded photo, text below. */
.aqnm-fcard {
	display: flex; flex-direction: column; width: 100%;
	background: transparent; border: 0; border-radius: 0; box-shadow: none;
	text-decoration: none !important; color: var(--fb-ink);
}
.aqnm-fcard:focus-visible { outline: 2px solid var(--fb-ink); outline-offset: 4px; border-radius: 24px; }

.aqnm-fcard-media {
	position: relative; display: block; flex: 0 0 auto;
	width: 100%; aspect-ratio: 4 / 3;
	max-height: 276px;   /* keeps a card under about 480px on desktop */
	background: var(--fb-frame);
	border-radius: 24px; overflow: hidden;
}
.aqnm-fcard-media img,
.aqnm-fcard-img {
	position: absolute; inset: 0;
	width: 100% !important; height: 100% !important; max-width: none;
	object-fit: cover; display: block; margin: 0; border-radius: 0;
	transition: transform .35s ease;
}
@media (prefers-reduced-motion: no-preference) {
	.aqnm-fcard:hover .aqnm-fcard-img { transform: scale(1.03); }
}
/* Same size as the grid's condition chip on the photo, but dark. */
.aqnm-fcard-badge {
	position: absolute; top: 12px; left: 12px;
	display: inline-block; padding: 6px 12px; border-radius: 999px;
	background: var(--fb-badge); color: #fff;
	font-size: 12px; font-weight: 500; line-height: 1.2;
	letter-spacing: normal; text-transform: none;
}

.aqnm-fcard-body {
	display: flex; flex-direction: column; align-items: flex-start;
	gap: 6px; padding: 14px 2px 0; flex: 1 1 auto;
}
/* Secondary pill, as "List an item". */
.aqnm-fcard-chip {
	display: inline-block; padding: 5px 11px; border-radius: 999px;
	background: var(--fb-pill-bg); color: var(--fb-ink);
	border: 1px solid var(--fb-line);
	font-size: 12px; font-weight: 500; line-height: 1.2;
}
.aqnm-fcard-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-size: 18px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; color: var(--fb-ink);
}
.aqnm-fcard-price {
	font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--fb-ink);
}
.aqnm-fcard-place {
	font-size: 13px; line-height: 1.35; color: var(--fb-muted);
}
/* Primary pill, as the dark "Used equipment" tab. */
.aqnm-fcard-cta {
	margin-top: auto; margin-block-start: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 20px;
	border-radius: 999px; background: var(--fb-primary); color: var(--fb-primary-ink);
	font-size: 14px; font-weight: 500; line-height: 1;
	transition: background-color .15s ease;
}
.aqnm-fcard:hover .aqnm-fcard-cta { background: var(--fb-primary-hover); }

/* One featured listing: a wide horizontal card. */
.aqnm-fband--n1 .aqnm-fband-item { flex-basis: 100%; }
@media (min-width: 768px) {
	.aqnm-fband--n1 .aqnm-fcard {
		display: grid; grid-template-columns: 45% 1fr; align-items: center; gap: 0;
	}
	.aqnm-fband--n1 .aqnm-fcard-media { max-height: none; }   /* true 4:3, about 390px tall at 1280 */
	.aqnm-fband--n1 .aqnm-fcard-body { justify-content: center; padding: 8px 8px 8px 32px; gap: 8px; }
	.aqnm-fband--n1 .aqnm-fcard-title { font-size: 22px; -webkit-line-clamp: 3; }
	.aqnm-fband--n1 .aqnm-fcard-price { font-size: 18px; }
	.aqnm-fband--n1 .aqnm-fcard-cta { margin-top: 10px; }
}

/* Tablet: two per row. */
@media (min-width: 768px) and (max-width: 1023px) {
	.aqnm-fband-item { flex-basis: calc((100% - var(--fb-gap)) / 2); }
	.aqnm-fband--n1 .aqnm-fband-item { flex-basis: 100%; }
}

/* Phones: one card at about 85% of the screen, the next one peeking in. */
@media (max-width: 767px) {
	/* Edge to edge, so 85% is of the SCREEN rather than the page column. */
	.aqnm-fband {
		--fb-gap: 14px;
		padding: 18px 0 20px; margin: 4px 0 24px;
		margin-inline: calc(50% - 50vw); width: 100vw; max-width: 100vw;
		border-radius: 0; border-left: 0; border-right: 0;
	}
	.aqnm-fband-head { padding: 0 16px; margin-bottom: 14px; }
	.aqnm-fband-track { padding: 2px 16px; scroll-padding-inline: 16px; }
	.aqnm-fband-item { flex-basis: 85vw; }
	.aqnm-fband--n1 .aqnm-fband-item { flex-basis: 100%; }
	.aqnm-fcard-title { font-size: 17px; }
	.aqnm-fcard-cta { align-self: stretch; }
}

/* Dark: the site's own switches, with a solid background behind the band. */
:root[data-theme="dark"] .aqnm-fband, body.is-dark .aqnm-fband {
	--fb-ink: #f1f5f9;
	--fb-muted: #a3a8ae;
	--fb-line: rgba(255, 255, 255, .14);
	--fb-bg: #121417;
	--fb-frame: #1c1f24;
	--fb-primary: #f1f5f9;
	--fb-primary-hover: #fff;
	--fb-primary-ink: rgb(17, 20, 24);
	--fb-pill-bg: transparent;
	--fb-badge: rgb(43, 43, 43);
}
:root[data-theme="dark"] .aqnm-fcard-badge, body.is-dark .aqnm-fcard-badge { box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
