/* Frequently Bought Together
 * Layout: Product A + Product B (+ Product C) = bundle price.
 *
 * Mobile : product cards sit in one compact 3-col row; the "=" is hidden and
 *          the price/CTA summary drops below the row.
 * Desktop : one row of 4 columns — the products, then "=", then the summary —
 *           with generous gaps so the "+" operators read as a combination.
 *
 * NOTE: this build does not compile arbitrary Tailwind classes (e.g.
 * text-[1rem], bg-[#fff]), so all colours, sizes and spacing for this block
 * are defined here rather than in the markup. Card element sizes mirror the
 * category-page / Community Favorites product listings.
 */

.bs-fbt {
	margin-bottom: 2rem;
}

.bs-fbt--loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ---- Container ---------------------------------------------------------- */
/* Light-grey border wraps the whole bundle so it reads as one grouped offer. */
.bs-fbt__inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: stretch;
	border: 2px solid #e0e0e0;
	border-radius: 1rem;
	padding: 1.5rem;
}

/* The product cards + "+" operators (3-col on mobile). */
.bs-fbt__products {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	flex: 1 1 auto;
	min-width: 0;
}

/* ---- Operators ---------------------------------------------------------- */
/* Thin and oversized so the "+" / "=" read as elegant connectors. */
.bs-fbt__op {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	font-size: 2.5rem;
	font-weight: 300;
	color: var(--rbb-general-primary-color, #01693a);
}

/* Thin "+" / "=" drawn as SVGs so the stroke matches the accordion chevron
 * (stroke-width 2 in a 24 viewBox). Sized in em so the existing font-size
 * rules keep their footprint. */
.bs-fbt__op-icon {
	display: none; /* mobile: use the thicker text glyph instead (see below) */
	width: 0.6em;
	height: 0.6em;
	stroke-width: 1.2;
}

/* Mobile shows the original (thicker) text "+"; desktop shows the thin SVG. */
.bs-fbt__op-text {
	display: block;
}

/* The "=" only appears on desktop, where the summary is a 4th column. */
.bs-fbt__op--equals {
	display: none;
}

/* ---- Product card (element sizes mirror the listings) ------------------- */
.bs-fbt__card {
	flex: 1 1 0;
	min-width: 0;
	padding: 0.5rem;
	background: #fff;
	border-radius: 0.75rem;
}

.bs-fbt__thumb {
	border-radius: 1rem;
}

/* Title — matches the listings: 0.5rem above (mt-2), none below (mb-0); the
 * rating row carries the gap to the next element. */
.bs-fbt__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0.5rem 0 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
}

/* Rating row — number + count next to the stars. */
.bs-fbt__rating {
	margin-bottom: 0.5rem;
}

/* Nudge the stars up so they sit level with the rating value text. */
.bs-fbt__rating .star-rating {
	position: relative;
	top: -2px;
}

.bs-fbt__rating-average {
	margin-left: 0.25rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: #5e5e5e;
}

.bs-fbt__rating-count {
	margin-left: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: #5e5e5e;
}

/* Capsules (strain / THC / CBD) — match listing px-2.5 py-0.5 text-xs. */
.bs-fbt__cap {
	padding: 0.125rem 0.625rem;
	margin-right: 0.25rem;
	margin-bottom: 0.375rem;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.4;
}

.bs-fbt__cap--meta {
	background-color: #f2f2f2;
}

.bs-fbt__price {
	font-size: 0.8rem;
	font-weight: 800;
}

.bs-fbt__pack {
	font-size: 0.7rem;
	font-weight: 400;
	color: #5e5e5e;
	white-space: nowrap;
}

/* ---- Summary (price + CTA) --------------------------------------------- */
.bs-fbt__summary {
	width: 100%;
	padding: 1rem;
}

.bs-fbt__totals {
	margin-bottom: 0.75rem;
}

.bs-fbt__regular {
	color: #9ca3af;
}

.bs-fbt__discounted {
	font-size: 1.25rem;
	line-height: 24px;
	font-weight: 800;
	color: #dc2626;
	text-decoration: none;
}

.bs-fbt__save {
	margin-top: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: #01693a;
}

.bs-fbt__add {
	width: 100%;
	cursor: pointer;
}

.bs-fbt__add.bs-loading {
	opacity: 0.7;
	pointer-events: none;
	position: relative;
}

/* ---- Mobile: center the price summary ---------------------------------- */
@media (max-width: 1023px) {
	/* No outer border on mobile; drop the padding so the gap under the heading
	 * matches the Community Favorites listings (which have no inner padding). */
	.bs-fbt__inner {
		border: none;
		padding-top: 0;
		padding-left: 0;
		padding-right: 0;
		margin-top: -6px;
	}

	/* Tighten the title line-height — it reads too tall on the narrow cards. */
	.bs-fbt__name {
		line-height: 1.1;
	}

	.bs-fbt__op--plus {
		font-size: 28px;
	}

	/* Smaller stars so the rating + count stay on one line in the narrow card. */
	.bs-fbt__rating {
		flex-wrap: nowrap;
		white-space: nowrap;
	}

	/* Shrink the stars but keep all five — flex must not squeeze/clip them.
	 * Star size is driven by --rbb-rating-icon-size (an SVG background), not
	 * font-size, so override that variable (default 0.9rem). */
	.bs-fbt__rating .star-rating {
		--rbb-rating-icon-size: 0.6rem;
		flex-shrink: 0;
		top: -1px;
	}

	.bs-fbt__rating-average,
	.bs-fbt__rating-count {
		flex-shrink: 0;
		font-size: 0.65rem;
	}

	.bs-fbt__totals {
		text-align: center;
	}

	.bs-fbt__summary {
		margin-bottom: 0;
		padding-top: 6px;
		padding-bottom: 0;
	}
}

/* ---- Desktop: single 4-column row -------------------------------------- */
@media (min-width: 1024px) {
	.bs-fbt__inner {
		flex-direction: row;
		align-items: stretch;
		gap: 1.25rem;
	}

	/* Generous gap so the "+" operators clearly separate the products. */
	.bs-fbt__products {
		gap: 1.25rem;
	}

	.bs-fbt__op {
		font-size: 3.5rem;
	}

	/* Desktop: thin SVG operators replace the text glyph. */
	.bs-fbt__op-icon {
		display: block;
	}

	.bs-fbt__op-text {
		display: none;
	}

	.bs-fbt__op--equals {
		display: flex;
	}

	/* The summary becomes the fixed-width 4th column. */
	.bs-fbt__summary {
		width: auto;
		flex: 0 0 230px;
		align-items: center;
		text-align: center;
	}
}
