/**
 * Floating WhatsApp Widget Styles.
 * Properly anchored at the bottom-right corner with smooth pulse animation.
 *
 * @package ViajerosCusco
 */

.wa-widget {
	position: fixed;
	right: 2.8rem;
	bottom: 2.8rem;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1.2rem;
}

/* Floating Action Button */
.wa-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 6.0rem;
	height: 6.0rem;
	padding: 0;
	background: #25D366;
	color: #ffffff !important;
	border: none;
	border-radius: var(--radius-full);
	box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.wa-toggle:hover {
	background: #1eb954;
	transform: scale(1.08);
	box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6), 0 3px 8px rgba(0, 0, 0, 0.15);
	color: #ffffff !important;
}

.wa-toggle i,
.wa-toggle svg {
	font-size: 3.2rem;
	width: 3.2rem;
	height: 3.2rem;
	color: #ffffff !important;
	fill: #ffffff !important;
	line-height: 1;
}

.wa-toggle .wa-icon-close {
	display: none;
	font-size: 2.8rem;
	color: #ffffff;
}

.wa-widget.open .wa-icon-open {
	display: none;
}

.wa-widget.open .wa-icon-close {
	display: block;
}

/* Pulsing Wave Animation */
.wa-toggle::before,
.wa-toggle::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--radius-full);
	background: #25D366;
	z-index: -1;
	animation: wa-pulse 2.2s ease-out infinite;
	pointer-events: none;
}

.wa-toggle::after {
	animation-delay: 1.1s;
}

.wa-widget.open .wa-toggle::before,
.wa-widget.open .wa-toggle::after {
	animation: none;
	opacity: 0;
}

@keyframes wa-pulse {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	60% {
		transform: scale(1.6);
		opacity: 0.15;
	}
	100% {
		transform: scale(1.85);
		opacity: 0;
	}
}

/* Card Popup (when multi-agent) */
.wa-card {
	display: none;
	width: 32rem;
	max-width: calc(100vw - 4.8rem);
	background: #ffffff;
	border-radius: var(--radius-lg);
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	border: 1px solid var(--c-border-light);
}

.wa-widget.open .wa-card {
	display: block;
	animation: wa-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wa-slide-up {
	from {
		transform: translateY(1.6rem) scale(0.95);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.wa-card-header {
	padding: var(--sp-4) var(--sp-5);
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	color: #ffffff;
}

.wa-card-title {
	margin: 0 0 0.4rem 0;
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	color: #ffffff;
	font-family: var(--ff-heading);
}

.wa-card-subtitle {
	margin: 0;
	font-size: var(--fs-xs);
	opacity: 0.92;
	color: #ffffff;
}

/* Agent list */
.wa-agents {
	margin: 0;
	padding: var(--sp-3);
	list-style: none;
}

.wa-agent {
	display: flex;
	align-items: center;
	gap: 1.2rem;
	padding: var(--sp-3);
	margin-bottom: var(--sp-2);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	text-decoration: none;
	background: #ffffff;
	transition: all var(--transition);
}

.wa-agent:last-child {
	margin-bottom: 0;
}

.wa-agent:hover {
	background: #f9fafb;
	border-color: #25D366;
	transform: translateX(3px);
}

.wa-agent-avatar {
	position: relative;
	width: 4.0rem;
	height: 4.0rem;
	border-radius: var(--radius-full);
	background: #e5e7eb;
	color: var(--c-dark);
	font-weight: var(--fw-bold);
	font-family: var(--ff-heading);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--fs-base);
	flex-shrink: 0;
}

.wa-agent-status {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: var(--radius-full);
	background: #25D366;
	border: 2px solid #ffffff;
}

.wa-agent-info {
	flex: 1;
	min-width: 0;
}

.wa-agent-name {
	display: block;
	font-family: var(--ff-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	color: var(--c-dark);
	line-height: 1.2;
}

.wa-agent-role {
	display: block;
	font-size: var(--fs-xs);
	color: var(--c-text-light);
	margin-top: 0.2rem;
}

.wa-agent-arrow {
	color: var(--c-text-muted);
	font-size: 2.0rem;
}

.wa-card-footer {
	margin: 0;
	padding: var(--sp-2) var(--sp-4);
	text-align: center;
	font-size: 1.1rem;
	color: var(--c-text-muted);
	background: #f9fafb;
	border-top: 1px solid var(--c-border-light);
}

@media (max-width: 640px) {
	.wa-widget {
		right: 1.8rem;
		bottom: 1.8rem;
	}
	.wa-toggle {
		width: 5.4rem;
		height: 5.4rem;
	}
	.wa-toggle i,
	.wa-toggle svg {
		font-size: 2.8rem;
		width: 2.8rem;
		height: 2.8rem;
	}
}
