/* WhatsApp flotante — botón + panel desplegable
   Animaciones idénticas al PoC (Motion One) en CSS puro
   Open  → cubic-bezier(0.34, 1.56, 0.64, 1)  (bounce)
   Close → cubic-bezier(0.4, 0, 1, 1)         (curva agresiva)
   Fade del contenido al cerrar → 0.15s ease-in (más rápido que el shrink del panel) */

.whatsapp_flotante {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 40;
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	pointer-events: none;
	width: fit-content;
}

.btn-wsp {
	position: relative;
	width: 55px;
	height: 55px;
	background: #25D366;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
	pointer-events: auto;
	color: #fff;
	padding: 0;
}
.btn-wsp svg {
	width: 26px;
	height: 26px;
	fill: #fff;
}
.btn-wsp::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #25D366;
	z-index: -1;
	animation: wsp-pulse 2s infinite ease-out;
}

@keyframes wsp-pulse {
	0%   { transform: scale(1);   opacity: 0.6; }
	100% { transform: scale(1.8); opacity: 0;   }
}

/* Panel — estado CERRADO (easing de close por default) */
.ver_whatsapp_flotante {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 361px;
	max-width: calc(100vw - 40px);
	border-radius: 50%;
	background: #25D366;
	overflow: hidden;
	transform: scale(0);
	transform-origin: 100% 100%;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
	will-change: transform, opacity, border-radius;
	transition:
		transform 0.35s cubic-bezier(0.4, 0, 1, 1),
		border-radius 0.35s cubic-bezier(0.4, 0, 1, 1),
		opacity 0.35s cubic-bezier(0.4, 0, 1, 1);
}

@media (min-width: 768px) {
	.ver_whatsapp_flotante {
		width: 420px;
	}
}

/* Cabecera */
.wsp-header {
	padding: 25px;
	color: #fff;
	display: flex;
	gap: 10px;
	align-items: center;
	opacity: 0;
	transition: opacity 0.15s ease-in;
}
.wsp-header .ico {
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}
.wsp-header .ico svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}
.wsp-header .wsp-header__text { flex: 1; }
.wsp-header h3 {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
}
.wsp-header p {
	font-size: 14px;
	opacity: 0.95;
	margin: 2px 0 0;
}

/* Lista */
.wsp-list {
	padding: 10px 25px 25px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 8px;
	opacity: 0;
	transition: opacity 0.15s ease-in;
	justify-content: flex-start;
	height: 100%;
}

.wsp-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
	background: #f3f4f6;
	border-radius: 8px;
	text-decoration: none;
	color: #2b2b2b;
	transition: background 0.2s ease;
	width: 100%;
	margin: 0;
}
.wsp-item:hover { background: #e5e7eb; }
.wsp-item .ico-btn {
	width: 36px;
	height: 36px;
	background: #25D366;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}
.wsp-item .ico-btn svg {
	width: 20px;
	height: 20px;
	fill: #fff;
}
.wsp-item .wsp-item__text { flex: 1; }
.wsp-item h4 {
	font-size: 12px;
	font-weight: 700;
	margin: 0;
}
.wsp-item p {
	font-size: 12px;
	color: #666;
	margin: 1px 0 0;
}

/* Estado ABIERTO — gana en especificidad, aplica easing de open (bounce) */
.whatsapp_flotante.is-open .ver_whatsapp_flotante {
	pointer-events: auto;
	transform: scale(1);
	border-radius: 15px;
	opacity: 1;
	transition:
		transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
		border-radius 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
		opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.whatsapp_flotante.is-open .wsp-header,
.whatsapp_flotante.is-open .wsp-list { opacity: 1; }
.whatsapp_flotante.is-open .btn-wsp { display: none; }
