/* 챗봇 위젯 CSS - 사이트 메인컬러(--color-primary01) 연동 */

/* 챗봇 토글 버튼 - 퀵메뉴(#sideQuick) 아래 세로 배치 */
#chatbot-widget-btn {
	position: fixed;
	bottom: 30px;
	right: 35px;
	width: 55px;
	height: 55px;
	border-radius: 50%;
	background: var(--color-primary01, #4A90D9);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s, opacity 0.2s, bottom 0.3s;
}
#chatbot-widget-btn.scroll {
	bottom: 90px;
}
#chatbot-widget-btn:hover {
	transform: scale(1.08);
	opacity: 0.88;
}
#chatbot-widget-btn svg {
	width: 42px;
	height: 42px;
}

/* 챗봇 위젯 창 */
#chatbot-widget {
	position: fixed;
	bottom: 90px;
	right: 30px;
	width: 380px;
	height: 520px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.18);
	z-index: 10000;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}
#chatbot-widget.open {
	display: flex;
}

/* 헤더 */
.chatbot-header {
	background: var(--color-primary01, #4A90D9);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.chatbot-header-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
}
.chatbot-header-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
}
.chatbot-header-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 0 4px;
}

/* 메시지 영역 */
.chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.chatbot-messages::-webkit-scrollbar {
	width: 4px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
	background: #d0d0d0;
	border-radius: 2px;
}

.chatbot-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	word-break: break-word;
	white-space: pre-wrap;
}
.chatbot-msg.user {
	align-self: flex-end;
	background: var(--color-primary01, #4A90D9);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.chatbot-msg.assistant {
	align-self: flex-start;
	background: #f0f2f5;
	color: #333;
	border-bottom-left-radius: 4px;
}
.chatbot-msg.assistant a.chatbot-link {
	color: #2a6cb6;
	text-decoration: underline;
	font-weight: 600;
}

.chatbot-msg-time {
	font-size: 11px;
	color: #999;
	margin-top: 4px;
}
.chatbot-msg.user .chatbot-msg-time {
	text-align: right;
	color: rgba(255,255,255,0.7);
}

/* 로딩 표시 */
.chatbot-typing {
	align-self: flex-start;
	background: #f0f2f5;
	padding: 10px 14px;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	display: none;
}
.chatbot-typing.show {
	display: block;
}
.chatbot-typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	background: #999;
	border-radius: 50%;
	margin: 0 2px;
	animation: chatbot-bounce 1.4s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.16s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes chatbot-bounce {
	0%, 80%, 100% { transform: scale(0); }
	40% { transform: scale(1); }
}

/* 입력 영역 */
.chatbot-input-area {
	border-top: 1px solid #e8e8e8;
	padding: 12px 16px;
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}
.chatbot-input {
	flex: 1;
	border: 1px solid #d0d0d0;
	border-radius: 20px;
	padding: 8px 16px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}
.chatbot-input:focus {
	border-color: var(--color-primary01, #4A90D9);
}
.chatbot-send-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--color-primary01, #4A90D9);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: opacity 0.2s;
}
.chatbot-send-btn:hover {
	opacity: 0.88;
}
.chatbot-send-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}
.chatbot-send-btn svg {
	width: 18px;
	height: 18px;
}

/* 상품 카드 */
.chatbot-product-cards {
	display: flex;
	gap: 8px;
	padding: 4px 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	max-width: 100%;
	flex-shrink: 0;
}
.chatbot-product-cards::-webkit-scrollbar {
	height: 3px;
}
.chatbot-product-cards::-webkit-scrollbar-thumb {
	background: #d0d0d0;
	border-radius: 2px;
}
.chatbot-product-card {
	flex: 0 0 120px;
	width: 120px;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: #333;
	transition: box-shadow 0.2s;
	display: block;
}
.chatbot-product-card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.chatbot-product-img {
	width: 120px;
	height: 120px;
	overflow: hidden;
	background: #f5f5f5;
}
.chatbot-product-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.chatbot-product-info {
	padding: 6px 8px 8px;
}
.chatbot-product-name {
	font-size: 12px;
	line-height: 1.3;
	color: #333;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
}
.chatbot-product-price {
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.3;
}
.chatbot-price-original {
	text-decoration: line-through;
	color: #999;
	font-size: 11px;
	display: block;
}
.chatbot-price-sale {
	color: var(--color-primary01, #e44);
	font-weight: 700;
	display: block;
}

/* 관리자 메시지 스타일 */
.chatbot-msg.admin {
	align-self: flex-start;
	background: #e8f5e9;
	color: #333;
	border: 1px solid #c8e6c9;
	border-bottom-left-radius: 4px;
}
.chatbot-msg.admin a.chatbot-link,
.chatbot-msg.admin a.chat-link {
	color: #2a6cb6;
	text-decoration: underline;
}
.chatbot-msg-label {
	font-size: 11px;
	color: #43A047;
	font-weight: 600;
	margin-bottom: 2px;
}
.chatbot-msg.admin .chatbot-msg-time {
	color: #999;
}

/* 파일 첨부 링크 */
.chatbot-file-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 13px;
}
.chatbot-file-link:hover {
	background: #eee;
}

/* 알림 점 */
.chatbot-noti-dot {
	position: absolute;
	top: 0;
	right: 0;
	width: 14px;
	height: 14px;
	background: #e53935;
	border-radius: 50%;
	border: 2px solid #fff;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
	#chatbot-widget-btn {
		bottom: 10px;
		right: 15px;
	}
	#chatbot-widget-btn.scroll {
		bottom: 70px;
	}
	#chatbot-widget {
		bottom: 0;
		right: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
}
