/**
 * Онлайн-чат (Qwertychat)
 */

body.qwchatOpened {
	overflow: hidden;
}

/* Кнопка вызова чата */
.qwchatButton {
	position: fixed;
	right: 34px;
	bottom: 85px;
	width: 46px;
	height: 46px;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	background: var(--color-pink);
	color: var(--color-100);
	border-radius: 50%;
	text-decoration: none;
	font-size: 20px;
	line-height: 1;
	z-index: 1000;
	box-shadow: 0 0 var(--s2) rgba(0, 0, 0, .3);
	cursor: pointer;
}

.qwchatButton:hover {
	color: var(--color-100);
	box-shadow: 0 0 var(--s2) var(--color-pink);
	-webkit-transform: scale(1.07, 1.07);
	transform: scale(1.07, 1.07);
	transition: 0.6s ease;
}

/* Слой чата на весь экран */
.qwchatLayer {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--color-100);
	z-index: 199999990;
	overflow: hidden;
}

.qwchatLayer.active {
	display: block;
}

.qwchatBox {
	width: 100%;
	max-width: 900px;
	height: 100%;
	margin: 0 auto;
	padding: 0 var(--s4);
}

.qwchatHead {
	width: 100%;
	padding: var(--s3) 0 var(--s2) 0;
}

.qwchatHead .qwchatTitle {
	font-size: var(--font-medium);
	font-weight: 600;
	color: var(--color-25);
	text-transform: uppercase;
	letter-spacing: 1px;
	padding-top: var(--s2);
	padding-bottom: var(--s2);
	
}

.qwchatHead .qwchatTitle i {
	color: var(--color-pink);
	margin-right: var(--s);
}

.qwchatHead .qwchatClose {
	color: var(--color-50);
	font-size: var(--font-medium);
	text-decoration: none;
	line-height: 1;
}

.qwchatHead .qwchatClose:hover {
	color: var(--color-pink);
}

/* Табы */
.qwchatTabs {
	width: 100%;
	border-bottom: 1px solid var(--color-85);
}

.qwchatTabs li {
	list-style-type: none;
	margin: 0;
	padding: var(--s2);
	cursor: pointer;
	font-weight: 700;
	font-size: var(--font-small);
	text-transform: uppercase;
	color: var(--color-50);
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.qwchatTabs li:hover {
	color: var(--color-05);
}

.qwchatTabs li.active {
	color: var(--color-pink);
	border-bottom-color: var(--color-pink);
}

/* Переписка */
.qwchatLog {
	width: 100%;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: var(--s4) var(--s3) var(--s4) 0;
	display: block;
}

.qwchatMsg {
	width: -webkit-fit-content;
	width: -moz-fit-content;
	width: fit-content;
	max-width: 85%;
	margin-bottom: var(--s2);
	padding: var(--s2) var(--s3);
	border-radius: var(--s2);
	font-size: var(--font-small);
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
	opacity: 1;
	-webkit-transition: opacity 5s ease, -webkit-transform 5s ease;
	transition: opacity 5s ease, transform 5s ease;
}

.qwchatMsg_fade {
	opacity: 0;
	-webkit-transform: translateY(-6px);
	transform: translateY(-6px);
	pointer-events: none;
}

/* Время сообщения */
.qwchatMsg .qwchatTime {
	display: block;
	margin-top: var(--s-half);
	font-size: var(--font-tiny);
	line-height: 1;
	opacity: .55;
	text-align: right;
	white-space: nowrap;
}

.qwchatMsg .qwchatText {
	display: block;
}

.qwchatMsg .qwchatText a.qwchatLink {
	color: inherit;
	text-decoration: underline;
}

.qwchatMsg .qwchatText a.qwchatLink:hover {
	color: var(--color-pink);
}

/* Найденное AI-консультантом */
.qwchatCards {
	width: 100%;
	max-width: 85%;
	margin: 0 0 var(--s3) 0;
	opacity: 1;
	-webkit-transition: opacity 5s ease, -webkit-transform 5s ease;
	transition: opacity 5s ease, transform 5s ease;
}

.qwchatCardsTitle {
	font-size: var(--font-tiny);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--color-50);
	margin-bottom: var(--s);
}

/* Заголовок следующего блока отделяется от предыдущего */
.qwchatCardsTitle:not(:first-child) {
	margin-top: var(--s3);
}

.qwchatProducts {
	display: -webkit-flex;
	display: flex;
	-webkit-flex-flow: row wrap;
	flex-flow: row wrap;
	margin: 0 calc(-1 * var(--s-half));
}

.qwchatProduct {
	-webkit-flex: 1 1 25%;
	flex: 1 1 25%;
	max-width: 25%;
	padding: 0 var(--s-half);
	margin-bottom: var(--s2);
	color: var(--color-05);
	text-decoration: none;
	font-size: var(--font-tiny);
	line-height: 1.3;
	box-sizing: border-box;
}

.qwchatProduct:hover {
	color: var(--color-pink);
}

.qwchatProductImg {
	width: 100%;
	margin-bottom: var(--s-half);
	background: var(--color-95);
	overflow: hidden;
}

.qwchatProductImg img {
	display: block;
	width: 100%;
	height: auto;
}

.qwchatProductName {
	display: block;
}

.qwchatProductPrice {
	font-weight: 700;
	margin-top: var(--s-half);
}

/* Разделы каталога и советы профессионалов выводятся одинаковым списком */
.qwchatSections {
	margin: 0;
	padding: 0;
}

.qwchatSections li {
	list-style-type: none;
	margin: 0 0 var(--s-half) 0;
	padding: 0;
	font-size: var(--font-small);
	line-height: 1.4;
}

.qwchatSections li a {
	color: var(--color-pink);
	text-decoration: none;
}

.qwchatSections li a:hover {
	text-decoration: underline;
}

.qwchatMsg_bot {
	background: var(--color-95);
	color: var(--color-05);
	border-bottom-left-radius: 0;
	margin-right: auto;
}

.qwchatMsg_user {
	background: var(--color-pink);
	color: var(--color-100);
	border-bottom-right-radius: 0;
	margin-left: auto;
}

.qwchatMsg_error {
	background: var(--color-95);
	color: var(--color-red);
	border-bottom-left-radius: 0;
	margin-right: auto;
}

.qwchatMsg_typing {
	display: -webkit-flex;
	display: flex;
	-webkit-flex-flow: row nowrap;
	flex-flow: row nowrap;
	-webkit-align-items: center;
	align-items: center;
	padding: var(--s3) var(--s3);
}

.qwchatMsg_typing>span {
	width: var(--s);
	height: var(--s);
	margin: 0 2px;
	background: var(--color-50);
	border-radius: 50%;
	-webkit-animation: qwchatTyping 1.2s infinite ease-in-out;
	animation: qwchatTyping 1.2s infinite ease-in-out;
}

.qwchatMsg_typing>span:nth-child(1) {
	-webkit-animation-delay: 0s;
	animation-delay: 0s;
}

.qwchatMsg_typing>span:nth-child(2) {
	-webkit-animation-delay: .2s;
	animation-delay: .2s;
}

.qwchatMsg_typing>span:nth-child(3) {
	-webkit-animation-delay: .4s;
	animation-delay: .4s;
}

@-webkit-keyframes qwchatTyping {
	0%, 60%, 100% {
		opacity: .3;
	}
	30% {
		opacity: 1;
	}
}

@keyframes qwchatTyping {
	0%, 60%, 100% {
		opacity: .3;
	}
	30% {
		opacity: 1;
	}
}

/* Форма ввода */
.qwchatForm {
	width: 100%;
	border-top: 1px solid var(--color-85);
	padding: var(--s2) 0;
}

.qwchatFormInner {
	width: 100%;
	-webkit-align-items: center;
	align-items: center;
}

.qwchatFormInner label.pps.pps_area {
	width: 100%;
	margin: 0 var(--s2) 0 0;
}

.qwchatFormInner label.pps.pps_area textarea {
	min-height: 44px;
	height: 44px;
	max-height: 160px;
	overflow-y: auto;
	border-radius: var(--s2);
	padding: var(--s2) 15px;
	line-height: 1.3;
}

.qwchatFormInner label.pps.pps_button {
	-webkit-flex: 0 0 auto;
	flex: 0 0 auto;
	margin: 0;
}

#qwertychatRefresh {
	margin-left: var(--s-half);
}

/* Круглые кнопки: отправить и обновить */
.qwchatFormInner label.pps.pps_button.qwchatIconButton input {
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	border-radius: 50%;
	font-family: 'FontAwesome';
	font-size: 18px;
	line-height: 42px;
	text-align: center;
	letter-spacing: 0;
}

#qwertychatRefresh input {
	color: var(--color-50);
}

#qwertychatRefresh input:hover {
	color: var(--color-pink);
}

#qwertychatRefresh.qwchatBusy input {
	-webkit-animation: qwchatSpin .9s linear infinite;
	animation: qwchatSpin .9s linear infinite;
}

/* Подсветка кнопки, когда частый опрос остановлен */
#qwertychatRefresh.qwchatStale input {
	color: var(--color-100);
	background: var(--color-pink);
	border-color: var(--color-pink);
}

@-webkit-keyframes qwchatSpin {
	from {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	to {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}

@keyframes qwchatSpin {
	from {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	to {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}

.qwchatBusy {
	opacity: .6;
}

@media screen and (max-width: 810px) {
	.qwchatButton {
		right: 20px;
		bottom: 75px;
		width: 42px;
		height: 42px;
		font-size: 18px;
	}

	.qwchatBox {
		padding: 0 var(--s3);
	}

	.qwchatMsg {
		max-width: 92%;
	}

	.qwchatCards {
		max-width: 100%;
	}

	.qwchatProduct {
		-webkit-flex: 1 1 33.333333%;
		flex: 1 1 33.333333%;
		max-width: 33.333333%;
	}
}

@media screen and (max-width: 480px) {
	.qwchatHead .qwchatTitle {
		font-size: var(--font-default);
	}

	.qwchatTabs li {
		padding-right: var(--s3);
	}

	.qwchatProduct {
		-webkit-flex: 1 1 50%;
		flex: 1 1 50%;
		max-width: 50%;
	}

	.qwchatFormInner label.pps.pps_button input {
		padding: 10px var(--s3);
	}

	.qwchatFormInner label.pps.pps_button.qwchatIconButton input {
		width: 40px;
		min-width: 40px;
		height: 40px;
		min-height: 40px;
		padding: 0;
		line-height: 38px;
	}
}
