/**
 * iFody — PWA (botão instalar + card "ganhe R$5" + modal iOS).
 *
 * Carrega em todas as páginas (CSS leve, ~1.5kb gz). Componentes começam
 * com display:none e o pwa.js mostra via remove `hidden` quando aplicável.
 */

/* Card "Baixe o app e ganhe R$5" — usado no my-account dashboard. */
.pwa-cta {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 20px;
	background: linear-gradient( 135deg, #FFE3EF 0%, #FFF1D6 100% );
	border: 1px solid rgba( 233, 30, 99, .12 );
	border-radius: 16px;
	margin-bottom: 16px;
	overflow: hidden;
}
.pwa-cta[hidden] { display: none !important; }
.pwa-cta__icon {
	flex: 0 0 56px;
	height: 56px;
	border-radius: 14px;
	display: grid;
	place-items: center;
	background: #FFF;
	box-shadow: 0 4px 12px rgba( 0, 0, 0, .06 );
}
.pwa-cta__icon img { width: 36px; height: 36px; object-fit: contain; }
.pwa-cta__body { flex: 1 1 auto; min-width: 0; }
.pwa-cta__kicker {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #E91E63;
	margin-bottom: 4px;
}
.pwa-cta__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	color: #1A1A1A;
}
.pwa-cta__desc {
	margin: 0;
	font-size: 13px;
	color: #4A4A4A;
	line-height: 1.4;
}
.pwa-cta__cta { flex: 0 0 auto; }

@media (max-width: 540px) {
	.pwa-cta { flex-wrap: wrap; }
	.pwa-cta__cta { width: 100%; }
	.pwa-cta__cta .btn { width: 100%; }
}

/* Botão "Instalar app" no drawer mobile / footer / qualquer lugar. */
.pwa-install-btn[hidden] { display: none !important; }

/* Snackbar flutuante (bottom-right desktop, full-width bottom mobile). */
.pwa-snackbar {
	position: fixed;
	z-index: 9998;
	background: #FFF;
	border: 1px solid rgba( 0, 0, 0, .08 );
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba( 0, 0, 0, .18 );
	padding: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 420px;
	animation: pwa-snackbar-in .35s ease-out;
}
.pwa-snackbar[hidden] { display: none !important; }
.pwa-snackbar a { text-decoration: none; }

/* Desktop: canto inferior direito. */
@media (min-width: 769px) {
	.pwa-snackbar {
		right: 20px;
		bottom: 20px;
		width: 420px;
	}
}

/* Mobile: full-width acima da bottombar (que tem ~72px altura). */
@media (max-width: 768px) {
	.pwa-snackbar {
		left: 12px;
		right: 12px;
		bottom: 84px;
		max-width: none;
	}
}

@keyframes pwa-snackbar-in {
	from { transform: translateY( 24px ); opacity: 0; }
	to   { transform: translateY( 0 );    opacity: 1; }
}

.pwa-snackbar__icon {
	flex: 0 0 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient( 135deg, #FFE3EF, #FFF1D6 );
	display: grid;
	place-items: center;
}
.pwa-snackbar__icon img { width: 28px; height: 28px; object-fit: contain; }

.pwa-snackbar__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.pwa-snackbar__title {
	font-size: 14px;
	font-weight: 700;
	color: #1A1A1A;
	line-height: 1.25;
}
.pwa-snackbar__desc {
	font-size: 12px;
	color: #555;
	line-height: 1.35;
}

.pwa-snackbar__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}
.pwa-snackbar__close {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 0;
	background: #F5F5F5;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #555;
	display: grid;
	place-items: center;
	padding: 0;
}
.pwa-snackbar__close:hover { background: #EAEAEA; }

@media (max-width: 380px) {
	.pwa-snackbar { flex-wrap: wrap; }
	.pwa-snackbar__actions { width: 100%; justify-content: flex-end; }
}


/* Modal de instruções iOS. */
.pwa-ios-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba( 0, 0, 0, .55 );
	display: grid;
	place-items: center;
	padding: 20px;
}
.pwa-ios-modal[hidden] { display: none !important; }
.pwa-ios-modal__panel {
	background: #FFF;
	border-radius: 20px;
	padding: 28px 24px 24px;
	max-width: 380px;
	width: 100%;
	position: relative;
	box-shadow: 0 24px 64px rgba( 0, 0, 0, .25 );
}
.pwa-ios-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: #F5F5F5;
	cursor: pointer;
	display: grid;
	place-items: center;
	font-size: 18px;
	line-height: 1;
}
.pwa-ios-modal h3 {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
}
.pwa-ios-modal ol {
	margin: 0 0 16px;
	padding-left: 0;
	list-style: none;
	counter-reset: pwa-ios;
}
.pwa-ios-modal ol li {
	counter-increment: pwa-ios;
	position: relative;
	padding: 8px 0 8px 36px;
	font-size: 14px;
	color: #1A1A1A;
	line-height: 1.5;
}
.pwa-ios-modal ol li::before {
	content: counter( pwa-ios );
	position: absolute;
	left: 0;
	top: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #FFE3EF;
	color: #E91E63;
	font-weight: 700;
	font-size: 13px;
	display: grid;
	place-items: center;
}
.pwa-ios-modal__hint {
	margin: 12px 0 0;
	padding: 10px 12px;
	background: #F8F8F8;
	border-radius: 10px;
	font-size: 12px;
	color: #555;
	line-height: 1.4;
}
