/* ==========================================================================
   Favibly Store UI — base tokens & shared components (loaded site-wide)
   Colours/fonts come from Woodmart's Theme Settings automatically.
   To force your own brand colour, uncomment the override at the bottom.
   ========================================================================== */

:root {
	/* Brand — pulled from Woodmart (Theme Settings → Styles & Colors) */
	--fv-brand: var(--wd-primary-color, #5b3df5);
	--fv-cta: var(--btn-accented-bgcolor, var(--fv-brand));
	--fv-cta-hover: var(--btn-accented-bgcolor-hover, var(--fv-cta));
	--fv-cta-text: var(--btn-accented-color, #fff);

	/* Surfaces & text — follow Woodmart light/dark scheme */
	--fv-surface: var(--bgcolor-white, #fff);
	--fv-muted-bg: var(--bgcolor-gray-100, #f6f7f9);
	--fv-border: var(--brdcolor-gray-200, rgba(17, 24, 39, 0.1));
	--fv-border-strong: var(--brdcolor-gray-300, rgba(17, 24, 39, 0.18));
	--fv-text: var(--wd-text-color, #4b5563);
	--fv-heading: var(--wd-title-color, #111827);
	--fv-muted: var(--color-gray-500, #6b7280);

	/* Soft tints (upgraded to brand tints below when the browser supports color-mix) */
	--fv-brand-soft: rgba(17, 24, 39, 0.05);
	--fv-brand-line: rgba(17, 24, 39, 0.14);
	--fv-ring: 0 0 0 4px rgba(17, 24, 39, 0.08);

	/* Status */
	--fv-success: #157f3c;
	--fv-success-bg: #ecfdf3;
	--fv-warn: #b54708;
	--fv-warn-bg: #fffaeb;
	--fv-danger: #c01048;
	--fv-danger-bg: #fff1f3;
	--fv-info: #175cd3;
	--fv-info-bg: #eff8ff;
	--fv-star: #f5a524;

	/* Shape & depth */
	--fv-radius: 16px;
	--fv-radius-md: 12px;
	--fv-radius-sm: 10px;
	--fv-pill: 999px;
	--fv-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
	--fv-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -14px rgba(16, 24, 40, 0.18);
	--fv-shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.04), 0 24px 48px -22px rgba(16, 24, 40, 0.28);
	--fv-font-head: var(--wd-title-font, inherit);
	--fv-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--fv-sticky-top: 24px;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	:root {
		--fv-brand-soft: color-mix(in srgb, var(--fv-brand) 9%, transparent);
		--fv-brand-line: color-mix(in srgb, var(--fv-brand) 35%, transparent);
		--fv-ring: 0 0 0 4px color-mix(in srgb, var(--fv-brand) 20%, transparent);
		--fv-cta-hover: var(--btn-accented-bgcolor-hover, color-mix(in srgb, var(--fv-cta) 86%, #000));
	}
}

/* Woodmart dark version (body.global-color-scheme-light) or manual .fv-dark */
body.global-color-scheme-light,
body.fv-dark {
	/* Fixed dark values so contrast never depends on theme variables */
	--fv-surface: #15171b;
	--fv-muted-bg: #0f1114;
	--fv-border: rgba(255, 255, 255, 0.1);
	--fv-border-strong: rgba(255, 255, 255, 0.18);
	--fv-text: #c7cbd1;
	--fv-heading: #f5f6f7;
	--fv-muted: #9aa1ab;
	--fv-success: #4ade80;
	--fv-success-bg: rgba(34, 197, 94, 0.12);
	--fv-warn: #fbbf24;
	--fv-warn-bg: rgba(245, 158, 11, 0.12);
	--fv-danger: #fb7185;
	--fv-danger-bg: rgba(244, 63, 94, 0.12);
	--fv-info: #60a5fa;
	--fv-info-bg: rgba(59, 130, 246, 0.12);
	--fv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--fv-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
	--fv-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
}

body.admin-bar { --fv-sticky-top: 56px; }

/* ---- Icons ---------------------------------------------------------- */
.fv-ico { display: inline-block; flex: none; vertical-align: middle; }

/* ---- Primary buttons (also applied to key WooCommerce CTAs) ---------- */
.fv-btn,
body.fv-ui #place_order,
body.fv-ui .wc-proceed-to-checkout .checkout-button,
body.fv-ui .fv-buy-now,
body.fv-ui .fv-step__next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 26px;
	border: 0;
	border-radius: var(--fv-radius-md);
	background: var(--fv-cta);
	color: var(--fv-cta-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: none;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 18px -10px var(--fv-cta);
	cursor: pointer;
	transition: transform 0.18s var(--fv-ease), box-shadow 0.18s var(--fv-ease), background-color 0.18s var(--fv-ease);
}
.fv-btn:hover,
body.fv-ui #place_order:hover,
body.fv-ui .wc-proceed-to-checkout .checkout-button:hover,
body.fv-ui .fv-buy-now:hover,
body.fv-ui .fv-step__next:hover {
	background: var(--fv-cta-hover);
	color: var(--fv-cta-text);
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(16, 24, 40, 0.1), 0 14px 26px -12px var(--fv-cta);
}
.fv-btn:focus-visible,
body.fv-ui #place_order:focus-visible,
body.fv-ui .fv-buy-now:focus-visible,
body.fv-ui .fv-step__next:focus-visible {
	outline: none;
	box-shadow: var(--fv-ring);
}
.fv-btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: var(--fv-radius-sm); }

/* ---- Chips ------------------------------------------------------------ */
.fv-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-pill);
	background: var(--fv-surface);
	color: var(--fv-heading);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}
.fv-chip .fv-ico { color: var(--fv-muted); }

/* ---- Trust block ------------------------------------------------------ */
.fv-trust {
	display: grid;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	background: var(--fv-surface);
}
.fv-trust__list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.fv-trust__item { display: flex; align-items: center; gap: 12px; margin: 0; }
.fv-trust__icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: var(--fv-radius-sm);
	background: var(--fv-success-bg);
	color: var(--fv-success);
}
.fv-trust__text { display: grid; gap: 1px; line-height: 1.3; }
.fv-trust__text strong { color: var(--fv-heading); font-size: 14px; font-weight: 700; }
.fv-trust__text small { color: var(--fv-muted); font-size: 12.5px; }
.fv-paymethods {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding-top: 14px;
	border-top: 1px dashed var(--fv-border);
}
.fv-paymethods__label { margin-right: 4px; color: var(--fv-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.fv-trust__badge { max-height: 28px; width: auto; }

/* ---- Progress steps --------------------------------------------------- */
.fv-steps { margin: 4px auto 28px; max-width: 520px; }
.fv-steps__list { display: flex; margin: 0; padding: 0; list-style: none; }
.fv-steps__item,
.fv-steps__item > a {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--fv-muted);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}
.fv-steps__item::before {
	content: "";
	position: absolute;
	top: 15px;
	right: 50%;
	width: 100%;
	height: 2px;
	background: var(--fv-border);
}
.fv-steps__item:first-child::before { display: none; }
.fv-steps__item.is-done::before,
.fv-steps__item.is-current::before { background: var(--fv-brand); }
.fv-steps__dot {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 2px solid var(--fv-border-strong);
	border-radius: 50%;
	background: var(--fv-surface);
	color: var(--fv-muted);
	font-size: 13px;
	font-weight: 700;
	transition: all 0.2s var(--fv-ease);
}
.fv-steps__item.is-current { color: var(--fv-heading); }
.fv-steps__item.is-current .fv-steps__dot { border-color: var(--fv-brand); background: var(--fv-brand); color: #fff; box-shadow: var(--fv-ring); }
.fv-steps__item.is-done .fv-steps__dot { border-color: var(--fv-brand); background: var(--fv-brand-soft); color: var(--fv-brand); }
.fv-steps__item > a:hover { color: var(--fv-brand); }

@media (prefers-reduced-motion: reduce) {
	.fv-btn, body.fv-ui #place_order, body.fv-ui .fv-buy-now, body.fv-ui .fv-step__next, .fv-steps__dot { transition: none; }
}

/* ---- Optional: force your own brand colours -------------------------- */
/*
:root {
	--fv-brand: #5b3df5;
	--fv-cta:   #5b3df5;
}
*/

/* ==========================================================================
   Star ratings — one clean renderer everywhere (shop grids, "New in store",
   product pages, widgets). Overrides the old "Star Rating Unicode Fix v2"
   in Customizer → Additional CSS, which let the hidden "Rated 5.00 out of 5"
   text and Woodmart's icon stars show through and overlap.
   ========================================================================== */
body.fv-ui .star-rating,
body.fv-ui .wc-block-components-product-rating__stars {
	position: relative !important;
	display: inline-block !important;
	float: none !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	color: transparent !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-indent: 0 !important;
	white-space: nowrap !important;
	vertical-align: middle;
}
body.fv-ui .star-rating::before,
body.fv-ui .wc-block-components-product-rating__stars::before {
	content: "\2605\2605\2605\2605\2605" !important;
	position: static !important;
	display: block !important;
	color: var(--fv-star-empty, #d9dde3) !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 14px !important;
	line-height: 1 !important;
	letter-spacing: 2px !important;
	white-space: nowrap !important;
}
body.fv-ui .star-rating > span,
body.fv-ui .wc-block-components-product-rating__stars > span {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	display: block !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	color: transparent !important;
	font-size: 0 !important;
	text-indent: 0 !important;
	/* width comes inline from WooCommerce (e.g. 80% = 4 stars) */
}
body.fv-ui .star-rating > span::before,
body.fv-ui .wc-block-components-product-rating__stars > span::before {
	content: "\2605\2605\2605\2605\2605" !important;
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	display: block !important;
	color: var(--fv-star) !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 14px !important;
	line-height: 1 !important;
	letter-spacing: 2px !important;
	text-indent: 0 !important;
	white-space: nowrap !important;
}
/* The screen-reader text inside the stars ("Rated 5.00 out of 5…") never paints */
body.fv-ui .star-rating > span *,
body.fv-ui .star-rating > span *::before,
body.fv-ui .star-rating > span *::after,
body.fv-ui .wc-block-components-product-rating__stars > span * {
	display: none !important;
	content: none !important;
}

/* Rating rows sit on their own line, centred, with steady spacing */
body.fv-ui .wc-block-grid__product-rating,
body.fv-ui .wc-block-components-product-rating {
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-height: 16px;
	margin: 2px 0 12px !important;
	line-height: 1 !important;
}
body.fv-ui .wd-star-rating,
body.fv-ui .woocommerce-product-rating {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	line-height: 1;
}
body.fv-ui .wd-product .star-rating,
body.fv-ui .product-grid-item .star-rating { margin: 2px 0 8px !important; }

/* Product cards in block grids ("New in store"): equal heights, buttons aligned at the bottom */
body.fv-ui .wc-block-grid__product {
	display: flex !important;
	flex-direction: column;
	align-items: center;
}
body.fv-ui .wc-block-grid__product-title { margin-bottom: 8px !important; line-height: 1.35; }
body.fv-ui .wc-block-grid__product-price { margin: 0 0 6px !important; line-height: 1.4; }
body.fv-ui .wc-block-grid__product-add-to-cart { margin-top: auto !important; padding-top: 6px; }

/* ==========================================================================
   Product block grids on mobile ("New in store" under the cart, related /
   newest products blocks): compact 2-column cards instead of one huge column.
   ========================================================================== */
@media (max-width: 767px) {
	body.fv-ui .wc-block-grid .wc-block-grid__products {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
		margin: 0 !important;
		padding: 0;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__products .wc-block-grid__product {
		flex: none !important;
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 8px 8px 10px !important;
		border: 1px solid var(--fv-border) !important;
		border-radius: var(--fv-radius-md);
		background: var(--fv-surface);
		box-shadow: var(--fv-shadow-sm);
		font-size: 13px;
		text-align: center;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-link { display: block; width: 100%; position: relative; }
	body.fv-ui .wc-block-grid .wc-block-grid__product-image { margin: 0 0 8px !important; }
	body.fv-ui .wc-block-grid .wc-block-grid__product-image img {
		display: block;
		width: 100%;
		height: auto;
		aspect-ratio: 1 / 1;
		object-fit: cover;
		border-radius: var(--fv-radius-sm);
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-onsale {
		top: 6px !important;
		right: 6px !important;
		left: auto !important;
		margin: 0 !important;
		padding: 3px 8px !important;
		border: 0 !important;
		border-radius: var(--fv-pill) !important;
		background: var(--fv-danger) !important;
		color: #fff !important;
		font-size: 10px !important;
		font-weight: 800 !important;
		line-height: 1.3 !important;
		letter-spacing: 0.04em;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		min-height: 2.7em; /* keeps cards level when one title is shorter */
		margin: 0 0 6px !important;
		overflow: hidden;
		color: var(--fv-heading);
		font-size: 13px !important;
		font-weight: 700;
		line-height: 1.35 !important;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-price {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: center;
		gap: 0 6px;
		margin: 0 0 6px !important;
		font-size: 13px !important;
		line-height: 1.3 !important;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-price del { font-size: 11px; opacity: 0.75; }
	body.fv-ui .wc-block-grid .wc-block-grid__product-price ins { font-weight: 800; text-decoration: none; }

	/* Stars: smaller, on their own line, nothing overlapping */
	body.fv-ui .wc-block-grid .wc-block-grid__product-rating {
		min-height: 12px;
		margin: 0 0 8px !important;
	}
	body.fv-ui .wc-block-grid .star-rating,
	body.fv-ui .wc-block-grid .star-rating::before,
	body.fv-ui .wc-block-grid .star-rating > span::before {
		font-size: 12px !important;
		letter-spacing: 1px !important;
	}

	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart { width: 100%; margin: auto 0 0 !important; padding-top: 2px; }
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart .wp-block-button__link,
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart .add_to_cart_button,
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart a.button {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 100% !important;
		min-height: 36px !important;
		height: auto !important;
		margin: 0 !important;
		padding: 0 10px !important;
		font-size: 12px !important;
		font-weight: 700;
		line-height: 1.2 !important;
		letter-spacing: 0.02em;
		white-space: nowrap;
	}
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart .added_to_cart { display: block; margin-top: 6px; font-size: 12px; }
}
@media (max-width: 340px) {
	body.fv-ui .wc-block-grid .wc-block-grid__products { gap: 8px; }
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart .wp-block-button__link,
	body.fv-ui .wc-block-grid .wc-block-grid__product-add-to-cart .add_to_cart_button { font-size: 11px !important; padding: 0 6px !important; }
}
