/**
 * Home — popup descuentos aliados en formato mensaje WhatsApp.
 * Mobile-first.
 */

.zp-home-allies-float {
	--zp-wa-green: #25d366;
	--zp-wa-green-dark: #075e54;
	--zp-wa-chat: #efeae2;
	--zp-wa-bubble: #ffffff;
	--zp-wa-text: #111b21;
	--zp-wa-muted: #667781;
	--zp-wa-font-scale: 1.1;
	--zp-allies-float-bottom-offset: calc(80px + env(safe-area-inset-bottom, 0px));

	position: fixed;
	left: 12px;
	right: 12px;
	bottom: var(--zp-allies-float-bottom-offset);
	z-index: 10000;
	max-width: none;
	margin: 0 auto;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
	box-sizing: border-box;
	transform: translate3d(0, calc(100% + 20px), 0);
	opacity: 0;
	visibility: hidden;
	transition:
		transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
		opacity 0.32s ease,
		visibility 0.32s ease;
	pointer-events: none;
}

.zp-home-allies-float--visible {
	transform: translate3d(0, 0, 0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.zp-home-allies-float__sheet {
	overflow: hidden;
	border-radius: 14px;
	background: var(--zp-wa-chat);
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.08),
		0 12px 32px rgba(0, 0, 0, 0.18);
}

/* Barra superior estilo notificación WhatsApp */
.zp-home-allies-float__wa-top {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 40px 8px 12px;
	background: var(--zp-wa-green-dark);
	color: #fff;
	position: relative;
}

.zp-home-allies-float__wa-top-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--zp-wa-green);
	font-size: calc(16px * var(--zp-wa-font-scale));
	line-height: 1;
}

.zp-home-allies-float__wa-top-label {
	font-size: calc(0.9375rem * var(--zp-wa-font-scale));
	font-weight: 600;
	letter-spacing: 0.01em;
}

.zp-home-allies-float__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.zp-home-allies-float__close:hover,
.zp-home-allies-float__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

/* Área de chat */
.zp-home-allies-float__wa-chat {
	padding: 12px 10px 14px;
	background-color: var(--zp-wa-chat);
	background-image:
		radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.025) 0%, transparent 45%);
}

.zp-home-allies-float__wa-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 100%;
}

.zp-home-allies-float__wa-avatar {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--zp-wa-green);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: calc(1rem * var(--zp-wa-font-scale));
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.zp-home-allies-float__wa-avatar-letter {
	text-transform: uppercase;
}

.zp-home-allies-float__wa-col {
	flex: 1 1 auto;
	min-width: 0;
	max-width: calc(100% - 44px);
}

.zp-home-allies-float__wa-meta {
	display: none;
}

/* Burbuja entrante */
.zp-home-allies-float__wa-bubble {
	position: relative;
	padding: 8px 10px 6px;
	border-radius: 8px 8px 8px 2px;
	background: var(--zp-wa-bubble);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	color: var(--zp-wa-text);
}

.zp-home-allies-float__wa-bubble::before {
	content: '';
	position: absolute;
	left: -6px;
	bottom: 0;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 8px 10px 0;
	border-color: transparent var(--zp-wa-bubble) transparent transparent;
}

.zp-home-allies-float__wa-msg {
	margin: 0 0 8px;
	padding-right: 28px;
	font-size: calc(0.875rem * var(--zp-wa-font-scale));
	line-height: 1.45;
	font-weight: 400;
	color: var(--zp-wa-text);
	word-wrap: break-word;
}

/* Preview de enlace (CTA) */
.zp-home-allies-float__wa-link {
	display: block;
	margin: 0;
	padding: 8px 10px;
	border-left: 4px solid var(--zp-wa-green);
	border-radius: 6px;
	background: #f0f2f5;
	text-decoration: none !important;
	color: inherit !important;
	box-sizing: border-box;
	min-height: 44px;
}

.zp-home-allies-float__wa-link:hover,
.zp-home-allies-float__wa-link:focus-visible {
	background: #e9edef;
}

.zp-home-allies-float__wa-link-title {
	display: block;
	font-size: calc(0.8125rem * var(--zp-wa-font-scale));
	font-weight: 600;
	line-height: 1.3;
	color: var(--zp-wa-green-dark);
}

.zp-home-allies-float__wa-link-desc {
	display: block;
	margin-top: 2px;
	font-size: calc(0.75rem * var(--zp-wa-font-scale));
	line-height: 1.35;
	color: var(--zp-wa-muted);
}

/* Checks azules + hora */
.zp-home-allies-float__wa-ticks {
	position: absolute;
	right: 8px;
	bottom: 6px;
	font-size: calc(11px * var(--zp-wa-font-scale));
	line-height: 1;
	color: #53bdeb;
	letter-spacing: -3px;
}

.zp-home-allies-float__wa-ticks .fa-check:last-child {
	margin-left: -5px;
}

@media (min-width: 1024px) {
	.zp-home-allies-float {
		left: 50%;
		right: auto;
		width: min(380px, calc(100vw - 32px));
		max-width: 380px;
		margin: 0;
		bottom: max(24px, env(safe-area-inset-bottom, 0px));
		--zp-allies-float-bottom-offset: max(24px, env(safe-area-inset-bottom, 0px));
		transform: translate3d(-50%, calc(100% + 20px), 0);
	}

	.zp-home-allies-float--visible {
		transform: translate3d(-50%, 0, 0);
	}

	.zp-home-allies-float__wa-msg {
		font-size: calc(0.9375rem * var(--zp-wa-font-scale));
	}
}

@media (prefers-reduced-motion: reduce) {
	.zp-home-allies-float {
		transition: none;
	}

	.zp-home-allies-float--visible {
		transform: none;
	}

	@media (min-width: 1024px) {
		.zp-home-allies-float--visible {
			transform: translate3d(-50%, 0, 0);
		}
	}
}
