#formiwhats-widget {
	--formiwhats-primary: #25D366;
	--formiwhats-header: #075E54;
	position: fixed;
	bottom: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#formiwhats-widget.formiwhats-pos-right { right: 24px; }
#formiwhats-widget.formiwhats-pos-left { left: 24px; }

#formiwhats-bar {
	display: flex;
	align-items: center;
	gap: 10px;
}
.formiwhats-pos-right #formiwhats-bar { flex-direction: row; }
.formiwhats-pos-left #formiwhats-bar { flex-direction: row-reverse; }

#formiwhats-bubble {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	color: #111b21;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	padding: 10px 14px;
	border-radius: 30px;
	box-shadow: 0 4px 14px rgba(0,0,0,0.2);
	cursor: pointer;
	animation: formiwhats-bubble-in .25s ease;
}
#formiwhats-bubble span { pointer-events: none; }
#formiwhats-bubble-close {
	background: transparent;
	border: none;
	color: #8696a0;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0 0 0 2px;
}

@keyframes formiwhats-bubble-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
	#formiwhats-bubble span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

#formiwhats-toggle-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--formiwhats-primary);
	border: none;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .15s ease;
	padding: 0;
	flex-shrink: 0;
}
#formiwhats-toggle-btn:hover { transform: scale(1.06); }

#formiwhats-toggle-btn svg {
	display: block !important;
	width: 30px !important;
	height: 30px !important;
	fill: #ffffff !important;
	pointer-events: none;
}
#formiwhats-toggle-btn svg path {
	fill: #ffffff !important;
}

#formiwhats-popup {
	position: absolute;
	bottom: 76px;
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: 70vh;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.25);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.formiwhats-pos-right #formiwhats-popup { right: 0; }
.formiwhats-pos-left #formiwhats-popup { left: 0; }

.formiwhats-view {
	display: flex;
	flex-direction: column;
	max-height: 70vh;
}

.formiwhats-header {
	background: var(--formiwhats-header);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.formiwhats-header-title {
	font-size: 16px;
	font-weight: 600;
	flex: 1;
}
.formiwhats-close,
.formiwhats-back {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

.formiwhats-agents {
	overflow-y: auto;
	background: #ece5dd;
}

.formiwhats-agent-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background .15s ease;
}
.formiwhats-agent-item:hover { background: #f7f7f7; }

.formiwhats-agent-avatar {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.formiwhats-agent-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}
.formiwhats-agent-role {
	font-size: 12px;
	color: #8696a0;
}
.formiwhats-agent-name {
	font-size: 14px;
	color: #111b21;
}
.formiwhats-agent-schedule {
	font-size: 11px;
	color: #8696a0;
	font-style: italic;
}

.formiwhats-agent-chat-icon {
	flex-shrink: 0;
	opacity: 0.7;
}
.formiwhats-agent-chat-icon svg,
.formiwhats-agent-chat-icon svg path {
	fill: #25D366 !important;
}

.formiwhats-form-intro {
	padding: 12px 16px 0;
	font-size: 13px;
	color: #333;
}

.formiwhats-form-container {
	padding: 10px 16px 16px;
	overflow-y: auto;
}

/* Ajustes suaves para que el formulario de Formidable herede el estilo del widget */
.formiwhats-form-container .frm_forms {
	max-width: 100%;
}
.formiwhats-form-container .frm_submit input[type="submit"],
.formiwhats-form-container .frm_submit button {
	background: var(--formiwhats-primary) !important;
	border-color: var(--formiwhats-primary) !important;
	color: #fff !important;
}

@media (max-width: 400px) {
	#formiwhats-popup {
		width: calc(100vw - 24px);
	}
}
