/**
 * Fooppers Premium Picks — frontend rail
 *
 * Sits on the page background like the Trending and Price Ladder rails —
 * no panel, no banner, no tinted section. Header uses the same eyebrow /
 * title / sub structure as those rails.
 *
 * The cards follow the quick-commerce pattern: a white tile holding image,
 * pack size and an outlined ADD button overlapping the image corner, with
 * price, discount and name on the page background beneath the tile.
 *
 * Everything scoped under .fpp-* so nothing leaks into the theme.
 */

.fpp-rail {
	--fpp-ink: #14171a;
	--fpp-muted: #6b7280;
	--fpp-line: #e8eaed;
	--fpp-surface: #fff;

	--fpp-green: #1b5e43;
	--fpp-green-deep: #14472f;
	--fpp-gold: #8a6a14;
	--fpp-gold-bg: #f7efdc;
	--fpp-off: #1f6bb8;

	--fpp-card-w: 158px;

	margin: 24px 0;
	padding: 0;
}

.fpp-rail *,
.fpp-rail *::before,
.fpp-rail *::after {
	box-sizing: border-box;
}

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

.fpp-rail .fpp-eyebrow {
	margin: 0 0 2px;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--fpp-gold);
}

.fpp-rail .fpp-title {
	margin: 0;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 800;
	color: var(--fpp-ink);
}

.fpp-rail .fpp-sub {
	margin: 4px 0 0;
	max-width: 52ch;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 13px;
	line-height: 1.4;
	color: var(--fpp-muted);
}

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

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

/* ── Card ─────────────────────────────────────────────────────── */
.fpp-rail .fpp-card {
	flex: 0 0 var(--fpp-card-w);
	width: var(--fpp-card-w);
	scroll-snap-align: start;
}

/* White tile: image + pack + ADD only. Price and name sit below it. */
.fpp-rail .fpp-tile {
	position: relative;
	background: var(--fpp-surface);
	border: 1px solid var(--fpp-line);
	border-radius: 12px;
	transition: box-shadow .18s ease, border-color .18s ease;
}

.fpp-rail .fpp-card:hover .fpp-tile {
	border-color: #d8dbdf;
	box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
}

.fpp-rail .fpp-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
	background: #f6f7f8;
}

.fpp-rail .fpp-media img,
.fpp-rail .fpp-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

/* ── Corner tag ───────────────────────────────────────────────── */
.fpp-rail .fpp-badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	padding: 4px 9px;
	border-radius: 12px 0 8px 0;
	background: var(--fpp-gold-bg);
	color: var(--fpp-gold);
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1.4;
}

/* ── Pack + ADD strip ─────────────────────────────────────────── */
.fpp-rail .fpp-strip {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 6px 72px 8px 10px;
}

.fpp-rail .fpp-pack {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fpp-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* The button rides up over the image corner. */
.fpp-rail .fpp-add {
	position: absolute;
	right: 8px;
	top: -20px;
	z-index: 3;
	min-width: 60px;
	padding: 10px 12px;
	border: 1.5px solid var(--fpp-green);
	border-radius: 10px;
	background: var(--fpp-surface);
	color: var(--fpp-green);
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .04em;
	line-height: 1;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(27, 94, 67, .14);
	transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.fpp-rail .fpp-add:hover:not(:disabled),
.fpp-rail .fpp-add:focus:not(:disabled) {
	background: var(--fpp-green);
	color: #fff;
	box-shadow: 0 4px 12px rgba(27, 94, 67, .24);
}

.fpp-rail .fpp-add:focus-visible {
	outline: 2px solid var(--fpp-green-deep);
	outline-offset: 2px;
}

.fpp-rail .fpp-add:disabled {
	opacity: .85;
	cursor: default;
}

.fpp-rail .fpp-add.is-done {
	background: var(--fpp-green);
	border-color: var(--fpp-green);
	color: #fff;
}

/* ── Info below the tile ──────────────────────────────────────── */
.fpp-rail .fpp-info {
	padding: 10px 2px 0;
	font-family: "DM Sans", system-ui, sans-serif;
}

.fpp-rail .fpp-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin: 0;
}

.fpp-rail .fpp-now {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--fpp-ink);
}

.fpp-rail .fpp-was {
	font-size: 13px;
	font-weight: 500;
	color: #9ca3af;
}

.fpp-rail .fpp-off {
	margin: 2px 0 0;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--fpp-off);
}

.fpp-rail .fpp-name {
	margin: 4px 0 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.32;
	color: var(--fpp-ink);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fpp-rail .fpp-name a {
	color: inherit;
	text-decoration: none;
}

.fpp-rail .fpp-name a:focus-visible {
	outline: 2px solid var(--fpp-green);
	outline-offset: 2px;
}

.fpp-rail .fpp-note {
	margin: 6px 0 0;
	font-size: 12px;
	font-weight: 500;
	color: var(--fpp-muted);
}

/* ── See all ──────────────────────────────────────────────────── */
.fpp-rail .fpp-seeall {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 14px 16px 0;
	padding: 13px 16px;
	border: 1px solid var(--fpp-line);
	border-radius: 12px;
	background: var(--fpp-surface);
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: var(--fpp-green-deep);
	text-decoration: none;
}

.fpp-rail .fpp-seeall:hover {
	border-color: #d8dbdf;
	color: var(--fpp-green-deep);
}

.fpp-rail .fpp-seeall-arrow {
	font-size: 19px;
	line-height: 1;
}

/* ── Standalone premium page ──────────────────────────────────── */
/* Inherits width, header and footer from the theme's page template —
   only the grid is styled here. */
.fpp-page {
	margin: 0 0 8px;
}

.fpp-page .fpp-head {
	padding: 0;
	margin-bottom: 18px;
}

.fpp-page .fpp-title {
	font-size: 24px;
}

.fpp-page .fpp-count {
	margin: 8px 0 0;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--fpp-gold);
}

.fpp-page .fpp-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fpp-page .fpp-grid .fpp-card {
	flex: none;
	width: auto;
}

.fpp-page .fpp-empty {
	margin: 0;
	padding: 24px 0;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	color: var(--fpp-muted);
}

@media (min-width: 600px) {
	.fpp-page .fpp-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px 16px;
	}
}

@media (min-width: 900px) {
	.fpp-page .fpp-title {
		font-size: 30px;
	}

	.fpp-page .fpp-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 24px 18px;
	}
}

/* ── Toast ────────────────────────────────────────────────────── */
.fpp-rail .fpp-toast {
	margin: 10px 16px 0;
	padding: 9px 13px;
	border-radius: 8px;
	background: rgba(20, 23, 26, .92);
	color: #fff;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 12.5px;
	font-weight: 600;
}

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

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

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

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

	.fpp-rail .fpp-card {
		width: auto;
	}

	.fpp-rail .fpp-seeall,
	.fpp-rail .fpp-toast {
		margin-left: 0;
		margin-right: 0;
	}
}

/* Beyond five across the cards get too narrow to read, so wrap instead. */
@media (min-width: 900px) and (max-width: 1399px) {
	.fpp-rail .fpp-track {
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	}
}

/* ── Accessibility ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.fpp-rail .fpp-tile,
	.fpp-rail .fpp-add {
		transition: none;
	}
}
