/**
 * BuyBestForYou sitewide design-system tokens + shared component styles,
 * per the 2026-09-17 UI/UX, Coding Standards & Security Spec (Phase 4).
 *
 * Additive only: existing page templates keep their current hardcoded
 * colors/fonts until each is migrated in its own phase (Phase 5+) - this
 * file defines the tokens plus the components that consume them so far
 * (product-card, star-rating, pros/cons, CTA button, trust ribbon,
 * comparison table). None of these are wired into a live page yet.
 */

:root {
	/* Color tokens */
	--bbfy-ink: #1A1D21;
	--bbfy-surface: #FFFFFF;
	--bbfy-surface-alt: #F6F7F9;
	--bbfy-border: #E3E6EA;
	--bbfy-cta: #C8571F;
	--bbfy-star: #F5A623;
	--bbfy-trust: #2B5D7C;
	--bbfy-cat-auto: #7A4E2D;
	--bbfy-cat-elec: #2E6FA3;
	--bbfy-cat-home: #3A8452;
	--bbfy-cat-health: #B23A5C;

	/* Spacing - 8px base unit */
	--bbfy-space-1: 8px;
	--bbfy-space-2: 16px;
	--bbfy-space-3: 24px;
	--bbfy-space-4: 32px;
	--bbfy-space-5: 48px;
	--bbfy-space-6: 64px;

	/* Type scale (H1-H3, body, small, micro) */
	--bbfy-fs-h1: 40px;
	--bbfy-fs-h2: 32px;
	--bbfy-fs-h3: 24px;
	--bbfy-fs-body: 20px;
	--bbfy-fs-small: 16px;
	--bbfy-fs-micro: 14px;
	--bbfy-font-stack: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Star rating - inline SVG, always paired with a visible numeral + count,
   never color/shape alone. Renders a composite/aggregate score - the
   "not first-party testing" framing is the caller's job (trust-ribbon,
   Editorial Integrity copy), this component only draws the stars.
   ========================================================================== */

.bbfy-star-rating {
	display: inline-flex;
	align-items: center;
	gap: var(--bbfy-space-1);
	font-family: var(--bbfy-font-stack);
}

.bbfy-star-rating__stars {
	display: inline-flex;
	gap: 2px;
}

.bbfy-star {
	width: 16px;
	height: 16px;
	color: var(--bbfy-star);
}

.bbfy-star--empty {
	color: var(--bbfy-border);
}

.bbfy-star-rating__numeral {
	font-size: var(--bbfy-fs-micro);
	font-weight: 600;
	color: var(--bbfy-ink);
}

.bbfy-star-rating__count {
	font-weight: 400;
	color: var(--bbfy-ink);
	opacity: 0.7;
}

/* ==========================================================================
   Pros / cons block - two-column on desktop, stacked on mobile. Icon + text
   label together (never color alone) for colorblind users.
   ========================================================================== */

.bbfy-pros-cons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--bbfy-space-3);
	font-family: var(--bbfy-font-stack);
}

.bbfy-pros-cons__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--bbfy-space-1);
}

.bbfy-pros-cons__list li {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: var(--bbfy-fs-micro);
	color: var(--bbfy-ink);
}

.bbfy-pros-cons__icon {
	flex: 0 0 auto;
	font-weight: 700;
}

.bbfy-pros-cons__list--pros .bbfy-pros-cons__icon {
	color: #2E7D32;
}

.bbfy-pros-cons__list--cons .bbfy-pros-cons__icon {
	color: #C62828;
}

.bbfy-pros-cons__label {
	font-weight: 600;
	flex: 0 0 auto;
}

@media (max-width: 600px) {
	.bbfy-pros-cons {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   CTA button - one component, three states, always paired with the
   disclosure micro-copy in the same visual block.
   ========================================================================== */

.bbfy-cta-block {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	font-family: var(--bbfy-font-stack);
}

.bbfy-cta-button {
	display: inline-block;
	background-color: var(--bbfy-cta);
	color: #FFFFFF;
	font-size: var(--bbfy-fs-small);
	font-weight: 600;
	padding: 12px 24px;
	border-radius: 5px;
	text-decoration: none;
	border: 2px solid transparent;
}

.bbfy-cta-button:hover {
	background-color: #A8480F;
}

.bbfy-cta-button:focus-visible {
	outline: none;
	border-color: var(--bbfy-ink);
	box-shadow: 0 0 0 2px var(--bbfy-surface), 0 0 0 4px var(--bbfy-ink);
}

.bbfy-cta-disclosure {
	font-size: var(--bbfy-fs-micro);
	color: var(--bbfy-ink);
	opacity: 0.7;
	margin: 0;
}

/* ==========================================================================
   Trust ribbon - disclosure + "Updated <date>" + byline as one persistent
   strip, per the Editorial Integrity model (byline is data-driven, never
   hard-coded here).
   ========================================================================== */

.bbfy-trust-ribbon {
	background-color: var(--bbfy-trust);
	color: #FFFFFF;
	font-family: var(--bbfy-font-stack);
	font-size: var(--bbfy-fs-micro);
	padding: var(--bbfy-space-2);
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.bbfy-trust-ribbon a {
	color: #FFFFFF;
	text-decoration: underline;
}

/* ==========================================================================
   Comparison table - sticky first column on mobile scroll, static (no JS
   sort dependency).
   ========================================================================== */

.bbfy-comparison-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--bbfy-border);
	border-radius: 6px;
}

.bbfy-comparison-table {
	border-collapse: collapse;
	width: 100%;
	font-family: var(--bbfy-font-stack);
	font-size: var(--bbfy-fs-micro);
}

.bbfy-comparison-table th,
.bbfy-comparison-table td {
	padding: var(--bbfy-space-2);
	text-align: left;
	border-bottom: 1px solid var(--bbfy-border);
	white-space: nowrap;
}

.bbfy-comparison-table thead th {
	background-color: var(--bbfy-surface-alt);
	font-weight: 700;
	color: var(--bbfy-ink);
}

.bbfy-comparison-table__sticky-col {
	position: sticky;
	left: 0;
	background-color: var(--bbfy-surface);
	z-index: 1;
}

.bbfy-comparison-table thead .bbfy-comparison-table__sticky-col {
	background-color: var(--bbfy-surface-alt);
	z-index: 2;
}

/* ==========================================================================
   Product card - image, title, star rating + count, 2-line excerpt,
   price-range badge, CTA. One component used identically wherever a product
   (not an article) needs to be shown - homepage, hub pages, comparison
   contexts. Distinct from home-article-card.php, which links to this site's
   own article rather than to Amazon.
   ========================================================================== */

.bbfy-product-card {
	background-color: var(--bbfy-surface);
	border: 1px solid var(--bbfy-border);
	border-radius: 8px;
	overflow: hidden;
	font-family: var(--bbfy-font-stack);
	display: flex;
	flex-direction: column;
}

.bbfy-product-card__media {
	display: block;
	aspect-ratio: 1 / 1;
	background-color: var(--bbfy-surface-alt);
	overflow: hidden;
}

.bbfy-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bbfy-product-card__body {
	padding: var(--bbfy-space-2);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bbfy-product-card__title {
	font-size: var(--bbfy-fs-small);
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.bbfy-product-card__title a {
	color: var(--bbfy-ink);
	text-decoration: none;
}

.bbfy-product-card__title a:hover {
	text-decoration: underline;
}

.bbfy-product-card__excerpt {
	font-size: var(--bbfy-fs-micro);
	color: var(--bbfy-ink);
	opacity: 0.8;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bbfy-product-card__price-badge {
	display: inline-block;
	width: fit-content;
	background-color: var(--bbfy-surface-alt);
	color: var(--bbfy-ink);
	font-size: var(--bbfy-fs-micro);
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 4px;
}

.bbfy-product-card .bbfy-cta-block {
	margin-top: 4px;
}

.bbfy-product-card .bbfy-cta-button {
	width: 100%;
	text-align: center;
}
