/* Xat de VR Tecnologies */

#chatbot-toggler {
	position: fixed;
	right: 30px;
	bottom: 30px;
	z-index: 9997;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #0eb2e7;
	box-shadow: 0 4px 14px rgba(14, 178, 231, 0.45);
	cursor: pointer;
	-webkit-transition: all .3s ease;
	transition: all .3s ease;
}

#chatbot-toggler:hover {
	background: #0a9ccb;
	-webkit-transform: scale(1.08);
	transform: scale(1.08);
}

#chatbot-toggler svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}

body.show-chatbot #chatbot-toggler {
	-webkit-transform: rotate(90deg);
	transform: rotate(90deg);
}

.chatbot-local {
	position: fixed;
	right: 25px;
	bottom: 100px;
	z-index: 10001;
	width: 400px;
	max-width: calc(100vw - 50px);
	overflow: hidden;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 0 60px rgba(0, 0, 0, 0.1), 0 32px 64px -48px rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	-webkit-transform: scale(0.2);
	transform: scale(0.2);
	-webkit-transform-origin: bottom right;
	transform-origin: bottom right;
	-webkit-transition: all .3s ease;
	transition: all .3s ease;
	font-family: 'Raleway', sans-serif;
}

body.show-chatbot .chatbot-local {
	opacity: 1;
	pointer-events: auto;
	-webkit-transform: scale(1);
	transform: scale(1);
}

/* Capçalera */
.chatbot-local .chat-header {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: space-between;
	justify-content: space-between;
	padding: 14px 20px;
	background: #0eb2e7;
}

.chatbot-local .header-info {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
}

.chatbot-local .header-info .chatbot-logo {
	width: 36px;
	height: 36px;
	margin-right: 10px;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
}

.chatbot-local .header-info .logo-text {
	margin: 0;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: .5px;
	line-height: 1.2;
	text-transform: none;
}

.chatbot-local #close-chatbot {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-right: -8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: none;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.chatbot-local #close-chatbot:hover {
	background: #0a9ccb;
}

/* Missatges */
.chatbot-local .chat-body {
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
	height: 420px;
	margin-bottom: 78px;
	padding: 22px 20px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #bfe9f7 transparent;
}

.chatbot-local .chat-body .message {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: flex-start;
	align-items: flex-start;
	margin-bottom: 16px;
}

.chatbot-local .chat-body .bot-avatar {
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	margin: 2px 10px 0 0;
	border-radius: 50%;
	object-fit: cover;
}

.chatbot-local .chat-body .user-message {
	-webkit-flex-direction: row-reverse;
	flex-direction: row-reverse;
}

.chatbot-local .chat-body .message-text {
	max-width: 78%;
	padding: 11px 15px;
	font-size: 15px;
	line-height: 1.5;
	word-wrap: break-word;
}

.chatbot-local .chat-body .bot-message .message-text {
	background: #eef9fd;
	border-radius: 13px 13px 13px 3px;
	color: #333;
}

.chatbot-local .chat-body .user-message .message-text {
	background: #0eb2e7;
	border-radius: 13px 13px 3px 13px;
	color: #fff;
}

.chatbot-local .chat-body .bot-message .message-text a {
	color: #0a9ccb;
	font-weight: 600;
	text-decoration: underline;
}

.chatbot-local .chat-body .bot-message .message-text strong {
	color: #0a9ccb;
	font-weight: 700;
}

.chatbot-local .chat-body .bot-message .message-text a.wa-btn {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	border-radius: 8px;
	background: #25d366;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.chatbot-local .chat-body .bot-message .message-text a.wa-btn:hover {
	background: #1fb857;
}

.chatbot-local .chat-body .bot-message .message-text a.call-btn {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	border-radius: 8px;
	background: #0eb2e7;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.chatbot-local .chat-body .bot-message .message-text a.call-btn:hover {
	background: #0a9ccb;
}

/* Indicador de «pensant» */
.chatbot-local .chat-body .bot-message.thinking .message-text {
	padding: 2px 15px;
	background: transparent;
}

.chatbot-local .thinking-indicator {
	display: -webkit-flex;
	display: flex;
	padding: 14px 0;
}

.chatbot-local .thinking-indicator .dot {
	width: 7px;
	height: 7px;
	margin-right: 4px;
	border-radius: 50%;
	background: #0eb2e7;
	opacity: .7;
	-webkit-animation: vrtDot 1.8s ease-in-out infinite;
	animation: vrtDot 1.8s ease-in-out infinite;
}

.chatbot-local .thinking-indicator .dot:nth-child(2) {
	-webkit-animation-delay: .15s;
	animation-delay: .15s;
}

.chatbot-local .thinking-indicator .dot:nth-child(3) {
	-webkit-animation-delay: .3s;
	animation-delay: .3s;
}

@-webkit-keyframes vrtDot {
	0%, 44% { -webkit-transform: translateY(0); }
	28% { opacity: .4; -webkit-transform: translateY(-4px); }
}

@keyframes vrtDot {
	0%, 44% { transform: translateY(0); }
	28% { opacity: .4; transform: translateY(-4px); }
}

/* Peu amb el quadre de text */
.chatbot-local .chat-footer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 14px 20px 18px;
	background: #fff;
	border-top: 1px solid #f0f0f0;
}

.chatbot-local .chat-form {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: flex-end;
	align-items: flex-end;
	margin: 0;
	padding: 4px;
	border: 1px solid #cfe9f3;
	border-radius: 28px;
	background: #fff;
}

.chatbot-local .chat-form:focus-within {
	border-color: #0eb2e7;
}

.chatbot-local .chat-form .message-input {
	width: 100%;
	height: 44px;
	min-height: 44px;
	max-height: 140px;
	padding: 11px 14px;
	border: none;
	outline: none;
	resize: none;
	background: transparent;
	color: #333;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
}

.chatbot-local .chat-form #send-message {
	display: none;
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin: 0 3px 3px 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #0eb2e7;
	color: #fff;
	cursor: pointer;
}

.chatbot-local .chat-form .message-input:valid ~ #send-message {
	display: -webkit-flex;
	display: flex;
}

.chatbot-local .chat-form #send-message:hover {
	background: #0a9ccb;
}

/* Mòbil: el xat ocupa tota la pantalla */
@media (max-width: 600px) {
	#chatbot-toggler {
		right: 18px;
		bottom: 18px;
		width: 54px;
		height: 54px;
	}

	.chatbot-local {
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.chatbot-local .chat-body {
		height: calc(100% - 144px);
		margin-bottom: 0;
	}

	.chatbot-local .chat-body .message-text {
		max-width: 85%;
	}

	body.show-chatbot #chatbot-toggler {
		display: none;
	}
}
