/* ── Kongebonus VM 2026 PWA — Add to Home Screen popup ── */

/* Container — hidden until JS opens it */
.kb-pwa-popup {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.kb-pwa-popup.is-open {
	display: block;
}

.kb-pwa-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 30, 0.6);
}

/* Bottom sheet */
.kb-pwa-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: #222259;
	color: #ffffff;
	border-radius: 1.5rem 1.5rem 0 0;
	padding-bottom: env(safe-area-inset-bottom, 5px);
	max-height: 90vh;
	overflow-y: auto;
}

.kb-pwa-popup.is-open .kb-pwa-sheet {
	animation-name: slideUpOverlay;
	animation-duration: 1s;
}

@keyframes slideUpOverlay {
	0%   { translate: 0 100%; }
	100% { translate: 0 0; }
}

/* Top bar */
.kb-pwa-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 5px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	min-height: 46px;
}

.kb-pwa-title {
	font-size: 1.2rem;
	line-height: 2rem;
	font-weight: 700;
	margin: 0;
	color: #ffffff;
}

.kb-pwa-close {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	line-height: 0;
}

/* Install pill — always visible. Tapping it triggers the native install
   prompt when available (Android Chrome). On iOS the prompt event never
   fires, so the pill click is a no-op there and the iOS steps below are
   the actual install path. */
.kb-pwa-pill {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	background: #5aed90;
	color: #003814;
	font-weight: 700;
	border: 0;
	border-radius: 999px;
	padding: 6px 14px;
	cursor: pointer;
	font-size: 0.95rem;
}

.kb-pwa-pill:hover {
	background: #2cb55e;
}

/* Body */
.kb-pwa-body {
	padding: 30px 25px;
	color: #ffffff;
}

.kb-pwa-intro {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 15px;
}

.kb-pwa-logo {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	flex: 0 0 auto;
}

.kb-pwa-heading {
	font-weight: 700;
	margin: 0;
	font-size: 1rem;
	color: #ffffff;
}

.kb-pwa-desc {
	margin: 0 0 1.5rem;
	color: #ffffff;
}

/* Steps — shown only when no native install prompt is available */
.kb-pwa-steps {
	list-style: none;
	margin: -10px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kb-pwa-steps li {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #ffffff;
}

.kb-pwa-icon {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
}

.kb-pwa-popup.has-prompt .kb-pwa-steps {
	display: none;
}

/* Pill-click fallback flash — drawn attention to the steps when the native
   install prompt isn't available (iOS Safari, or Chrome before the event). */
.kb-pwa-steps--flash {
	animation: kbPwaFlash 0.7s ease-out;
	border-radius: 8px;
}

@keyframes kbPwaFlash {
	0%   { background-color: transparent; }
	35%  { background-color: rgba(90, 237, 144, 0.2); }
	100% { background-color: transparent; }
}

/* Popup is mobile-only by design — hide it on desktop and inside a PWA. */
@media (min-width: 769px) {
	#kb-pwa-popup {
		display: none !important;
	}
}

@media (display-mode: standalone) {
	#kb-pwa-popup {
		display: none !important;
	}
}

/* iOS standalone fallback — set by JS via body class */
body.kb-is-standalone #kb-pwa-popup {
	display: none !important;
}

/* Lock the page while the sheet is open */
body.kb-pwa-popup-open {
	overflow: hidden;
}
