/* Platform preview ([bdn_app_preview]) — an HTML/CSS picture of the app.
 * Palette as on Pricing/Home: purple #441A48 (app bar, Ask AI), teal #28BDB1, yellow #F8C83E,
 * warm greys #F5F3F0 / #ECE8E2, slate #2B4448. */

.bfi-ap {
	max-width: 1210px;
	margin: 0 auto;
	overflow: hidden;
	border: 1px solid #ECE8E2;
	border-radius: 22px;
	background: #FAF9F7;
	box-shadow: 0 30px 60px rgba(30, 12, 34, .12), 0 2px 6px rgba(0, 0, 0, .04);
	text-align: left;
	line-height: 1.4;
}
.bfi-ap-i {
	display: block;
	width: 20px;
	height: 20px;
}

/* App bar */
.bfi-ap-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 60px;
	padding: 0 20px;
	background: #441A48;
	color: #fff;
}
.bfi-ap-bar-btn,
.bfi-ap-bar-end {
	display: flex;
	gap: 18px;
	opacity: .9;
}
.bfi-ap-search {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 540px;
	height: 38px;
	margin: 0 auto;
	padding: 0 16px;
	border-radius: 999px;
	background: #fff;
	color: #8A8F92;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
}
.bfi-ap-search span {
	overflow: hidden;
	text-overflow: ellipsis;
}
.bfi-ap-search .bfi-ap-i {
	flex: 0 0 18px;
	color: #441A48;
}

/* AI prompt bar: same height, a thin teal→yellow ring, sparkle, typed prompt, light "Ask AI" pill. */
.bfi-ap-search.is-ai {
	justify-content: flex-start;
	gap: 10px;
	padding: 0 4px 0 12px;
	border: 2px solid transparent;
	background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #28BDB1, #8FD3C1 45%, #F8C83E) border-box;
	color: #2B4448;
}
.bfi-ap-spark .bfi-ap-i {
	width: 18px;
	height: 18px;
	color: #28BDB1;
	fill: currentColor;
	stroke-width: 1;
}
.bfi-ap-prompt {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.bfi-ap-prompt.is-typing::after {
	content: "";
	display: inline-block;
	width: 1.5px;
	height: 1.05em;
	margin-left: 2px;
	vertical-align: -0.15em;
	background: #28BDB1;
	animation: bfi-ap-caret 1s steps(1) infinite;
}
@keyframes bfi-ap-caret {
	50% { opacity: 0; }
}
.bfi-ap-ask {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 12px 0 10px;
	border-radius: 999px;
	background: #441A48;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}
.bfi-ap-ask .bfi-ap-i {
	width: 14px;
	height: 14px;
	color: #fff;
	fill: currentColor;
	stroke-width: 1;
}

/* Side menu + main area */
.bfi-ap-body {
	display: grid;
	grid-template-columns: 68px minmax(0, 1fr);
}
.bfi-ap-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 20px 0;
	border-right: 1px solid #EFEBE5;
	background: #fff;
	color: #2B4448;
}
.bfi-ap-side > span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
}
.bfi-ap-side > .is-active {
	background: #E3F5F3;
	color: #28BDB1;
}
.bfi-ap-side > .bfi-ap-side-end {
	margin-top: auto;
}
.bfi-ap-main {
	padding: 22px 26px 26px;
}

/* Number cards */
.bfi-ap-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 14px;
}
.bfi-ap-kpi {
	display: grid;
	grid-template-columns: 42px 1fr;
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid #EFEBE5;
	border-radius: 14px;
	background: #fff;
}
.bfi-ap-kpi-icon {
	grid-row: span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
}
.bfi-ap-kpi.is-teal .bfi-ap-kpi-icon { background: #E3F5F3; color: #1E9C92; }
.bfi-ap-kpi.is-yellow .bfi-ap-kpi-icon { background: #FEF3D3; color: #C28A00; }
.bfi-ap-kpi.is-orange .bfi-ap-kpi-icon { background: #FDEBDD; color: #D9661A; }
.bfi-ap-kpi.is-blue .bfi-ap-kpi-icon { background: #E5EEFB; color: #2F6FDB; }
.bfi-ap-kpi-num {
	font-size: 22px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: #000;
}
.bfi-ap-kpi-label {
	min-width: 0;
	overflow-wrap: break-word;
	font-size: 13px;
	color: #5C6B6D;
}

/* Section titles inside the app */
.bfi-ap .bfi-ap-title {
	margin: 24px 0 12px;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	color: #000;
}

/* Category tiles (links to the category pages) */
.bfi-ap-tiles {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}
.bfi-ap .bfi-ap-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 18px 12px 14px;
	border: 1px solid #EFEBE5;
	border-radius: 14px;
	background: #fff;
	color: #1a1a1a;
	text-align: center;
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.bfi-ap .bfi-ap-tile:hover,
.bfi-ap .bfi-ap-tile:focus-visible {
	border-color: #28BDB1;
	box-shadow: 0 10px 24px rgba(0, 54, 92, .10);
	transform: translateY(-2px);
	color: #1a1a1a;
}
.bfi-ap-tile-icon {
	width: 34px;
	height: 34px;
	margin-bottom: 4px;
	background-color: #5C6B6D;
	-webkit-mask: var(--bfi-ap-icon) center / contain no-repeat;
	mask: var(--bfi-ap-icon) center / contain no-repeat;
	transition: background-color .2s ease;
}
.bfi-ap-tile:hover .bfi-ap-tile-icon,
.bfi-ap-tile.is-checked .bfi-ap-tile-icon {
	background-color: #28BDB1;
}
.bfi-ap-tile-name {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}
.bfi-ap-tile-count {
	font-size: 12px;
	color: #5C6B6D;
}
.bfi-ap-check {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 16px;
	height: 16px;
	border-radius: 5px;
	background: #EEEBE6;
}
.bfi-ap-tile.is-checked .bfi-ap-check {
	background: #28BDB1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.bfi-ap .bfi-ap-tile.is-all {
	/* Fills the rest of the last row (span set per layout from PHP). */
	grid-column: span var(--bfi-ap-span6, 1);
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-content: center;
	gap: 4px 12px;
	border-color: #F6E6B0;
	background: #FFFBEE; /* light yellow, almost white */
}
.bfi-ap .bfi-ap-tile.is-all:hover {
	border-color: #F8C83E;
	background: #FFF7DD;
}
.bfi-ap-tile.is-all .bfi-ap-tile-name {
	font-weight: 600;
}
.bfi-ap-tile.is-all .bfi-ap-tile-count {
	color: #5C6B6D;
}
.bfi-ap-tile.is-all .bfi-ap-i {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	transition: transform .15s ease;
}
.bfi-ap-tile.is-all:hover .bfi-ap-i {
	transform: translateX(3px);
}
.bfi-ap-all-copy {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.bfi-ap-all-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 16px;
	/* Brand yellow button on the light banner. */
	border: 0;
	border-radius: 999px;
	background: #F8C83E;
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	transition: background-color .2s ease;
}
.bfi-ap-tile.is-all:hover .bfi-ap-all-cta {
	background: #F2BC1F;
}
@media (min-width: 1025px) {
	.bfi-ap .bfi-ap-tile.is-all {
		align-self: stretch; /* same height as the category tiles in its row */
		justify-content: space-between;
		align-items: center;
		gap: 12px 20px;
		padding: 18px 28px;
		text-align: left;
	}
	.bfi-ap-tile.is-all .bfi-ap-tile-name {
		font-size: 18px;
		line-height: 1.3;
	}
	.bfi-ap-tile.is-all .bfi-ap-tile-count {
		font-size: 14px;
	}
	.bfi-ap-all-cta {
		padding: 11px 20px;
		font-size: 13px;
	}
}

/* Countries */
.bfi-ap-countries {
	/* Two even rows: as many columns as half the countries (set from PHP). */
	display: grid;
	grid-template-columns: repeat(var(--bfi-ap-country-cols, 6), minmax(0, 1fr));
	gap: 8px;
}
.bfi-ap-country {
	display: flex;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 8px;
	border: 1px solid #EFEBE5;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	color: #1a1a1a;
}
.bfi-ap-flag {
	flex: 0 0 20px;
	width: 20px;
	height: 14px;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

@media (max-width: 1199px) {
	.bfi-ap-tiles {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
	.bfi-ap .bfi-ap-tile.is-all {
		grid-column: span var(--bfi-ap-span5, 1);
	}
}
@media (max-width: 1024px) {
	.bfi-ap-tiles {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.bfi-ap .bfi-ap-tile.is-all {
		grid-column: span var(--bfi-ap-span4, 1);
	}
	.bfi-ap-countries {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
@media (max-width: 767px) {
	.bfi-ap {
		border-radius: 18px;
	}
	.bfi-ap-bar {
		gap: 10px;
		height: 52px;
		padding: 0 12px;
	}
	.bfi-ap-bar-end {
		display: none;
	}
	.bfi-ap-search {
		height: 34px;
		font-size: 13px;
	}
	/* Phones: "Ask AI" as an icon-only circle. */
	.bfi-ap-ask {
		width: 26px;
		height: 26px;
		padding: 0;
		justify-content: center;
	}
	.bfi-ap-ask > span {
		display: none;
	}
	.bfi-ap-body {
		grid-template-columns: minmax(0, 1fr);
	}
	.bfi-ap-side {
		display: none;
	}
	.bfi-ap-main {
		padding: 14px;
	}
	.bfi-ap-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	/* Phones: number + label only (long labels like "Produktkategorien" need the width). */
	.bfi-ap-kpi {
		grid-template-columns: minmax(0, 1fr);
		padding: 10px 12px;
	}
	.bfi-ap-kpi-icon {
		display: none;
	}
	.bfi-ap-kpi-num {
		font-size: 17px;
	}
	.bfi-ap-kpi-label {
		font-size: 12px;
		line-height: 1.25;
	}
	.bfi-ap .bfi-ap-title {
		margin: 18px 0 10px;
		font-size: 14px;
	}
	.bfi-ap-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.bfi-ap .bfi-ap-tile {
		gap: 3px;
		padding: 12px 8px 10px;
	}
	.bfi-ap-tile-icon {
		width: 26px;
		height: 26px;
		margin-bottom: 2px;
	}
	.bfi-ap-tile-name {
		font-size: 12px;
	}
	.bfi-ap-tile-count {
		font-size: 11px;
	}
	.bfi-ap-check {
		top: 8px;
		right: 8px;
		width: 13px;
		height: 13px;
		border-radius: 4px;
	}
	/* Phones: the 6 largest categories + "All categories". */
	.bfi-ap-tile:nth-child(n+7):not(.is-all) {
		display: none;
	}
	.bfi-ap .bfi-ap-tile.is-all {
		grid-column: 1 / -1;
		gap: 4px 10px;
		padding: 14px;
	}
	.bfi-ap-countries {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.bfi-ap-country:nth-child(n+7) {
		display: none;
	}
}

/* Category tiles: one-time entrance (js/app-preview.js adds the classes the first
 * time the preview scrolls into view, then removes them — no replay on scroll). */
.bfi-ap.is-tiles-ready .bfi-ap-tile {
	opacity: 0;
	transform: translateY(14px) scale(.98);
}
.bfi-ap.is-tiles-ready.is-tiles-in .bfi-ap-tile {
	opacity: 1;
	transform: none;
	transition: opacity .55s ease, transform .7s cubic-bezier(.2, .75, .25, 1);
	transition-delay: calc(var(--bfi-ap-i, 0) * 45ms);
}
