/**
 * Fooppers Trending — frontend rail
 * Every selector is scoped under .fptr-* so nothing leaks into the
 * Poco child theme or the other Fooppers plugins.
 */

.fptr-rail {
	--fptr-radius: 14px;
	--fptr-gap: 12px;
	--fptr-card-w: 158px;
	--fptr-ink: #14171a;
	--fptr-muted: #6b7280;
	--fptr-line: #e8eaed;
	--fptr-surface: #fff;
	--fptr-hot: #e23b26;
	--fptr-rise: #0f7a4a;
	--fptr-fav: #a16207;

	margin: 24px 0;
	padding: 0;
}

/* ── Header ───────────────────────────────────────────────────── */
.fptr-rail .fptr-head {
	padding: 0 16px;
	margin-bottom: 12px;
}

.fptr-rail .fptr-eyebrow {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--fptr-muted);
}

.fptr-rail .fptr-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 800;
	color: var(--fptr-ink);
}

.fptr-rail .fptr-sub {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--fptr-muted);
}

/* ── Track ────────────────────────────────────────────────────── */
.fptr-rail .fptr-track {
	display: flex;
	gap: var(--fptr-gap);
	margin: 0;
	padding: 4px 16px 8px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.fptr-rail .fptr-track::-webkit-scrollbar {
	display: none;
}

/* ── Card ─────────────────────────────────────────────────────── */
.fptr-rail .fptr-card {
	position: relative;
	flex: 0 0 var(--fptr-card-w);
	width: var(--fptr-card-w);
	display: flex;
	flex-direction: column;
	background: var(--fptr-surface);
	border: 1px solid var(--fptr-line);
	border-radius: var(--fptr-radius);
	overflow: hidden;
	scroll-snap-align: start;
	transition: box-shadow .18s ease, transform .18s ease;
}

.fptr-rail .fptr-card:hover {
	box-shadow: 0 6px 18px rgba(16, 24, 40, .09);
	transform: translateY(-2px);
}

.fptr-rail .fptr-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
}

.fptr-rail .fptr-link:focus-visible {
	outline: 2px solid var(--fptr-ink);
	outline-offset: -2px;
}

/* ── Media ────────────────────────────────────────────────────── */
.fptr-rail .fptr-media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #f6f7f8;
	overflow: hidden;
}

.fptr-rail .fptr-media img,
.fptr-rail .fptr-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Badge ────────────────────────────────────────────────────── */
.fptr-rail .fptr-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: calc(100% - 16px);
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 1px 3px rgba(16, 24, 40, .16);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fptr-rail .fptr-badge-icon {
	font-size: 12px;
}

.fptr-rail .fptr-badge--rank      { color: var(--fptr-hot); }
.fptr-rail .fptr-badge--riser     { color: var(--fptr-rise); }
.fptr-rail .fptr-badge--favourite { color: var(--fptr-fav); }

/* ── Body ─────────────────────────────────────────────────────── */
.fptr-rail .fptr-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 10px 10px 8px;
	flex: 1 1 auto;
}

.fptr-rail .fptr-name {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fptr-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fptr-rail .fptr-meta {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fptr-muted);
}

.fptr-rail .fptr-price {
	margin-top: auto;
	padding-top: 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--fptr-ink);
}

.fptr-rail .fptr-price del {
	font-weight: 500;
	font-size: 12px;
	opacity: .55;
	margin-right: 4px;
}

.fptr-rail .fptr-price ins {
	text-decoration: none;
}

/* ── Add button ───────────────────────────────────────────────── */
.fptr-rail .fptr-add {
	display: block;
	margin: 0 10px 10px;
	padding: 8px 10px;
	border: 1px solid var(--fptr-hot);
	border-radius: 10px;
	background: var(--fptr-hot);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.fptr-rail .fptr-add:hover,
.fptr-rail .fptr-add:focus {
	background: #c8321f;
	border-color: #c8321f;
	color: #fff;
}

.fptr-rail .fptr-add--options {
	background: transparent;
	color: var(--fptr-hot);
}

.fptr-rail .fptr-add--options:hover,
.fptr-rail .fptr-add--options:focus {
	background: var(--fptr-hot);
	color: #fff;
}

.fptr-rail .fptr-add.loading {
	opacity: .65;
	pointer-events: none;
}

.fptr-rail .fptr-add.added {
	background: var(--fptr-rise);
	border-color: var(--fptr-rise);
}

/* WooCommerce injects a "View cart" link after an ajax add — keep it quiet. */
.fptr-rail .added_to_cart {
	display: block;
	margin: -4px 10px 10px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	color: var(--fptr-muted);
}

/* ── Desktop: grid instead of scroll ──────────────────────────── */
@media (min-width: 900px) {
	.fptr-rail {
		--fptr-card-w: auto;
	}

	.fptr-rail .fptr-head {
		padding: 0;
	}

	.fptr-rail .fptr-track {
		display: grid;
		grid-template-columns: repeat(var(--fptr-count, 6), 1fr);
		gap: 16px;
		padding: 4px 0 8px;
		overflow: visible;
	}

	.fptr-rail .fptr-card {
		flex: 1 1 auto;
		width: auto;
	}

	.fptr-rail .fptr-title { font-size: 22px; }
}

@media (min-width: 900px) and (max-width: 1199px) {
	.fptr-rail .fptr-track {
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	}
}

/* ── Accessibility ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.fptr-rail .fptr-card {
		transition: none;
	}
	.fptr-rail .fptr-card:hover {
		transform: none;
	}
}
