/* Campsite Booking System — PWA install banner.
 *
 * Slim, dismissible bar fixed to the TOP of the viewport on the guest portal
 * and warden pages. (Top, not bottom: iOS Safari's toolbar sits at the bottom
 * of the screen and would hide a bottom-pinned banner.) The accent colour is
 * set per-context from PHP via the --tpcbs-pwa-accent custom property (guest
 * green / warden blue), tracking the installed app's manifest theme colour.
 */

.tpcbs-pwa-banner {
	--tpcbs-pwa-accent: #1d7a4d;
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	z-index: 99999;
	background: #ffffff;
	border-bottom: 3px solid var(--tpcbs-pwa-accent);
	box-shadow: 0 2px 16px rgba( 0, 0, 0, 0.12 );
	padding: env( safe-area-inset-top, 0 ) 0 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1f2937;
}

.tpcbs-pwa-banner__inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 12px;
	max-width: 720px;
	margin: 0 auto;
	padding: 10px 14px;
}

.tpcbs-pwa-banner__icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 9px;
	object-fit: cover;
}

.tpcbs-pwa-banner__text {
	flex: 1 1 160px;
	margin: 0;
	font-size: 14px;
	line-height: 1.35;
	font-weight: 600;
}

.tpcbs-pwa-banner__note {
	flex: 1 1 100%;
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #6b7280;
}

.tpcbs-pwa-banner__action {
	flex: 0 0 auto;
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--tpcbs-pwa-accent);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	padding: 10px 18px;
	border-radius: 999px;
	min-height: 44px; /* touch target */
}

.tpcbs-pwa-banner__action:hover {
	filter: brightness( 0.94 );
}

.tpcbs-pwa-banner__dismiss {
	flex: 0 0 auto;
	appearance: none;
	border: 0;
	background: transparent;
	color: #6b7280;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.tpcbs-pwa-banner__dismiss:hover {
	background: #f3f4f6;
	color: #111827;
}

/* Shared visible focus ring for keyboard users. */
.tpcbs-pwa-banner__action:focus-visible,
.tpcbs-pwa-banner__dismiss:focus-visible {
	outline: 3px solid var(--tpcbs-pwa-accent);
	outline-offset: 2px;
}

/* iOS Add-to-Home-Screen instructions panel.
 * Only lay out as flex when NOT hidden — otherwise this author rule would
 * override the UA `[hidden] { display: none }` and the panel could never
 * collapse, leaving the toggle button looking dead. */
.tpcbs-pwa-steps {
	max-width: 720px;
	margin: 0 auto;
	padding: 4px 14px 14px;
	flex-direction: column;
	gap: 10px;
	border-top: 1px solid #e5e7eb;
}

.tpcbs-pwa-steps:not([hidden]) {
	display: flex;
}

.tpcbs-pwa-step {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	line-height: 1.35;
}

.tpcbs-pwa-step__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 9px;
	background: #f3f4f6;
	color: var(--tpcbs-pwa-accent);
}

.tpcbs-pwa-step__label {
	flex: 1 1 auto;
	font-weight: 600;
}

/* Push page content down so the fixed top banner doesn't cover it. */
body.tpcbs-pwa-has-banner {
	padding-top: 84px;
}

@media (min-width: 600px) {
	.tpcbs-pwa-banner__text {
		font-size: 15px;
	}
}
