/**
 * PWA App Installer — Frontend Banner CSS
 * Scoped under #pwaai-banner / .pwaai-* to avoid theme/plugin conflicts.
 * No dependency on any theme or page-builder stylesheet.
 */

.pwaai-banner {
	--pwaai-bg: #111827;
	--pwaai-text: #ffffff;
	--pwaai-btn-bg: #2563eb;
	--pwaai-btn-text: #ffffff;
	--pwaai-radius: 14px;

	position: fixed;
	left: 12px;
	right: 12px;
	z-index: 999999;
	max-width: 640px;
	margin: 0 auto;
	background: var(--pwaai-bg);
	color: var(--pwaai-text);
	border-radius: var(--pwaai-radius);
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.pwaai-banner * {
	box-sizing: border-box;
}

.pwaai-banner.pwaai-pos-bottom {
	bottom: 16px;
}

.pwaai-banner.pwaai-pos-top {
	top: 16px;
	transform: translateY(-16px);
}

.pwaai-banner.pwaai-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.pwaai-banner[hidden] {
	display: none !important;
}

.pwaai-banner-inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
}

.pwaai-banner-icon img {
	width: 46px;
	height: 46px;
	border-radius: 11px;
	object-fit: cover;
	display: block;
}

.pwaai-banner-content {
	flex: 1;
	min-width: 0;
}

.pwaai-banner-heading {
	margin: 0 0 2px;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.3;
}

.pwaai-banner-description {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.4;
	opacity: 0.85;
}

.pwaai-banner-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.pwaai-btn-install {
	background: var(--pwaai-btn-bg);
	color: var(--pwaai-btn-text);
	border: none;
	padding: 10px 18px;
	border-radius: 9px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.pwaai-btn-install:hover {
	opacity: 0.92;
}

.pwaai-btn-install:active {
	transform: scale(0.97);
}

.pwaai-btn-close {
	background: transparent;
	border: none;
	color: inherit;
	opacity: 0.65;
	cursor: pointer;
	padding: 8px;
	line-height: 0;
	border-radius: 50%;
}

.pwaai-btn-close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.08);
}

.pwaai-hide-desktop {
	display: none;
}

.pwaai-hide-mobile {
	display: none;
}

@media (max-width: 680px) {
	.pwaai-hide-desktop.pwaai-banner {
		display: block;
	}
	.pwaai-hide-mobile.pwaai-banner {
		display: none !important;
	}
	.pwaai-banner {
		left: 10px;
		right: 10px;
	}
	.pwaai-banner-inner {
		padding: 14px;
		gap: 10px;
	}
	.pwaai-banner-heading {
		font-size: 13.5px;
	}
	.pwaai-banner-description {
		font-size: 12px;
	}
}

@media (min-width: 681px) {
	.pwaai-hide-desktop.pwaai-banner {
		display: none !important;
	}
	.pwaai-hide-mobile.pwaai-banner {
		display: block;
	}
}

/* ===== iOS instructions modal ===== */

.pwaai-ios-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.pwaai-ios-modal[hidden] {
	display: none !important;
}

.pwaai-ios-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	animation: pwaai-fade-in 0.2s ease;
}

.pwaai-ios-modal-sheet {
	position: relative;
	background: #fff;
	color: #111827;
	width: 100%;
	max-width: 420px;
	margin: 0 auto 0;
	border-radius: 18px 18px 0 0;
	padding: 28px 24px 32px;
	box-sizing: border-box;
	animation: pwaai-slide-up 0.28s ease;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 480px) {
	.pwaai-ios-modal {
		align-items: center;
	}
	.pwaai-ios-modal-sheet {
		border-radius: 18px;
		margin-bottom: 0;
	}
}

.pwaai-ios-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #f1f5f9;
	border: none;
	color: #475569;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pwaai-ios-modal-sheet h2 {
	margin: 0 26px 8px 0;
	font-size: 17px;
}

.pwaai-ios-modal-text {
	margin: 0 0 18px;
	font-size: 13.5px;
	color: #475569;
	line-height: 1.5;
}

.pwaai-ios-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pwaai-ios-steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13.5px;
	line-height: 1.4;
	color: #1e293b;
}

.pwaai-ios-step-icon {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: #eff6ff;
	color: #2563eb;
	display: flex;
	align-items: center;
	justify-content: center;
}

@keyframes pwaai-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pwaai-slide-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.pwaai-banner,
	.pwaai-ios-modal-sheet,
	.pwaai-ios-modal-backdrop {
		animation: none !important;
		transition: none !important;
	}
}
