/**
 * LOCATOUT BENIN — PWA : styles frontend.
 * Utilise les variables CSS du thème (--color-primary, --smooth-ease) si
 * disponibles, avec des valeurs de repli sinon — pour rester cohérent
 * visuellement avec ListingHive Pro sans en dépendre techniquement.
 */

.pwa-banner,
.pwa-ios-sheet {
	--pwa-accent: var(--color-primary, #3b45c4);
	--pwa-ease: var(--smooth-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

/* ============================================================
   Bannière d'installation (bas de l'écran).
   ============================================================ */
.pwa-banner {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 999998;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 460px;
	margin: 0 auto;
	padding: 14px 14px 14px 16px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(15, 23, 39, 0.18);
	transform: translateY(120%);
	opacity: 0;
	transition: transform 0.4s var(--pwa-ease), opacity 0.4s var(--pwa-ease);
}

.pwa-banner.is-visible {
	transform: translateY(0);
	opacity: 1;
}

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

.pwa-banner__icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	flex-shrink: 0;
	object-fit: cover;
}

.pwa-banner__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.pwa-banner__title {
	font-size: 0.9rem;
	font-weight: 700;
}

.pwa-banner__desc {
	font-size: 0.78rem;
	opacity: 0.65;
	line-height: 1.35;
}

.pwa-banner__actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.pwa-banner__install {
	background: var(--pwa-accent);
	color: #fff;
	border: none;
	border-radius: 9999px;
	padding: 9px 16px;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.pwa-banner__dismiss {
	background: none;
	border: none;
	font-size: 1.3rem;
	line-height: 1;
	color: rgba(15, 23, 39, 0.35);
	cursor: pointer;
	padding: 4px;
}

.pwa-banner__dismiss:hover {
	color: rgba(15, 23, 39, 0.7);
}

@media only screen and (max-width: 26em) {
	.pwa-banner {
		flex-wrap: wrap;
	}

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

/* ============================================================
   Feuille d'instructions iOS (Safari ne permet pas d'invite
   programmatique : on guide l'utilisateur pas à pas).
   ============================================================ */
.pwa-ios-sheet {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.pwa-ios-sheet[hidden] {
	display: none !important;
}

.pwa-ios-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 39, 0.5);
}

.pwa-ios-sheet__box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: 20px 20px 0 0;
	padding: 28px 24px calc(24px + env(safe-area-inset-bottom, 0px));
	animation: pwa-ios-sheet-in 0.35s var(--pwa-ease, ease);
}

@media only screen and (min-width: 30em) {
	.pwa-ios-sheet {
		align-items: center;
	}

	.pwa-ios-sheet__box {
		border-radius: 20px;
	}
}

@keyframes pwa-ios-sheet-in {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.pwa-ios-sheet__close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.4rem;
	color: rgba(15, 23, 39, 0.4);
	cursor: pointer;
}

.pwa-ios-sheet__title {
	margin: 0 0 18px;
	font-size: 1.05rem;
	font-weight: 700;
	padding-right: 20px;
}

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

.pwa-ios-sheet__steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.9rem;
}

.pwa-ios-sheet__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: rgba(var(--color-primary-rgb, 59, 69, 196), 0.1);
	color: var(--pwa-accent);
	font-size: 1.1rem;
	flex-shrink: 0;
}

.pwa-ios-sheet__ok {
	width: 100%;
	background: var(--pwa-accent);
	color: #fff;
	border: none;
	border-radius: 9999px;
	padding: 12px;
	font-weight: 600;
	cursor: pointer;
}

/* ============================================================
   Bouton autonome [pwa_install_button].
   ============================================================ */
.pwa-standalone-button[hidden] {
	display: none !important;
}
