@keyframes bd-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-7px); }
}

@keyframes bd-ring {
	0% { box-shadow: 0 4px 20px rgba(197, 130, 74, 0.4), 0 0 0 0 rgba(197, 130, 74, 0.5); }
	60% { box-shadow: 0 4px 20px rgba(197, 130, 74, 0.4), 0 0 0 14px rgba(197, 130, 74, 0); }
	100% { box-shadow: 0 4px 20px rgba(197, 130, 74, 0.4), 0 0 0 0 rgba(197, 130, 74, 0); }
}

.bd-chat-bubble {
	position: fixed;
	bottom: 28px;
	right: 28px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #C5824A;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9998;
	transition: background 0.2s;
	animation: bd-float 3.6s ease-in-out infinite, bd-ring 3s ease-out 3s infinite;
}

.bd-chat-bubble:hover {
	background: #b3712f;
	animation: none;
	transform: scale(1.08);
}

.bd-chat-invite {
	position: fixed;
	bottom: 38px;
	right: 96px;
	background: #C5824A;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: 10px 10px 3px 10px;
	box-shadow: 0 4px 16px rgba(28, 43, 74, 0.28);
	white-space: nowrap;
	z-index: 9997;
	pointer-events: none;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.3s, transform 0.3s;
}

.bd-chat-invite::after {
	display: none;
}

.bd-chat-invite.is-hidden {
	opacity: 0;
	transform: translateY(6px);
	pointer-events: none;
}

.bd-chat-bubble svg {
	width: 24px;
	height: 24px;
}

.bd-chat-window {
	position: fixed;
	bottom: 100px;
	right: 28px;
	width: 340px;
	background: #faf8f5;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(28, 43, 74, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 9999;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	opacity: 0;
	transform: translateY(12px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.bd-chat-window.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: all;
}

.bd-chat-header {
	background: #1C2B4A;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.bd-chat-header-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #C5824A;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Lora', serif;
	font-weight: 600;
	font-size: 15px;
	flex-shrink: 0;
}

.bd-chat-header-info {
	flex: 1;
}

.bd-chat-header-name {
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.02em;
}

.bd-chat-header-status {
	font-size: 11px;
	opacity: 0.65;
	margin-top: 2px;
}

.bd-chat-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	opacity: 0.65;
	transition: opacity 0.15s;
	line-height: 1;
	display: flex;
}

.bd-chat-close:hover {
	opacity: 1;
}

.bd-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 180px;
	max-height: 320px;
}

.bd-chat-msg {
	max-width: 84%;
	padding: 9px 13px;
	border-radius: 12px;
	line-height: 1.55;
	font-size: 13px;
	word-break: break-word;
}

.bd-chat-msg--bot {
	background: #fff;
	color: #333;
	border: 1px solid #e8e4df;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}

.bd-chat-msg--user {
	background: #1C2B4A;
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.bd-chat-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e8e4df;
	border-radius: 12px;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}

.bd-chat-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #C5824A;
	animation: bd-bounce 1.2s infinite;
}

.bd-chat-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.bd-chat-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes bd-bounce {
	0%, 60%, 100% { transform: translateY(0); }
	30% { transform: translateY(-5px); }
}

.bd-chat-footer {
	border-top: 1px solid #e8e4df;
	padding: 10px 12px;
	display: flex;
	gap: 8px;
	background: #fff;
	flex-shrink: 0;
}

.bd-chat-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px 12px;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	outline: none;
	transition: border-color 0.15s;
	resize: none;
	max-height: 80px;
	color: #333;
	background: #faf8f5;
	line-height: 1.45;
}

@media (max-width: 767px) {
	.bd-chat-input {
		font-size: 16px;
	}
}

.bd-chat-input:focus {
	border-color: #C5824A;
}

.bd-chat-send {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #C5824A;
	border: none;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s;
	align-self: flex-end;
}

.bd-chat-send:hover {
	background: #1C2B4A;
}

.bd-chat-send:disabled {
	opacity: 0.45;
	cursor: default;
}

@media (max-width: 480px) {
	.bd-chat-window {
		right: 12px;
		left: 12px;
		width: auto;
		bottom: 88px;
	}

	.bd-chat-bubble {
		right: 16px;
		bottom: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bd-chat-window,
	.bd-chat-bubble {
		transition: none;
	}

	.bd-chat-typing span {
		animation: none;
		opacity: 0.5;
	}
}
