/*
 * Best Before PWA - install button + iOS sheet + footer banner.
 * Phone-only (<=767px, matching bb-theme's mobile breakpoint). Visibility
 * beyond that is decided client-side in assets/js/install.js (install
 * state, beforeinstallprompt / iOS detection).
 */

[hidden] { display: none !important; }

.bbpwa-install-wrap,
.bbpwa-banner {
	display: none;
}

@media (max-width: 767px) {
	.bbpwa-install-wrap {
		display: inline-block;
		position: relative;
	}
	.bbpwa-banner {
		display: flex;
	}
}

/* Button */
.bbpwa-install-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--bb-touch, 44px);
	padding: 0 16px;
	border: 1.5px solid var(--bb-ink, #111);
	border-radius: var(--bb-r-control, 12px);
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	font-weight: 700;
	font-size: .875rem;
	line-height: 1;
	cursor: pointer;
}
.bbpwa-install-btn svg { flex: none; }
.bbpwa-install-btn:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: 2px; }

/* iOS instruction sheet */
.bbpwa-ios-sheet {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1;
	width: max-content;
	max-width: 260px;
	padding: 12px 36px 12px 14px;
	border-radius: var(--bb-r-control, 12px);
	background: var(--bb-ink, #111);
	color: #fff;
	font-size: .8125rem;
	line-height: 1.45;
	box-shadow: var(--bb-shadow, 0 1px 2px rgba(0, 0, 0, .06));
}
.bbpwa-ios-sheet p { margin: 0; }
.bbpwa-ios-sheet svg { flex: none; vertical-align: -3px; margin-right: 4px; color: var(--bb-yellow, #ffcf02); }
.bbpwa-ios-sheet__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 28px;
	height: 28px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 1.125rem;
	line-height: 1;
	cursor: pointer;
}
.bbpwa-ios-sheet__close:focus-visible { outline: 3px solid var(--bb-yellow, #ffcf02); outline-offset: 2px; }

/* Footer banner */
.bbpwa-banner {
	position: fixed;
	left: 12px;
	right: 12px;
	z-index: 65; /* above .bb-tabs (60), below the cookie-consent bar (70) */
	align-items: center;
	gap: 12px;
	padding: 14px 10px 14px 16px;
	border-radius: var(--bb-r-panel, 20px);
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	border: 1px solid var(--bb-border, #e5e3db);
	box-shadow: var(--bb-shadow, 0 1px 2px rgba(0, 0, 0, .06));
}

@media (max-width: 767px) {
	body:has(.bb-tabs) .bbpwa-banner { bottom: calc(var(--bb-tabs-h, 64px) + 12px + env(safe-area-inset-bottom)); }
	body:not(:has(.bb-tabs)) .bbpwa-banner { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.bbpwa-banner:not([hidden]) {
	animation: bbpwa-slide-up .3s var(--bb-ease, ease) both;
}
@keyframes bbpwa-slide-up {
	from { transform: translateY(16px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.bbpwa-banner:not([hidden]) { animation: none; }
}

.bbpwa-banner__body { flex: 1 1 auto; min-width: 0; }
.bbpwa-banner__body strong { display: block; font-size: .8125rem; margin: 0 0 2px; }
.bbpwa-banner__body p { margin: 0; font-size: .75rem; color: var(--bb-muted, #666); line-height: 1.35; }

.bbpwa-banner__actions { display: flex; align-items: center; gap: 4px; flex: none; }
.bbpwa-banner__install {
	min-height: 40px;
	padding: 0 14px;
	border: 0;
	border-radius: var(--bb-r-control, 12px);
	background: var(--bb-yellow, #ffcf02);
	color: var(--bb-ink, #111);
	font-weight: 700;
	font-size: .8125rem;
	cursor: pointer;
}
.bbpwa-banner__dismiss {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--bb-ink, #111);
	font-size: 1.125rem;
	line-height: 1;
	cursor: pointer;
}
.bbpwa-banner__install:focus-visible,
.bbpwa-banner__dismiss:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: 2px; }

@media print {
	.bbpwa-banner,
	.bbpwa-install-wrap { display: none !important; }
}
