/* Fooppers Buy Again — shared pieces (homepage block + standalone page).
   Everything is scoped under .fbga so nothing leaks into anything else. */

.fbga {
	--fbga-cream: #f8f6f3;
	--fbga-paper: #ffffff;
	--fbga-crimson: #c0392b;
	--fbga-ink: #1c1917;
	--fbga-muted: #736c65;
	--fbga-faint: #9c948d;
	--fbga-line: #ebe5de;
	--fbga-green: #157f4e;
	--fbga-shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04), 0 2px 6px rgba(28, 25, 23, 0.05);
	--fbga-shadow-md: 0 2px 4px rgba(28, 25, 23, 0.05), 0 8px 20px rgba(28, 25, 23, 0.07);

	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--fbga-ink);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.fbga *,
.fbga *::before,
.fbga *::after {
	box-sizing: inherit;
}

.fbga img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* `.fbga a` outranks single-class component rules, so an anchor with its own
   class would silently inherit its parent's colour - which is how the green
   cart bar's "View cart" ended up white on white. Only unclassed anchors
   inherit; anything with a class owns its colour. */
.fbga a {
	text-decoration: none;
}

.fbga a:not([class]) {
	color: inherit;
}

.fbga [hidden] {
	display: none !important;
}

.fbga :focus-visible {
	outline: 2px solid var(--fbga-crimson);
	outline-offset: 2px;
	border-radius: 6px;
}

.fbga-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* WooCommerce and some themes append their own "View cart" link after an
   add-to-cart button. This page renders its own cart bar and sheet, so any
   such injected link is redundant and would land inside the image frame. */
.fbga .added_to_cart,
.fbga .wc-forward {
	display: none !important;
}

.fbga-diag {
	margin: 0;
	padding: 14px 16px;
	background: #fff6e8;
	border: 1px dashed #d9a441;
	border-radius: 12px;
	font-size: 12.5px;
	line-height: 1.5;
	color: #6b5327;
}

/* ------------------------------------------------- homepage block wrapper */

.fbga-block {
	padding: 18px 14px 18px;
	background:
		radial-gradient(120% 100% at 0% 0%, rgba(192, 57, 43, 0.05) 0%, rgba(192, 57, 43, 0) 55%),
		var(--fbga-paper);
	border: 1px solid var(--fbga-line);
	border-radius: 18px;
	margin: 14px 0;
	box-shadow: var(--fbga-shadow-sm);
}

.fbga-block__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.fbga-block__heading {
	min-width: 0;
}

.fbga-block__kicker {
	margin: 0 0 4px;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fbga-crimson);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fbga-block__title {
	margin: 0;
	font-size: 19px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0;
}

.fbga-block__link {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--fbga-crimson);
	white-space: nowrap;
	padding: 6px 12px;
	border: 1px solid rgba(192, 57, 43, 0.28);
	border-radius: 999px;
	transition: background 0.15s ease;
}

.fbga-block__link:hover {
	background: rgba(192, 57, 43, 0.06);
}

.fbga-seeall {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--fbga-cream);
	border: 1px solid var(--fbga-line);
	border-radius: 14px;
	padding: 11px 14px;
	margin-top: 14px;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.fbga-seeall:hover {
	background: #f3ede6;
	border-color: rgba(192, 57, 43, 0.24);
}

.fbga-seeall__stack {
	display: flex;
	flex: 0 0 auto;
}

.fbga-seeall__stack img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--fbga-paper);
	background: var(--fbga-paper);
}

.fbga-seeall__stack img + img {
	margin-left: -12px;
}

.fbga-seeall__label {
	font-size: 15px;
	font-weight: 700;
	flex: 1 1 auto;
	color: var(--fbga-crimson);
}

.fbga-seeall__chev {
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--fbga-crimson);
	border-bottom: 2px solid var(--fbga-crimson);
	transform: rotate(-45deg);
	flex: 0 0 auto;
}

/* ------------------------------------------------------ category clusters */

.fbga-clusters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.fbga-cluster {
	background: var(--fbga-paper);
	border: 1px solid var(--fbga-line);
	border-radius: 16px;
	padding: 0 0 11px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 9px;
	box-shadow: var(--fbga-shadow-sm);
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.fbga-cluster:hover {
	box-shadow: var(--fbga-shadow-md);
	transform: translateY(-1px);
}

.fbga-cluster:active {
	transform: translateY(0);
}

.fbga-cluster__tiles {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px;
}

.fbga-cluster__tile {
	background: var(--fbga-cream);
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.fbga-cluster__tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fbga-cluster__more {
	position: absolute;
	right: 4px;
	bottom: 4px;
	background: rgba(28, 25, 23, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	padding: 4px 7px;
	border-radius: 7px;
	white-space: nowrap;
	letter-spacing: 0.01em;
}

.fbga-cluster__name {
	padding: 0 7px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.005em;
	text-align: center;
	margin: 4px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: break-word;
	min-height: 2.6em;
}

.fbga-mini {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.fbga-minicard {
	background: var(--fbga-paper);
	border: 1px solid var(--fbga-line);
	border-radius: 16px;
	padding: 9px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	box-shadow: var(--fbga-shadow-sm);
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.fbga-minicard:hover {
	box-shadow: var(--fbga-shadow-md);
	transform: translateY(-1px);
}

.fbga-minicard__tile {
	background: var(--fbga-cream);
	border-radius: 12px;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.fbga-minicard__tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fbga-minicard__name {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: break-word;
	min-height: 2.6em;
	display: -webkit-box;
}

/* --------------------------------------------------------- product cards */

.fbga-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px 12px;
}

.fbga-card {
	display: flex;
	flex-direction: column;
}

.fbga-card__media {
	position: relative;
	background: var(--fbga-paper);
	border: 1px solid var(--fbga-line);
	border-radius: 14px;
	aspect-ratio: 1 / 1;
	overflow: visible;
	box-shadow: var(--fbga-shadow-sm);
}

.fbga-card__media a {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 13px;
	overflow: hidden;
}

.fbga-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.15s ease, filter 0.15s ease;
}

.fbga-card__media.is-out img {
	opacity: 0.5;
	filter: grayscale(0.3);
}

.fbga-chip {
	position: absolute;
	top: 6px;
	left: 6px;
	z-index: 1;
	max-width: calc(100% - 12px);
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--fbga-muted);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fbga-off {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 1;
	background: var(--fbga-green);
	color: #fff;
	font-size: 9.5px;
	font-weight: 700;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 5px;
}

/* The homepage block sits inside the live theme, where button rules like
   `.woocommerce a.button` outrank a single class. These declarations are
   forced so the control keeps its own identity wherever it is embedded -
   without this the theme repaints it as a yellow WooCommerce button. */
.fbga .fbga-add,
.fbga a.fbga-add,
.fbga button.fbga-add {
	position: absolute;
	right: 6px;
	bottom: 6px;
	z-index: 2;
	min-width: 50px;
	width: auto;
	height: auto;
	margin: 0;
	background: rgba(255, 255, 255, 0.96) !important;
	background-image: none !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--fbga-crimson) !important;
	border: 1px solid var(--fbga-crimson) !important;
	border-radius: 8px !important;
	font-family: inherit !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase !important;
	text-decoration: none !important;
	line-height: 1 !important;
	padding: 7px 9px !important;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(28, 25, 23, 0.1);
	transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.fbga .fbga-add:hover {
	background: #fbeeec !important;
}

.fbga-add:active {
	transform: scale(0.94);
}

.fbga-add.is-busy {
	opacity: 0.55;
	pointer-events: none;
}

.fbga .fbga-add.is-done {
	background: var(--fbga-crimson) !important;
	color: #fff !important;
}

.fbga .fbga-add.is-out {
	border-color: var(--fbga-line) !important;
	color: var(--fbga-faint) !important;
	background: var(--fbga-cream) !important;
	box-shadow: none;
	cursor: default;
}

.fbga-card__body {
	padding-top: 9px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fbga-card__price {
	margin: 0;
	font-size: 14.5px;
	font-weight: 700;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 6px;
	min-width: 0;
}

.fbga-card__price > span {
	white-space: nowrap;
}

.fbga-card__price s {
	font-size: 12px;
	font-weight: 400;
	color: var(--fbga-faint);
}

.fbga-card__save {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	color: var(--fbga-green);
}

.fbga-card__name {
	margin-top: 2px;
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--fbga-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: break-word;
}

.fbga-card__foot {
	margin: 3px 0 0;
	font-size: 11px;
	color: var(--fbga-muted);
}

.fbga-card__low {
	color: var(--fbga-crimson);
	font-weight: 700;
}

/* ---------------------------------------------------------- skeletons */

.fbga-skel {
	border-radius: 16px;
	background: linear-gradient(100deg, var(--fbga-line) 30%, #f5f1ec 50%, var(--fbga-line) 70%);
	background-size: 300% 100%;
	animation: fbga-shimmer 1.4s linear infinite;
}

.fbga-skel--row {
	height: 132px;
	margin-bottom: 14px;
}

.fbga-skel--grid {
	height: 280px;
}

@keyframes fbga-shimmer {
	0% {
		background-position: 150% 0;
	}
	100% {
		background-position: -50% 0;
	}
}

/* ------------------------------------------------------------- larger */

@media (min-width: 560px) {
	.fbga-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 32px 16px;
	}

	.fbga-mini {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (min-width: 820px) {
	.fbga-block {
		padding: 24px 22px 26px;
	}

	.fbga-block__title {
		font-size: 24px;
	}

	.fbga-clusters {
		gap: 16px;
	}

	.fbga-cluster__name {
		font-size: 14px;
	}

	.fbga-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.fbga-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.fbga-skel {
		animation: none;
	}

	.fbga-cluster,
	.fbga-add,
	.fbga-card__media img {
		transition: none;
	}
}
