/**
 * LandTech Extras — PWA install banner, push bell and toast.
 *
 * @since 3.18.0
 */

.ltxe-pwa-banner {
	position: fixed;
	left: 50%;
	bottom: 16px;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 12px;
	width: min( 560px, calc( 100vw - 24px ) );
	padding: 12px 14px;
	border-radius: 12px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.18 );
	font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
	opacity: 0;
	transform: translate( -50%, 20px );
	transition: opacity 0.25s ease, transform 0.25s ease;
	box-sizing: border-box;
}

/* Doubled class: themes commonly ship `[role="region"] { position: relative }` at equal specificity. */
.ltxe-pwa-banner.ltxe-pwa-banner {
	position: fixed;
}

.ltxe-pwa-banner.is-visible {
	opacity: 1;
	transform: translate( -50%, 0 );
}

.ltxe-pwa-banner__icon {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 10px;
}

.ltxe-pwa-banner__text {
	flex: 1 1 auto;
	margin: 0;
}

.ltxe-pwa-banner__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.ltxe-pwa-banner button,
.ltxe-pwa-bell__panel button {
	cursor: pointer;
	padding: 8px 14px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
}

.ltxe-pwa-banner__install,
.ltxe-pwa-bell__allow {
	background: var( --ltxe-pwa-accent, #111 );
	color: #fff;
}

.ltxe-pwa-banner__dismiss,
.ltxe-pwa-bell__later {
	background: transparent;
	border-color: #c3c4c7 !important;
	color: #1d2327;
}

.ltxe-pwa-banner button:focus-visible,
.ltxe-pwa-bell button:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

@media ( max-width: 480px ) {
	.ltxe-pwa-banner {
		flex-wrap: wrap;
	}

	.ltxe-pwa-banner__actions {
		width: 100%;
		justify-content: flex-end;
	}
}

html.ltxe-pwa-installed .ltxe-pwa-install,
html.ltxe-pwa-installed [data-ltxe-pwa-install] {
	display: none !important;
}

/* Push bell */

.ltxe-pwa-bell {
	position: fixed;
	left: 16px;
	bottom: calc( 16px + var( --ltxe-pwa-banner-offset, 0px ) );
	transition: bottom 0.25s ease;
	z-index: 99989;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ltxe-pwa-bell__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var( --ltxe-pwa-accent, #111 );
	color: #fff;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.22 );
	cursor: pointer;
}

.ltxe-pwa-bell__button.is-on {
	background: #1e7e34;
}

.ltxe-pwa-bell__panel {
	width: min( 280px, calc( 100vw - 32px ) );
	padding: 12px;
	border-radius: 10px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.18 );
	box-sizing: border-box;
}

.ltxe-pwa-bell__panel p {
	margin: 0 0 10px;
}

.ltxe-pwa-bell__panel button + button {
	margin-left: 6px;
}

/* Toast */

.ltxe-pwa-toast {
	position: fixed;
	left: 50%;
	top: 16px;
	z-index: 99991;
	max-width: calc( 100vw - 32px );
	padding: 10px 16px;
	border-radius: 8px;
	background: #1d2327;
	color: #fff;
	font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
	opacity: 0;
	pointer-events: none;
	transform: translate( -50%, -10px );
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ltxe-pwa-toast.is-visible {
	opacity: 1;
	transform: translate( -50%, 0 );
}

@media ( prefers-reduced-motion: reduce ) {
	.ltxe-pwa-banner,
	.ltxe-pwa-bell,
	.ltxe-pwa-toast {
		transition: none;
	}
}
