/* Site Chat widget (Jivo-style) */
.contact-fab__link--chat {
	width: 100%;
	border: none;
	background: transparent;
	text-align: left;
	font: inherit;
	position: relative;
	cursor: pointer;
}

.contact-fab__link--chat .contact-fab__link-icon {
	background: #4081fd;
	color: #fff;
}

.contact-fab__badge {
	position: absolute;
	top: 10px;
	right: 12px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.contact-fab__badge--fab {
	top: -2px;
	right: -2px;
	z-index: 3;
}

.contact-fab__badge[hidden] {
	display: none !important;
}

.site-chat-teaser {
	position: fixed;
	right: 24px;
	bottom: 104px;
	z-index: 100080;
	width: min(320px, calc(100vw - 32px));
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
	border: 1px solid rgba(15, 23, 42, 0.06);
	overflow: hidden;
	animation: site-chat-pop 0.35s ease;
}

.site-chat-teaser[hidden] {
	display: none !important;
}

@keyframes site-chat-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.site-chat-teaser__close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: #94a3b8;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.site-chat-teaser__main {
	display: flex;
	gap: 12px;
	width: 100%;
	padding: 14px 36px 14px 14px;
	border: none;
	background: transparent;
	color: #0f172a;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.site-chat-teaser__main:hover,
.site-chat-teaser__main:focus,
.site-chat-teaser__main:active {
	color: #0f172a;
	background: #f8fafc;
	outline: none;
	box-shadow: none;
}

.site-chat-teaser__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.site-chat-teaser__content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.site-chat-teaser__top {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.site-chat-teaser__name {
	font-weight: 700;
	font-size: 15px;
	color: #0f172a;
}

.site-chat-teaser__status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #64748b;
}

.site-chat-teaser__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #94a3b8;
}

.site-chat-teaser__status.is-online .site-chat-teaser__dot {
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.site-chat-teaser__text {
	font-size: 13px;
	line-height: 1.35;
	color: #475569;
}

.site-chat {
	position: fixed;
	right: 24px;
	bottom: 104px;
	z-index: 100090;
	display: none;
	flex-direction: column;
	width: min(380px, calc(100vw - 24px));
	height: min(560px, calc(100vh - 130px));
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
	border: 1px solid rgba(15, 23, 42, 0.06);
	overflow: hidden;
	animation: site-chat-pop 0.28s ease;
}

.site-chat.is-open,
.site-chat:not([hidden]) {
	display: flex !important;
}

.site-chat[hidden] {
	display: none !important;
}

.site-chat__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: linear-gradient(135deg, #5b94ff 0%, #4081fd 100%);
	color: #fff;
	flex-shrink: 0;
}

.site-chat__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255,255,255,0.55);
}

.site-chat__header-info {
	flex: 1;
	min-width: 0;
}

.site-chat__name {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.site-chat__status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 3px;
	font-size: 12px;
	opacity: 0.92;
}

.site-chat__status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.55);
}

.site-chat__status.is-online .site-chat__status-dot {
	background: #86efac;
	box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.28);
}

.site-chat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: rgba(255,255,255,0.16);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	appearance: none;
	-webkit-appearance: none;
}

.site-chat__messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 14px;
	background: #f5f7fb;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.site-chat__msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 92%;
}

.site-chat__msg--visitor {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.site-chat__msg-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.site-chat__bubble {
	padding: 11px 13px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	color: #0f172a;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.site-chat__msg--visitor .site-chat__bubble {
	background: #4081fd;
	color: #fff;
	border-bottom-right-radius: 6px;
}

.site-chat__msg--operator .site-chat__bubble {
	border-bottom-left-radius: 6px;
}

.site-chat__bubble--holdback {
	width: min(100%, 280px);
	padding: 12px 13px 13px;
}

.site-chat__hold-text {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.45;
	color: #0f172a;
}

.site-chat__hold-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.site-chat__hold-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 6px 11px;
	border-radius: 999px;
	border: 1px solid #dbe4f0;
	background: #fff;
	color: #1e293b;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-chat__hold-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
	text-decoration: none;
}

.site-chat__hold-btn--phone {
	background: #4081fd;
	border-color: #4081fd;
	color: #fff;
}

.site-chat__hold-btn--phone:hover {
	background: #326fe0;
	border-color: #326fe0;
	color: #fff;
}

.site-chat__hold-btn--telegram {
	border-color: #b6d4ff;
	background: #eff6ff;
	color: #1d4ed8;
}

.site-chat__hold-btn--max {
	border-color: #c7d2fe;
	background: #f5f3ff;
	color: #4338ca;
}

.site-chat__hold-form {
	display: flex;
	gap: 6px;
	align-items: stretch;
}

.site-chat__hold-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #dbe4f0;
	border-radius: 10px;
	background: #f8fafc;
	font: inherit;
	font-size: 13px;
	outline: none;
}

.site-chat__hold-input:focus {
	border-color: #93b8ff;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(64, 129, 253, 0.12);
}

.site-chat__hold-submit {
	flex: 0 0 auto;
	height: 36px;
	padding: 0 12px;
	border: none;
	border-radius: 10px;
	background: #0f172a;
	color: #fff;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.site-chat__hold-submit:hover:not(:disabled) {
	background: #1e293b;
}

.site-chat__hold-submit:disabled {
	opacity: 0.7;
	cursor: default;
}

.site-chat__hold-thanks {
	margin: 8px 0 0;
	font-size: 13px;
	color: #16a34a;
	font-weight: 600;
}

.site-chat__quick {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 6px;
	padding: 8px 12px 6px;
	background: #fff;
	border-top: 1px solid #eef2f7;
	flex-shrink: 0;
	overflow: visible;
}

.site-chat__quick[hidden] {
	display: none !important;
}

.site-chat__quick-btn {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1px solid #dbe4f0;
	background: #f8fafc;
	color: #1e293b;
	border-radius: 999px;
	padding: 5px 10px;
	font-size: 12px;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	text-align: left;
	max-width: 100%;
}

.site-chat__quick-check {
	display: none;
}

.site-chat__quick-btn:hover {
	background: #eef5ff;
	border-color: #b6d0ff;
}

.site-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px 12px;
	background: #fff;
	border-top: 1px solid #eef2f7;
	flex-shrink: 0;
}

.site-chat__input {
	flex: 1 1 auto;
	min-width: 0;
	resize: none;
	min-height: 42px;
	max-height: 110px;
	padding: 11px 12px;
	border: 1px solid #dbe4f0;
	border-radius: 14px;
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	outline: none;
	background: #f8fafc;
}

.site-chat__input:focus {
	border-color: #93b8ff;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(64, 129, 253, 0.12);
}

.site-chat__send {
	width: 44px;
	height: 44px;
	min-width: 44px;
	border: none;
	border-radius: 14px;
	background: #4081fd;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	font-size: 18px;
	line-height: 1;
	padding: 0;
}

.site-chat__send:hover {
	background: #326fe0;
}

@media (max-width: 767px) {
	.site-chat-teaser,
	.site-chat {
		right: 12px;
		left: 12px;
		width: auto;
		bottom: 96px;
	}

	.site-chat {
		height: min(72vh, 560px);
		border-radius: 18px;
	}
}
