/*
 * bff/chat-demo — scripted, fictional preview.
 * Colours and radii come from bff-theme's theme.json presets (fallbacks keep
 * the block legible without the theme).
 */
.bff-demo {
	--demo-ink: var(--wp--preset--color--ink, #0a1a3a);
	--demo-ink-raised: var(--wp--preset--color--ink-raised, #102454);
	--demo-cyan: var(--wp--preset--color--cyan, #18c8ff);
	--demo-cyan-tint: var(--wp--preset--color--cyan-tint, #e7f8ff);
	--demo-cyan-line: var(--wp--preset--color--cyan-line, #b5e9fb);
	--demo-cyan-ink: var(--wp--preset--color--cyan-ink, #045a77);
	--demo-flame: var(--wp--preset--color--flame, #ff8a1f);
	--demo-flame-hover: var(--wp--preset--color--flame-hover, #ff9e47);
	--demo-surface: var(--wp--preset--color--surface, #f4f8fc);
	--demo-white: var(--wp--preset--color--white, #ffffff);
	--demo-line: var(--wp--preset--color--line, #dde6f2);
	--demo-line-strong: var(--wp--preset--color--line-strong, #b9c8dd);
	--demo-slate: var(--wp--preset--color--slate, #4a5872);
	--demo-mist: var(--wp--preset--color--mist, #b6c3dd);
	--demo-mint: var(--wp--preset--color--mint, #3ddc97);
	--demo-r-sm: var(--wp--custom--radius--sm, 12px);
	--demo-r-md: var(--wp--custom--radius--md, 16px);
	--demo-r-lg: var(--wp--custom--radius--lg, 24px);
	--demo-r-xl: var(--wp--custom--radius--xl, 32px);
	--demo-r-pill: var(--wp--custom--radius--pill, 999px);
	/* Real storefront widget, default look (theme.json custom.widget). */
	--w-head: var(--wp--custom--widget--head, #0a1a3a);
	--w-ink: var(--wp--custom--widget--ink, #1f1f53);
	--w-accent: var(--wp--custom--widget--accent, #4836da);
	--w-on-ink: var(--wp--custom--widget--on-ink, #e0e0ff);
	--w-text: var(--wp--custom--widget--text, #252a32);
	--w-title: var(--wp--custom--widget--title, #0f172a);
	--w-meta: var(--wp--custom--widget--meta, #69717c);
	--w-price: var(--wp--custom--widget--price, #c8452a);
	--w-deal: var(--wp--custom--widget--deal, #087f5b);
	--w-deal-line: var(--wp--custom--widget--deal-line, #29a16d);
	--w-deal-tint: var(--wp--custom--widget--deal-tint, #f3faf6);
	--w-table-head: var(--wp--custom--widget--table-head, #eef2ff);
	--w-line: var(--wp--custom--widget--line, #e6edf6);
	--w-bg-top: var(--wp--custom--widget--bg-top, #eef0f4);
	--w-bg: var(--wp--custom--widget--bg, #f7f8fa);
	--w-online: var(--wp--custom--widget--online, #22c55e);
	--w-font: var(--wp--custom--widget--font, Roboto, 'Segoe UI', system-ui, sans-serif);
	--w-radius: var(--wp--custom--widget--radius, 20px);
	--w-bubble: var(--wp--custom--widget--bubble, 18px);
	--w-tail: var(--wp--custom--widget--bubble-tail, 6px);
	--w-chip: var(--wp--custom--widget--chip, 10px);
	--w-card: var(--wp--custom--widget--card, 18px);
	--w-button: var(--wp--custom--widget--button, 12px);
	--w-shadow: 0 2px 3px rgba(24, 32, 45, 0.03), 0 8px 20px -8px rgba(24, 32, 45, 0.13);
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
	gap: clamp(24px, 4vw, 56px);
	align-items: start;
	color: var(--demo-ink);
}
.bff-demo__side {
	display: grid;
	gap: 12px;
}
.bff-demo__journeys {
	display: grid;
	gap: 12px;
}
.bff-demo__journeys button {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 14px;
	align-items: center;
	width: 100%;
	padding: 18px;
	border-radius: var(--demo-r-md);
	border: 1.5px solid var(--demo-line);
	background: var(--demo-white);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		border-color 0.18s,
		box-shadow 0.18s;
}
.bff-demo__journeys button:hover {
	border-color: var(--demo-line-strong);
}
.bff-demo__journeys button[aria-pressed='true'] {
	border-color: var(--demo-ink);
	box-shadow: var(--wp--preset--shadow--md);
}
.bff-demo__journeys button[aria-pressed='true'] .bff-tile {
	background: var(--demo-ink);
	color: var(--demo-cyan);
}
.bff-demo__journey-text strong {
	display: block;
	font: 700 1.0625rem/1.3 var(--wp--preset--font-family--heading);
}
.bff-demo__journey-text span {
	display: block;
	color: var(--demo-slate);
	font-size: 0.875rem;
}
.bff-demo__side > .bff-demo__note {
	margin: 0;
	padding: 4px 4px 0;
	color: var(--demo-slate);
	font-size: 0.8125rem;
}
.bff-demo__window {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: clamp(16px, 3vw, 32px);
	border-radius: var(--demo-r-xl);
	background: var(--demo-ink);
	box-shadow: var(--wp--preset--shadow--md);
}
.bff-demo__window::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(
		50% 60% at 90% 0%,
		color-mix(in srgb, var(--demo-cyan) 25%, transparent),
		transparent 70%
	);
}

/* ---------- Widget replica ---------- */
.bff-demo__chat {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-width: 460px;
	/* Centred in the ink frame; controls below share the same width. */
	margin-inline: auto;
	border-radius: var(--w-radius);
	/* Head colour under the top corners: otherwise the light shell bleeds
	   through the anti-aliased rounded edge as a thin white rim. */
	background:
		linear-gradient(var(--w-head), var(--w-head)) top / 100% 48px no-repeat,
		linear-gradient(180deg, var(--w-bg-top), var(--w-bg) 300px);
	box-shadow: var(--wp--preset--shadow--lg);
	color: var(--w-text);
	font: 400 14px/1.45 var(--w-font);
}
.bff-demo .bff-icon {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}
.bff-demo__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.bff-demo__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 16px;
	background: var(--w-head);
	color: var(--demo-white);
}
.bff-demo__head img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--demo-white);
}
.bff-demo__head strong {
	display: block;
	font-size: 15px;
	font-weight: 700;
}
.bff-demo__head small {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--w-on-ink);
	font-size: 12px;
}
.bff-demo__online {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--w-online);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--w-online) 30%, transparent);
}
.bff-demo__head-icons {
	display: flex;
	gap: 8px;
	margin-left: auto;
}
.bff-demo__head-icons span {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--w-ink) 70%, transparent);
}
.bff-demo__head-icons .bff-icon {
	width: 15px;
	height: 15px;
}
.bff-demo__tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 12px;
	border-bottom: 1px solid var(--w-line);
	background: var(--demo-white);
}
.bff-demo__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 8px 10px;
	border-bottom: 2px solid transparent;
	color: var(--w-meta);
	font-size: 13px;
	font-weight: 500;
}
.bff-demo__tab .bff-icon {
	width: 15px;
	height: 15px;
}
.bff-demo__tab.is-on {
	border-color: var(--w-ink);
	color: var(--w-ink);
	font-weight: 700;
}
.bff-demo__cart-icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	margin-left: auto;
	color: var(--w-ink);
}
.bff-demo__count-badge {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--w-ink);
	color: var(--demo-white);
	font-size: 10px;
	line-height: 16px;
	text-align: center;
}
.bff-demo__log {
	display: grid;
	align-content: start;
	gap: 14px;
	height: 460px;
	overflow-y: auto;
	padding: 16px;
	overscroll-behavior: contain;
}
.bff-demo__log.is-find {
	padding: 12px;
	background: var(--demo-white);
}

/* Messages */
.bff-demo__message {
	display: grid;
	gap: 6px;
	max-width: 88%;
	padding: 14px 16px;
	border-radius: var(--w-bubble) var(--w-bubble) var(--w-bubble) var(--w-tail);
	border: 1px solid rgba(24, 32, 45, 0.06);
	background: var(--demo-white);
	box-shadow: var(--w-shadow);
	animation: bff-demo-in 0.25s ease-out;
}
.bff-demo__message > div {
	display: grid;
	gap: 10px;
	min-width: 0;
}
.bff-demo__message p {
	margin: 0;
}
.bff-demo__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__meta > span:first-child {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.bff-demo__meta .bff-icon {
	width: 13px;
	height: 13px;
}
.bff-demo__message--user {
	justify-self: end;
	border-color: var(--w-ink);
	border-radius: var(--w-bubble) var(--w-bubble) var(--w-tail) var(--w-bubble);
	background: var(--w-ink);
	color: var(--w-on-ink);
}
.bff-demo__message--user .bff-demo__meta {
	justify-content: flex-end;
	color: color-mix(in srgb, var(--w-on-ink) 75%, transparent);
}
.bff-demo__message--staff {
	border-color: color-mix(in srgb, var(--w-accent) 25%, transparent);
}
.bff-demo__message--staff .bff-demo__meta > span:first-child {
	color: var(--w-accent);
	font-weight: 700;
}
.bff-demo__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bff-demo__suggestions li,
.bff-demo__suggestion {
	min-height: 40px;
	padding: 9px 12px;
	border-radius: var(--w-chip);
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-ink);
	font: 500 13px/1.35 var(--w-font);
	text-align: left;
	box-shadow: 0 1px 2px rgba(24, 32, 45, 0.05);
}
.bff-demo__suggestion {
	cursor: pointer;
}
.bff-demo__suggestion:hover {
	border-color: var(--w-ink);
}
.bff-demo__system,
.bff-demo__toast {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	color: var(--w-meta);
	font-size: 12px;
	text-align: center;
}
.bff-demo__toast {
	justify-self: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--w-deal-tint);
	color: var(--w-deal);
	font-weight: 500;
}
.bff-demo__toast .bff-icon,
.bff-demo__system .bff-icon {
	width: 14px;
	height: 14px;
}

/* Buttons used inside the widget */
.bff-demo__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--w-button);
	background: var(--w-ink);
	color: var(--demo-white);
	font: 700 13px/1 var(--w-font);
	cursor: pointer;
}
.bff-demo__cta:hover {
	background: var(--w-accent);
}
.bff-demo__cta:disabled {
	opacity: 0.55;
	cursor: default;
	background: var(--w-ink);
}
.bff-demo__cta[aria-disabled='true'],
.bff-demo__ghost[aria-disabled='true'] {
	background: var(--w-deal-tint);
	border-color: var(--w-deal-line);
	color: var(--w-deal);
	cursor: default;
}
.bff-demo__ghost,
.bff-demo__chip,
.bff-demo__filters,
.bff-demo__clear {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-ink);
	font: 500 12px/1 var(--w-font);
	cursor: pointer;
}
.bff-demo__ghost {
	border-color: var(--w-deal-line);
	color: var(--w-deal);
	font-weight: 700;
}
.bff-demo__ghost:hover,
.bff-demo__chip:hover,
.bff-demo__filters:hover {
	border-color: var(--w-ink);
}
.bff-demo__icon-btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-text);
	cursor: pointer;
}
.bff-demo :is(button, input, select, [tabindex]):focus-visible {
	outline: 2px solid var(--w-accent);
	outline-offset: 2px;
}
/* Controls on the ink frame: cyan ring (brief: cyan outline on ink). */
.bff-demo__controls button:focus-visible {
	outline-color: var(--demo-cyan);
}

/* Product card + carousel */
.bff-demo__carousel {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-inline: -4px;
	padding: 2px 4px 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}
.bff-demo__product {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 12px;
	flex: 0 0 min(100%, 300px);
	padding: 12px;
	border-radius: var(--w-card);
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.28);
	scroll-snap-align: start;
}
.bff-demo__product-media img {
	display: block;
	width: 96px;
	height: 120px;
	border-radius: 10px;
	object-fit: cover;
	background: var(--w-bg);
}
.bff-demo__product-body {
	display: grid;
	align-content: start;
	gap: 6px;
	min-width: 0;
}
.bff-demo__product-title,
.bff-demo__item-title {
	color: var(--w-title);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}
.bff-demo__price {
	color: var(--w-price);
	font-size: 17px;
	font-weight: 700;
}
.bff-demo__upsell {
	display: grid;
	gap: 6px;
}
.bff-demo__upsell-head {
	color: var(--w-deal);
	font-size: 12px;
	font-weight: 650;
}
.bff-demo__tiers {
	display: grid;
	gap: 6px;
}
.bff-demo__tier {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 8px;
	min-height: 40px;
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-title);
	font: 400 12px/1.3 var(--w-font);
	text-align: left;
	cursor: pointer;
}
.bff-demo__tier strong {
	font-weight: 700;
}
.bff-demo__tier span {
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__tier[aria-pressed='true'] {
	border-color: var(--w-deal-line);
	background: var(--w-deal-tint);
	box-shadow: inset 0 0 0 1px var(--w-deal-line);
}
.bff-demo__terms,
.bff-demo__message small,
.bff-demo__cart small {
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__product .bff-demo__cta {
	width: 100%;
	margin-top: 4px;
}

/* Compare snapshot */
.bff-demo__snap-title {
	font-size: 15px;
	font-weight: 700;
}
.bff-demo__table {
	overflow-x: auto;
	border-radius: 10px;
	border: 1px solid var(--w-line);
}
.bff-demo__table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.bff-demo__table :where(th, td) {
	padding: 7px 9px;
	border-bottom: 1px solid var(--w-line);
	text-align: left;
	vertical-align: top;
}
.bff-demo__table thead th {
	background: var(--w-table-head);
	color: var(--w-ink);
}
.bff-demo__table tbody th {
	color: var(--w-title);
	font-weight: 600;
}
.bff-demo__table tr:last-child > * {
	border-bottom: 0;
}

/* Order card */
.bff-demo__order {
	display: grid;
	gap: 8px;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid var(--w-line);
	background: var(--w-bg);
	font-size: 13px;
}
.bff-demo__order-title {
	font-size: 14px;
}
.bff-demo__order-status {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
}
.bff-demo__order-status div {
	display: flex;
	gap: 4px;
}
.bff-demo__order-status dt {
	color: var(--w-meta);
}
.bff-demo__order-status dd {
	margin: 0;
	font-weight: 700;
}
.bff-demo__order-date {
	color: var(--w-meta);
	font-size: 12px;
}
.bff-demo__order-items {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bff-demo__order-items li {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	align-items: center;
	gap: 8px;
}
.bff-demo__order-items img {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	object-fit: cover;
}
.bff-demo__order-total {
	padding-top: 8px;
	border-top: 1px solid var(--w-line);
	font-weight: 700;
}
.bff-demo__order-link {
	color: var(--w-accent);
	font-weight: 700;
}

/* Find products tab */
.bff-demo__find {
	display: grid;
	gap: 10px;
}
.bff-demo__searchbox {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 4px 4px 4px 12px;
	border-radius: 12px;
	border: 1.5px solid var(--w-ink);
	color: var(--w-meta);
}
.bff-demo__query {
	flex: 1;
	min-width: 0;
	color: var(--w-text);
	font-size: 13px;
}
.bff-demo__go {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--w-ink);
	color: var(--demo-white);
}
.bff-demo__suggest {
	display: grid;
	gap: 6px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid var(--w-line);
	box-shadow: var(--w-shadow);
	font-size: 13px;
}
.bff-demo__suggest span:first-child {
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.bff-demo__chip {
	min-height: 32px;
	border-color: var(--w-line);
	background: var(--w-bg);
}
.bff-demo__chip .bff-icon {
	width: 13px;
	height: 13px;
}
.bff-demo__clear {
	border-color: transparent;
	background: none;
	font-weight: 700;
	text-decoration: underline;
}
.bff-demo__find-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.bff-demo__count {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}
.bff-demo__filters {
	min-height: 36px;
	gap: 8px;
}
.bff-demo__filters b {
	display: grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--w-ink);
	color: var(--demo-white);
	font-size: 11px;
}
.bff-demo__results {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	align-items: start;
}
.bff-demo__item {
	display: grid;
	gap: 6px;
	padding: 8px;
	border-radius: 12px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
}
.bff-demo__item-media {
	position: relative;
}
.bff-demo__item-media img {
	display: block;
	width: 100%;
	height: 120px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--w-bg);
}
.bff-demo__item-title {
	font-size: 13px;
	text-transform: uppercase;
}
.bff-demo__item-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 8px;
	min-width: 0;
}
.bff-demo__chat.is-find .bff-demo__composer {
	display: none;
}
.bff-demo__item .bff-demo__price {
	font-size: 15px;
	color: var(--w-title);
}
.bff-demo__variant {
	color: var(--w-meta);
	font-size: 12px;
}
.bff-demo__item .bff-demo__cta {
	width: 100%;
}
.bff-demo__eye {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-ink);
	cursor: pointer;
}
.bff-demo__badge {
	position: absolute;
	top: 6px;
	left: 6px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--w-price);
	color: var(--demo-white);
	font-size: 11px;
	font-weight: 700;
}
.bff-demo__check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	font-size: 12px;
	cursor: pointer;
}
.bff-demo__check input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--w-ink);
}
.bff-demo__empty {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--w-meta);
	font-size: 13px;
}
.bff-demo__tray {
	position: sticky;
	bottom: -12px;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 -12px -12px;
	padding: 10px 12px;
	border-top: 1px solid var(--w-line);
	background: var(--demo-white);
}
.bff-demo__tray-thumbs {
	display: flex;
	gap: 6px;
}
.bff-demo__tray-thumbs img {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	object-fit: cover;
}
.bff-demo__tray-text {
	color: var(--w-meta);
	font-size: 12px;
}
.bff-demo__tray .bff-demo__cta {
	margin-left: auto;
}

/* Mini cart */
.bff-demo__cart {
	display: grid;
	gap: 10px;
	padding: 14px;
	border-radius: 16px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	box-shadow: var(--w-shadow);
}
.bff-demo__cart-head {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--w-ink);
	font-size: 15px;
}
.bff-demo__cart-head b {
	padding: 0 7px;
	border-radius: 999px;
	background: var(--w-bg);
	font-size: 12px;
}
.bff-demo__reward {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 6px 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--w-deal-tint);
	color: var(--w-deal);
	font-size: 13px;
	font-weight: 600;
}
.bff-demo__reward progress {
	grid-column: 1 / -1;
}
.bff-demo__gift {
	grid-template-columns: auto 1fr auto;
	border: 1px dashed var(--w-deal-line);
}
.bff-demo__line {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 4px 10px;
	align-items: center;
}
.bff-demo__line img {
	grid-row: span 2;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
}
.bff-demo__line-info {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.bff-demo__line .bff-demo__price {
	color: var(--w-title);
	font-size: 14px;
}
.bff-demo__qty {
	grid-column: 2;
	justify-self: start;
	padding: 3px 10px;
	border-radius: 8px;
	border: 1px solid var(--w-line);
	font-size: 12px;
}
.bff-demo__line-offer {
	display: grid;
	gap: 8px;
	padding: 10px 12px;
	border-left: 3px solid var(--w-deal-line);
	border-radius: 0 10px 10px 0;
	background: var(--w-deal-tint);
	color: var(--w-deal);
	font-size: 13px;
}
.bff-demo__tier-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.bff-demo__tier-chips span {
	padding: 3px 8px;
	border-radius: 6px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__tier-chips .is-current {
	border-color: var(--w-deal-line);
	color: var(--w-deal);
	font-weight: 700;
}
.bff-demo__progress-row {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--w-meta);
	font-size: 12px;
}
.bff-demo__progress-row progress {
	flex: 1;
}
.bff-demo progress {
	width: 100%;
	height: 6px;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--w-deal-line) 20%, var(--demo-white));
	appearance: none;
	overflow: hidden;
}
.bff-demo progress::-webkit-progress-bar {
	background: color-mix(in srgb, var(--w-deal-line) 20%, var(--demo-white));
}
.bff-demo progress::-webkit-progress-value {
	background: var(--w-deal-line);
}
.bff-demo progress::-moz-progress-bar {
	background: var(--w-deal-line);
}
.bff-demo__cart-foot {
	display: grid;
	gap: 6px;
	padding-top: 10px;
	border-top: 1px solid var(--w-line);
}
.bff-demo__subtotal {
	display: flex;
	justify-content: space-between;
	margin: 0;
	font-size: 14px;
}
.bff-demo__checkout {
	width: 100%;
	min-height: 44px;
	border-radius: 999px;
}

/* Bottom sheet (Add to cart, Quick view, Filters) */
.bff-demo__sheet {
	position: absolute;
	inset: auto 0 0;
	z-index: 2;
	display: grid;
	gap: 12px;
	max-height: 80%;
	overflow-y: auto;
	padding: 16px;
	border-radius: 18px 18px 0 0;
	background: var(--demo-white);
	box-shadow: 0 -12px 32px -8px rgba(15, 23, 42, 0.3);
	animation: bff-demo-up 0.2s ease-out;
}
.bff-demo__sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--w-title);
	font-size: 15px;
}
.bff-demo__sheet-item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 8px 12px;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid var(--w-line);
}
.bff-demo__sheet-item img {
	grid-row: span 2;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
}
.bff-demo__sheet-fields {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 8px 10px;
	font-size: 12px;
}
.bff-demo__sheet-fields :is(select, input) {
	min-height: 40px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--demo-line-strong);
	background: var(--demo-white);
	color: var(--w-text);
	font: 400 13px var(--w-font);
}
.bff-demo__sheet-fields input {
	width: 72px;
}
.bff-demo__sheet-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}
.bff-demo__sheet .bff-demo__ghost {
	min-height: 40px;
	border-color: var(--w-line);
	color: var(--w-text);
}
.bff-demo__quick-img {
	width: 100%;
	height: 200px;
	border-radius: 12px;
	object-fit: cover;
}
.bff-demo__sheet > p {
	margin: 0;
	color: var(--w-meta);
}
.bff-demo__filter-list {
	display: grid;
	gap: 4px;
}

/* Typing + composer */
.bff-demo__typing {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 16px;
	color: var(--w-meta);
	font-size: 12px;
}
.bff-demo__dots {
	display: inline-flex;
	gap: 4px;
}
.bff-demo__dots i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--w-meta);
	animation: bff-demo-dot 1.2s infinite ease-in-out;
}
.bff-demo__dots i:nth-child(2) {
	animation-delay: 0.15s;
}
.bff-demo__dots i:nth-child(3) {
	animation-delay: 0.3s;
}
.bff-demo__composer {
	display: grid;
	gap: 10px;
	margin: 0 12px 12px;
	padding: 12px;
	border-radius: 16px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-meta);
	font-size: 13px;
	box-shadow: 0 2px 6px rgba(24, 32, 45, 0.04);
}
.bff-demo__tools {
	display: flex;
	align-items: center;
	gap: 8px;
}
.bff-demo__lang {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: auto;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--w-line);
	color: var(--w-text);
	font-size: 11px;
	font-weight: 700;
}
.bff-demo__lang .bff-icon,
.bff-demo__tool .bff-icon {
	width: 15px;
	height: 15px;
}
.bff-demo__tool {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	color: var(--w-text);
}
.bff-demo__tool--ink {
	border-radius: 50%;
	background: var(--w-text);
	color: var(--demo-white);
}
.bff-demo__send {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--w-bg-top);
	color: var(--w-meta);
}

/* ---------- Frame controls ---------- */
.bff-demo__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	max-width: 460px;
	margin: 16px auto 0;
}
.bff-demo__play,
.bff-demo__replay {
	min-height: 44px;
	padding: 0 20px;
	border-radius: var(--demo-r-pill);
	font: 700 0.9375rem/1 var(--wp--preset--font-family--body);
	cursor: pointer;
}
.bff-demo__play {
	border: 0;
	background: var(--demo-cyan);
	color: var(--demo-ink);
}
.bff-demo__play:hover {
	background: var(--demo-white);
}
.bff-demo__play:disabled {
	background: var(--demo-ink-raised);
	color: var(--demo-mist);
	cursor: default;
}
.bff-demo__replay {
	border: 1.5px solid color-mix(in srgb, var(--demo-white) 32%, transparent);
	background: transparent;
	color: var(--demo-white);
}
.bff-demo__replay:hover {
	border-color: var(--demo-cyan);
}
.bff-demo__status {
	flex-basis: 100%;
	margin: 0;
	color: var(--demo-mist);
	font-size: 0.8125rem;
	text-align: right;
}
.bff-demo__no-js {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--demo-slate);
}
@keyframes bff-demo-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}
@keyframes bff-demo-up {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}
@keyframes bff-demo-dot {
	0%,
	80%,
	100% {
		opacity: 0.3;
	}
	40% {
		opacity: 1;
	}
}
@media (max-width: 960px) {
	.bff-demo {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 640px) {
	.bff-demo__journeys {
		gap: 8px;
	}
	.bff-demo__journeys button {
		grid-template-columns: 36px 1fr;
		gap: 10px;
		padding: 8px 12px;
	}
	/* Six journeys: keep the widget close on phones; the title alone is enough. */
	.bff-demo__journey-text span {
		display: none;
	}
	.bff-demo__window {
		padding: 12px;
	}
	.bff-demo__controls {
		justify-content: stretch;
	}
	.bff-demo__play,
	.bff-demo__replay {
		flex: 1;
	}
	.bff-demo__status {
		text-align: left;
	}
	.bff-demo__head-icons {
		display: none;
	}
	.bff-demo__product {
		grid-template-columns: 72px minmax(0, 1fr);
	}
	.bff-demo__product-media img {
		width: 72px;
		height: 96px;
	}
	/* 44px targets on touch screens. */
	.bff-demo
		:is(
			.bff-demo__cta,
			.bff-demo__ghost,
			.bff-demo__chip,
			.bff-demo__filters,
			.bff-demo__clear,
			.bff-demo__suggestion,
			.bff-demo__tier
		) {
		min-height: 44px;
	}
	.bff-demo__check {
		min-height: 44px;
	}
	.bff-demo__eye {
		width: 44px;
		height: 44px;
	}
}
/* Narrow phones: one result per row, image beside the details. */
@media (max-width: 400px) {
	.bff-demo__results {
		grid-template-columns: 1fr;
	}
	.bff-demo__item {
		grid-template-columns: 96px minmax(0, 1fr);
		column-gap: 10px;
	}
	.bff-demo__item > :not(.bff-demo__item-media) {
		grid-column: 2;
	}
	.bff-demo__item-media {
		grid-row: 1 / span 4;
	}
	.bff-demo__item-media img {
		height: 120px;
	}
	.bff-demo__tools .bff-demo__tool:not(.bff-demo__tool--ink) {
		display: none;
	}
	.bff-demo__message {
		max-width: 100%;
	}
}
@media (prefers-reduced-motion: reduce) {
	.bff-demo__message,
	.bff-demo__sheet,
	.bff-demo__dots i {
		animation: none;
	}
}

/* Mini cart panel over the conversation (below the tabs). */
.bff-demo__cart {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	border: 0;
	border-radius: 0 0 var(--w-radius) var(--w-radius);
	box-shadow: none;
	background: var(--demo-white);
	animation: bff-demo-in 0.2s ease-out;
}
.bff-demo__cart-body {
	display: grid;
	align-content: start;
	gap: 10px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 4px 14px 14px;
}
.bff-demo__cart .bff-demo__cart-head {
	padding: 10px 14px;
}
.bff-demo__cart-head .bff-demo__icon-btn {
	margin-left: auto;
}
.bff-demo__cart .bff-demo__cart-foot {
	padding: 12px 14px 14px;
	box-shadow: 0 -8px 16px -12px rgba(15, 23, 42, 0.25);
}
.bff-demo__stepper {
	grid-column: 2;
	justify-self: start;
	display: inline-flex;
	align-items: center;
	border-radius: 8px;
	border: 1px solid var(--w-line);
}
.bff-demo__stepper button {
	width: 32px;
	height: 32px;
	border: 0;
	background: none;
	color: var(--w-ink);
	font: 700 16px/1 var(--w-font);
	cursor: pointer;
}
.bff-demo__stepper button:disabled {
	color: var(--w-line);
	cursor: default;
}
.bff-demo__stepper span {
	min-width: 24px;
	font-size: 13px;
	text-align: center;
}
/* Find products: sort + filters, Back to chat footer. */
.bff-demo__find-tools {
	display: flex;
	align-items: center;
	gap: 6px;
}
.bff-demo__sort {
	min-height: 36px;
	max-width: 150px;
	padding: 0 8px;
	border-radius: 8px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-text);
	font: 400 12px var(--w-font);
}
.bff-demo__back {
	display: none;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-top: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-ink);
	font: 500 13px var(--w-font);
	cursor: pointer;
}
.bff-demo__chat.is-find .bff-demo__back {
	display: flex;
}
.bff-demo__chat.is-find .bff-demo__log {
	height: 494px;
}
@media (max-width: 640px) {
	.bff-demo__journeys .bff-tile {
		width: 36px;
		height: 36px;
	}
	.bff-demo__stepper button {
		width: 44px;
		height: 44px;
	}
	.bff-demo__sort {
		min-height: 44px;
	}
}
@media (max-width: 400px) {
	.bff-demo__table table {
		font-size: 11px;
	}
	.bff-demo__table :where(th, td) {
		padding: 6px;
	}
	.bff-demo__find-bar {
		flex-wrap: wrap;
	}
}

/* ---------- Find products: expanded widget with Filters sidebar ---------- */
.bff-demo__chat {
	container: bff-chat / inline-size;
	transition: max-width 0.35s ease;
}
.bff-demo__chat.is-wide {
	max-width: 100%;
}
.bff-demo__query.is-empty {
	color: var(--w-meta);
}
.bff-demo__chips[hidden],
.bff-demo__filters b[hidden] {
	display: none;
}
.bff-demo__filters .bff-icon {
	width: 16px;
	height: 16px;
}
.bff-demo__workspace {
	display: grid;
	gap: 12px;
	align-items: start;
}
.bff-demo__main {
	display: grid;
	gap: 10px;
	min-width: 0;
}
.bff-demo__sidebar {
	display: none;
}
.bff-demo__item .bff-demo__cta {
	gap: 8px;
}
.bff-demo__item .bff-demo__cta .bff-icon {
	width: 16px;
	height: 16px;
}
@container bff-chat (min-width: 560px) {
	.bff-demo__workspace {
		grid-template-columns: 184px minmax(0, 1fr);
	}
	.bff-demo__sidebar {
		position: sticky;
		top: 0;
		display: block;
		max-height: 420px;
		overflow-y: auto;
		/* Room for the AI highlight ring, which overflow would clip. */
		padding: 4px 10px 4px 4px;
		border-right: 1px solid var(--w-line);
		scrollbar-width: thin;
	}
	.bff-demo__filters {
		display: none;
	}
	.bff-demo__results {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}
}
.bff-demo__sidebar header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 2px 0 8px;
	color: var(--w-title);
	font-size: 14px;
}
.bff-demo__sidebar header .bff-demo__clear {
	margin-left: auto;
	min-height: 28px;
	padding: 0 4px;
	text-decoration: none;
	font-size: 12px;
}
.bff-demo__facets {
	display: grid;
}
.bff-demo__facet {
	padding: 10px 0;
	border-top: 1px solid var(--w-line);
}
.bff-demo__facet summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 28px;
	color: var(--w-title);
	font-size: 13px;
	font-weight: 700;
	list-style: none;
	cursor: pointer;
}
.bff-demo__facet summary::-webkit-details-marker {
	display: none;
}
.bff-demo__facet summary .bff-icon {
	width: 16px;
	height: 16px;
	transform: rotate(180deg);
	transition: transform 0.2s ease;
}
.bff-demo__facet:not([open]) summary .bff-icon {
	transform: none;
}
.bff-demo__facet > :not(summary) {
	margin-top: 10px;
}
.bff-demo__price-range {
	display: grid;
	gap: 12px;
	padding: 6px;
}
.bff-demo__rail {
	position: relative;
	height: 20px;
}
.bff-demo__rail::before,
.bff-demo__rail-fill {
	content: '';
	position: absolute;
	top: 8px;
	height: 4px;
	border-radius: 999px;
}
.bff-demo__rail::before {
	right: 0;
	left: 0;
	background: var(--w-line);
}
.bff-demo__rail-fill {
	background: var(--w-ink);
}
.bff-demo__rail input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 20px;
	margin: 0;
	background: none;
	pointer-events: none;
	appearance: none;
}
.bff-demo__rail input::-webkit-slider-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2.5px solid var(--w-ink);
	background: var(--demo-white);
	pointer-events: auto;
	cursor: grab;
	appearance: none;
}
.bff-demo__rail input::-moz-range-thumb {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2.5px solid var(--w-ink);
	background: var(--demo-white);
	pointer-events: auto;
	cursor: grab;
}
.bff-demo__rail input:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--demo-cyan);
	outline-offset: 2px;
}
.bff-demo__price-nums {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.bff-demo__price-nums label {
	display: block;
	margin-bottom: 4px;
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__price-nums input {
	width: 100%;
	min-height: 36px;
	padding: 0 8px;
	border-radius: 8px;
	border: 1px solid var(--w-line);
	color: var(--w-text);
	font: 400 13px var(--w-font);
}
.bff-demo__facet-list {
	display: grid;
	gap: 6px;
	padding: 2px 6px;
}
.bff-demo__facet-list .bff-demo__check {
	display: flex;
	font-size: 13px;
}
.bff-demo__facet-list small {
	margin-left: auto;
	color: var(--w-meta);
	font-size: 11px;
}
.bff-demo__swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, 32px);
	gap: 8px;
}
.bff-demo__swatch {
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--w-text) 18%, transparent);
	background: var(--swatch);
	cursor: pointer;
}
.bff-demo__swatch[aria-pressed='true'] {
	box-shadow:
		0 0 0 2px var(--demo-white),
		0 0 0 4px var(--w-ink);
}
.bff-demo__sizes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.bff-demo__size {
	min-height: 32px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--w-line);
	background: var(--demo-white);
	color: var(--w-text);
	font: 500 12px var(--w-font);
	cursor: pointer;
}
.bff-demo__size[aria-pressed='true'] {
	border-color: var(--w-ink);
	background: var(--w-ink);
	color: var(--demo-white);
}
.bff-demo__swatch:focus-visible,
.bff-demo__size:focus-visible,
.bff-demo__facet summary:focus-visible {
	outline: 2px solid var(--demo-cyan);
	outline-offset: 2px;
}
.bff-demo__sheet .bff-demo__facets {
	max-height: 340px;
	overflow-y: auto;
}

/* Smart search: briefly mark the filters the AI read from the shopper's words. */
.bff-demo__chips.is-ai .bff-demo__chip,
.bff-demo__price-range.is-ai,
.bff-demo__facet-list.is-ai {
	animation: bff-demo-ai 2.4s ease-out;
}
@keyframes bff-demo-ai {
	0%,
	55% {
		border-radius: 8px;
		box-shadow: 0 0 0 2px var(--demo-cyan);
		background-color: color-mix(in srgb, var(--demo-cyan) 12%, var(--demo-white));
	}
	100% {
		box-shadow: 0 0 0 2px transparent;
	}
}
@media (prefers-reduced-motion: reduce) {
	.bff-demo__chat {
		transition: none;
	}
}
.bff-demo__rail input:focus-visible {
	outline: none;
}
