﻿
/* ===== CHẶN FLASH - ĐẶT TRÊN CÙNG ===== */
.chat-hidden {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
}

/* Container chính */
.fixedpage-action {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 2147483647;
}

/* Dropdown Menu */
.dropdown-menu {
	list-style: none;
	padding: 0;
	margin: 0;
	background: white;
	position: absolute;
	bottom: 50px;
	right: 0;
	width: 200px;
	display: none;
}

.dropdown:hover .dropdown-menu {
	display: block;
}

/* Back to Top Button */
#myBtn, .scroll-top-btn {
	display: none;
	transition: background-color 0.3s, opacity 0.5s, visibility 0.5s;
	z-index: 1099;
	cursor: pointer;
	background: #000;
	height: 45px;
	width: 45px;
	color: #fff;
	text-align: center;
	border-radius: 50%;
	line-height: 40px;
	font-size: 30px;
	margin-top: 10px;
	border: 2px solid transparent;
	opacity: 0.4;
}

	#myBtn:hover,
	#myBtn:focus,
	.scroll-top-btn:hover,
	.scroll-top-btn:focus {
		opacity: 1;
	}

/* Chat Widget */
.chat-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 450px;
	max-width: 95vw;
	height: 650px;
	max-height: 90vh;
	background: white;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	flex-direction: column;
	overflow: hidden;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	transition: opacity 0.3s ease-out, transform 0.3s ease-out;
	opacity: 0;
	transform: translateY(100%);
	z-index: -1;
}

	.chat-widget.active {
		display: flex !important;
		visibility: visible !important;
		z-index: 2147483647 !important;
		opacity: 1;
		transform: translateY(0);
	}

/* Animation */
@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(100%);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideDown {
	from {
		opacity: 1;
		transform: translateY(0);
	}

	to {
		opacity: 0;
		transform: translateY(100%);
	}
}

/* Chat Header */
.chat-header {
	display: flex;
	justify-content: space-between; /* Logo + text bên trái, nút bên phải */
	align-items: center;
	padding: 8px;
	background: #007bff;
	color: #fff;
	border-radius: 8px 8px 0 0;
}

	.chat-header img.chatbot-avatar {
		width: 50px !important;
		height: 50px !important;
		max-width: 50px !important;
		max-height: 50px !important;
		object-fit: contain !important;
		border-radius: 50%;
		background: #fff;
		flex-shrink: 0;
		order: 1; /* Logo đầu tiên */
		font-size: 0 !important; /* Ẩn alt text */
		text-indent: -9999px; /* Đẩy text ra ngoài */
		color: transparent; /* Text trong suốt */
	}

	.chat-header h3 {
		margin: 0;
		font-size: 16px !important;
		font-weight: 600;
		margin-left: 10px;
		margin-right: auto; /* Đẩy các nút sang phải */
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		order: 2; /* Text thứ hai */
	}

.chat-reset,
.chat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 18px;
	margin-left: 5px;
	cursor: pointer;
	transition: 0.3s;
}

	.chat-reset:hover {
		color: #ffeb3b;
	}

	.chat-close:hover {
		color: #ff4d4d;
	}

.icon-btn {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	color: white;
	font-size: 16px;
	order: 3; /* Nút về bên phải */
}

	.icon-btn:hover {
		background: rgba(255, 255, 255, 0.4);
		transform: rotate(10deg);
	}

/* Chat Messages */
.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: #f8f9fa;
	width: 100%;
	box-sizing: border-box;
	max-height: 500px; /* Đảm bảo có thể cuộn */
}

.scroll-btn {
	background: linear-gradient(135deg, #007bff, #00c6ff);
	color: white;
	border: none;
	padding: 8px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 0px;
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	position: absolute;
	top: -50px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
	transition: all 0.3s ease;
}

	.scroll-btn:hover {
		background: linear-gradient(135deg, #0056b3, #0099cc);
		transform: translateX(-50%) scale(1.1);
		box-shadow: 0 4px 10px rgba(0, 123, 255, 0.5);
	}

	.scroll-btn svg {
		width: 16px;
		height: 16px;
		fill: white;
	}
/* Message */
.message {
	margin-bottom: 10px;
	display: flex;
}

	.message.bot {
		align-items: flex-start;
		justify-content: flex-start;
	}

	.message.user {
		justify-content: flex-end;
	}

	.message.bot {
		align-items: flex-start;
		justify-content: flex-start;
	}

	.message.staff {
		align-items: flex-start;
		justify-content: flex-start;
	}

	.message.bot .message-content {
		max-width: 85%;
		background: #e7f6fd;
		color: #000;
		border-bottom-left-radius: 5px;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
		display: block; /* Thay flex để đảm bảo không gian cho grid */
		align-items: flex-start;
		gap: 8px;
		word-wrap: break-word;
		padding: 10px;
		box-sizing: border-box;
	}

	.message.staff .message-content {
		max-width: 85%;
		background: #e7f6fd; /* Màu xanh nhạt giống bot */
		color: #000;
		border-bottom-left-radius: 5px;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
		display: block;
		align-items: flex-start;
		gap: 8px;
		word-wrap: break-word;
		padding: 10px;
		box-sizing: border-box;
	}

.message-content {
	max-width: 85%;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
	width: auto;
}

.message.user .message-content {
	max-width: 85%;
	background: #007bff;
	color: white;
	border-bottom-right-radius: 5px;
}

.bot-avatar {
	width: 28px;
	height: 28px;
	margin-right: 8px;
	margin-top: 4px;
	flex-shrink: 0;
	background: #fff;
	border-radius: 50%;
	padding: 2px;
}


.bot-avatar-icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: contain;
	margin-top: 3px;
}

/* Quick Actions */
.quick-actions {
	padding: 15px 20px;
	background: white;
	border-top: 1px solid #e9ecef;
	border-bottom: 1px solid #e9ecef;
	transform: translateY(100%);
	transition: transform 0.3s ease-out;
	display: none;
	z-index: 2147483647;
}

	.quick-actions.active {
		display: block;
		transform: translateY(0);
	}

	.quick-actions h4 {
		font-size: 10px;
		color: #666;
		margin-bottom: 10px;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}

.action-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.action-btn {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	padding: 8px 12px;
	border-radius: 15px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #495057;
}

	.action-btn:hover {
		background: #e9ecef;
		border-color: #adb5bd;
	}

/* Chat Input */
.chat-input {
	padding: 10px;
	background: white;
	display: flex;
	align-items: center;
	gap: 10px;
	border-top: 1px solid #ddd;
	position: relative;
}

.input-wrapper {
	position: relative;
	flex-grow: 1;
}

	.input-wrapper input[type="text"] {
		width: 100%;
		padding: 8px 40px 8px 36px;
		border-radius: 20px;
		border: 1px solid #ccc;
		font-size: 14px;
		outline: none;
	}

.chat-input input {
	flex: 1;
	border: 1px solid #dee2e6;
	border-radius: 20px;
	padding: 10px 15px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease;
}

	.chat-input input:focus {
		border-color: #007bff;
	}

.quick-menu-btn {
	position: absolute;
	top: 50%;
	left: 10px;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	width: 20px;
	height: 20px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.menu-icon {
	width: 100%;
	height: 2px;
	background: #495057;
	margin: 2px 0;
	transition: all 0.3s ease;
}

.quick-menu-btn:hover .menu-icon {
	background: #007bff;
}

.send-btn {
	background: #007bff;
	border: none;
	padding: 10px;
	border-radius: 50%;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

	.send-btn:hover {
		background: #0056b3;
	}

	.send-btn:disabled {
		background: #6c757d;
		cursor: not-allowed;
	}

/* Typing Indicator */
.typing-indicator {
	display: none;
	padding: 10px 15px;
	background: white;
	border-radius: 18px;
	border-bottom-left-radius: 5px;
	max-width: 95%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-dots {
	display: flex;
	gap: 3px;
}

	.typing-dots span {
		width: 6px;
		height: 6px;
		background: #666;
		border-radius: 50%;
		animation: typing 1.4s infinite ease-in-out;
	}

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

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

@keyframes typing {
	0%, 60%, 100% {
		opacity: 0.3;
	}

	30% {
		opacity: 1;
	}
}

/* Container danh sách sản phẩm */
.hsv-product-list {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important; /* Ép 2 cột trên màn hình >400px */
	gap: 8px !important;
	width: 100% !important;
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	min-width: 0;
	max-width: none;
}

/* Card sản phẩm */
.hsv-product-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 6px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	width: 100%;
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%; /* Đảm bảo không vượt quá kích thước cha */
}

	.hsv-product-card:hover {
		transform: translateY(-3px);
		box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
	}

/* Hình ảnh sản phẩm */
.hsv-product-img-wrapper {
	width: 100%;
	height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 4px;
	box-sizing: border-box;
	max-width: 100%; /* Giới hạn kích thước */
}

.hsv-product-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Thông tin sản phẩm */
.hsv-product-info {
	width: 100%;
	text-align: left;
	padding: 4px 0;
	box-sizing: border-box;
}

.hsv-product-name {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	line-height: 1.2;
	margin-bottom: 2px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-wrap: break-word;
}

.hsv-product-price {
	display: flex;
	align-items: baseline;
	gap: 2px;
	margin-bottom: 2px;
	flex-wrap: wrap;
}

.hsv-price-old {
	font-size: 10px;
	color: #888;
	text-decoration: line-through;
}

.hsv-price-new {
	color: #e5101d;
	font-size: 12px;
	font-weight: bold;
}

.hsv-product-rating {
	font-size: 10px;
	color: #666;
	margin-bottom: 4px;
}

/* Star color in rating blocks */
.hsv-rating-stars i {
	color: #ffc107;
}

/* Mặc định: sao xám khi chưa có đánh giá */
.hsv-product-rating .hsv-rating-stars,
.hsv-product-rating .hsv-rating-stars i {
	color: #bbb;
}

/* Có đánh giá: sao vàng */
.hsv-product-rating.has-rating .hsv-rating-stars,
.hsv-product-rating.has-rating .hsv-rating-stars i {
	color: #ffc107;
}

/* Nút hành động */
.hsv-product-actions {
	display: flex;
	gap: 4px;
	width: 100%;
	padding-top: 4px;
	box-sizing: border-box;
}

.hsv-add-to-cart, .hsv-buy-now {
	padding: 3px 6px;
	border: none;
	border-radius: 4px;
	font-size: 10px;
	font-weight: 500;
	text-align: center;
	width: 50%;
	cursor: pointer;
	transition: background 0.2s ease;
	text-decoration: none;
	display: inline-block;
	box-sizing: border-box;
	outline: none;
	font-family: inherit;
}

.hsv-add-to-cart {
	background: #ff6600;
	color: white;
}

	.hsv-add-to-cart:hover {
		background: #e65c00;
	}

.hsv-buy-now {
	background: #007bff;
	color: white;
}

	.hsv-buy-now:hover {
		background: #0056b3;
	}

/* Microphone Button */
.mic-btn {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	width: 24px;
	height: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

	.mic-btn svg {
		width: 20px;
		height: 20px;
		fill: #495057;
		transition: fill 0.2s ease;
	}

	.mic-btn.recording svg {
		fill: #e74c3c;
		animation: pulse 1.5s infinite;
	}

	.mic-btn:hover svg {
		fill: #007bff;
	}

/* Animation pulse cho hiệu ứng ghi âm */
@keyframes pulse {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.1);
	}

	100% {
		transform: scale(1);
	}
}

/* Chat Disclaimer */
.chat-disclaimer {
	font-size: 11px;
	color: #6c757d;
	text-align: center;
	padding: 5px 10px;
	background: #f8f9fa;
	border-top: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
	/* Chatbox khi đóng (desktop mode) */
	.chat-widget:not(.active) {
		width: 100%;
		max-width: 95vw;
		height: 500px;
		max-height: 80vh;
		right: 10px;
	}

	/* Support cho iOS Safari - fix viewport */
	.chat-widget {
		-webkit-overflow-scrolling: touch;
	}

	/* Đảm bảo body không scroll khi chat mở */
	body:has(.chat-widget.active) {
		overflow: hidden !important;
		position: fixed !important;
		width: 100% !important;
	}

	.hsv-product-list {
		grid-template-columns: repeat(2, 1fr) !important; /* Chỉ 2 cột trên màn hình nhỏ */
		gap: 6px !important;
	}

	.hsv-product-card {
		width: 100% !important;
	}

	.hsv-product-img-wrapper {
		height: 80px;
	}

	.hsv-product-name {
		font-size: 11px;
	}

	.hsv-price-new {
		font-size: 11px;
	}

	.hsv-price-old {
		font-size: 9px;
	}

	.hsv-product-rating {
		font-size: 9px;
	}

	.hsv-add-to-cart, .hsv-buy-now {
		font-size: 9px;
		padding: 2px 5px;
	}

	.quick-actions {
		padding: 10px 15px;
	}

	.dropdown-menu {
		bottom: 80px;
		width: 180px;
	}
}


/* Điện thoại nhỏ (≤360px): vẫn 2 cột nhưng thu gọn kích thước */
@media (max-width: 360px) {
	.hsv-product-list {
		grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
		gap: 6px !important;
	}

	.hsv-product-card {
		padding: 6px;
	}

	.hsv-product-img-wrapper {
		height: 70px;
	}

	.hsv-product-name {
		font-size: 11px;
		-webkit-line-clamp: 2;
	}

	.hsv-price-new {
		font-size: 11px;
	}

	.hsv-price-old {
		font-size: 9px;
	}

	.hsv-product-rating {
		font-size: 9px;
	}

	.hsv-product-actions {
		gap: 4px;
	}

	.hsv-add-to-cart, .hsv-buy-now {
		font-size: 10px;
		padding: 4px 6px;
	}
}

@media (max-width: 768px) {
	.message.bot .message-content,
	.message.user .message-content {
		max-width: 100% !important; /* mặc định bạn đang để 85% */
	}
}

/* Siêu nhỏ (≤300px): vẫn 2 cột, tiếp tục co lại một chút */
@media (max-width: 300px) {
	.hsv-product-list {
		grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
		gap: 4px !important;
	}

	.hsv-product-img-wrapper {
		height: 64px;
	}

	.hsv-product-name {
		font-size: 10px;
	}

	.hsv-add-to-cart, .hsv-buy-now {
		font-size: 9px;
		padding: 3px 4px;
	}
}

@media (max-width: 400px) {

	.chat-widget {
		width: 100%;
		max-width: 95vw;
		height: 450px;
		right: 10px;
	}

	.hsv-product-card {
		width: 100% !important;
	}

	.hsv-product-img-wrapper {
		height: 80px;
	}

	.hsv-product-actions {
		flex-direction: column;
		gap: 2px;
	}

	.hsv-add-to-cart, .hsv-buy-now {
		width: 100%;
		font-size: 10px;
		padding: 3px 6px;
	}

	.quick-actions {
		padding: 8px 12px;
	}

	.dropdown-menu {
		bottom: 70px;
		width: 160px;
	}
}

.hsv-product-list br {
	display: none;
}
/* Animation cho slide-up và fade-in */
@keyframes slideUp {
	from {
		transform: translateY(20px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}


@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.cart-added-notification {
	background-color: #f0fff4;
	border-left: 4px solid #38a169;
	padding: 1rem;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	animation: fadeIn 0.5s ease-in;
}

.cart-added-img {
	width: 4rem;
	height: 4rem;
	object-fit: cover;
	border-radius: 0.25rem;
	margin-right: 1rem;
}

.cart-added-notification p {
	margin: 0;
}

.text-green-700 {
	color: #2f855a;
}

.font-semibold {
	font-weight: 600;
}

.text-blue-600 {
	color: #3182ce;
}

.text-gray-600 {
	color: #718096;
}

.font-medium {
	font-weight: 500;
}

.text-gray-500 {
	color: #a0aec0;
}

.mt-1 {
	margin-top: 0.25rem;
}

.mt-2 {
	margin-top: 0.5rem;
}

.bg-blue-500 {
	background-color: #4299e1;
}

.text-white {
	color: #fff;
}

.px-3 {
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}

.py-1 {
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
}

.rounded {
	border-radius: 0.25rem;
}

.hover\:bg-blue-600:hover {
	background-color: #2b6cb0;
}

.transition {
	transition: all 0.2s ease-in-out;
}

.duration-200 {
	transition-duration: 200ms;
}

.mt-2 {
	margin-top: 0.5rem;
}

.bg-blue-600 {
	background-color: #2563eb;
}

.text-white {
	color: #fff;
}

.px-4 {
	padding-left: 1rem;
	padding-right: 1rem;
}

.py-2 {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.rounded-md {
	border-radius: 0.375rem;
}

.hover\:bg-blue-700:hover {
	background-color: #1e40af;
}

.transition {
	transition: all 0.3s ease;
}

.duration-300 {
	transition-duration: 300ms;
}

.text-lg {
	font-size: 1.125rem;
}

.text-sm {
	font-size: 0.875rem;
}

.flex {
	display: flex;
}

.items-center {
	align-items: center;
}

.gap-2 {
	gap: 0.5rem;
}

.bg-red-500 {
	background-color: #ef4444;
}

.hover\:bg-red-600:hover {
	background-color: #dc2626;
}

.cart-removed-notification {
	background-color: #fef2f2;
	border-left: 4px solid #dc2626;
	padding: 1rem;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	animation: slideUp 0.5s ease-out, fadeIn 0.5s ease-out;
}

.text-red-800 {
	color: #dc2626;
}
/* ===== Mobile fullscreen chat (like TGDĐ) ===== */
html.no-scroll, body.no-scroll {
	overflow: hidden;
	height: 100%;
}

@media (max-width: 768px) {
	.chat-widget.mobile-full {
		position: fixed !important;
		inset: 0; /* top:0 right:0 bottom:0 left:0 */
		width: 100vw;
		max-width: 100vw;
		height: 100dvh; /* dynamic viewport height cho iOS/Android mới */
		max-height: 100dvh;
		border-radius: 0;
		box-shadow: none;
		background: var(--surface);
		transform: none !important;
		opacity: 1 !important; /* bật luôn hiển thị */
		pointer-events: auto;
		z-index: 2147483647; /* trên mọi thứ */
	}

	/* Tăng đệm safe-area cho tai thỏ */
	.chat-header {
		padding-top: max(10px, env(safe-area-inset-top));
	}

	.chat-input {
		padding-bottom: max(10px, env(safe-area-inset-bottom));
	}

	/* Ẩn các nút nổi khi chat đang full */
	.chat-widget.mobile-full ~ .chat-button,
	.chat-widget.mobile-full ~ .fab-more,
	.chat-widget.mobile-full ~ .scroll-top-btn {
		display: none !important;
	}
}
/* ===== MOBILE FULLSCREEN OVERRIDES (đặt CUỐI file) ===== */
html.no-scroll, body.no-scroll {
	overflow: hidden !important;
	position: fixed !important;
	width: 100% !important;
	height: 100% !important;
}

@media (max-width: 768px) {
	/* Khi chat mở => full màn hình, xoá mọi viền/khoảng cách cũ */
	.chat-widget.active {
		position: fixed !important;
		inset: 0 !important; /* top:0 right:0 bottom:0 left:0 */
		width: 100vw !important;
		max-width: 100vw !important;
		height: 100vh !important;
		height: calc(var(--vvh, 1vh) * 100) !important;
		max-height: 100vh !important;
		right: auto !important;
		bottom: auto !important;
		border: 0 !important; /* xoá khung xanh cũ */
		border-radius: 0 !important;
		box-shadow: none !important;
		background: #fff !important;
		transform: none !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
		z-index: 2147483647 !important;
	}

		/* Vùng tin nhắn không bị giới hạn 500px nữa */
		.chat-widget.active .chat-messages {
			max-height: none !important;
			min-height: 0 !important;
		}

		/* Ẩn nút tròn khi full */
		.chat-widget.active ~ .chat-button,
		.chat-widget.active ~ .scroll-top-btn {
			display: none !important;
		}

	/* Safe-area cho tai thỏ */
	.chat-header {
		padding-top: max(10px, env(safe-area-inset-top));
	}

	.chat-input {
		padding-bottom: max(10px, env(safe-area-inset-bottom));
	}
}

:root {
	--fab-size: 47px; /* đường kính 1 nút */
	--fab-gap: -10px; /* khoảng cách giữa 2 nút */
	--fab-base: max(12px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
	.chat-button {
		position: fixed !important;
		right: 12px !important;
		bottom: calc(var(--fab-base) + (var(--fab-size) + var(--fab-gap)) * 1) !important; /* đổi số 0 thành 1/2/3 nếu muốn vị trí khác */
		width: var(--fab-size) !important;
		height: var(--fab-size) !important;
		border-radius: 50% !important;
		z-index: 2147483647 !important;
	}

	/* Khi mở chat full thì ẩn nút tròn để không che */
	.chat-widget.active ~ .chat-button {
		display: none !important;
	}
}
/* --- MOBILE: giữ header & input dính, không nhảy khi mở bàn phím --- */
@media (max-width: 768px) {
	/* Chatbox khi mở: fullscreen */
	.chat-widget.active {
		display: flex !important;
		height: 100vh !important;
		height: calc(var(--vvh, 1vh) * 100) !important;
		min-height: -webkit-fill-available !important;
		inset: 0 !important;
		position: fixed !important;
		overscroll-behavior: contain;
		background: #fff !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		transform: none !important;
		opacity: 1 !important;
		z-index: 2147483647 !important;
		overflow: hidden !important;
	}

	/* header dính trên cùng trong khung chat */
	.chat-header {
		position: sticky;
		top: 0;
		z-index: 10;
		background: #007bff;
		flex-shrink: 0;
	}

	/* thanh nhập dính dưới cùng trong khung chat */
	.chat-input {
		position: sticky;
		bottom: 0;
		z-index: 10;
		padding: 10px;
		padding-bottom: max(10px, env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid #ddd;
		flex-shrink: 0;
		width: 100%;
		box-sizing: border-box;
	}

	/* vùng tin nhắn tự co giãn, cuộn mượt */
	.chat-messages {
		flex: 1;
		overflow-y: scroll;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain; /* Ngăn scroll chaining */
		overscroll-behavior-y: contain;
		min-height: 0;
		max-height: 100%;
		position: relative;
		touch-action: pan-y; /* Chỉ cho phép scroll dọc */
		-ms-scroll-chaining: none;
		scroll-behavior: smooth;
		/* Thêm để chặn scroll leak */
		isolation: isolate;
	}

	/* Input wrapper */
	.input-wrapper {
		width: 100%;
		box-sizing: border-box;
	}

		.input-wrapper input[type="text"] {
			width: 100%;
			box-sizing: border-box;
			font-size: 16px !important; /* Ngăn iOS zoom khi focus */
		}

	/* Các nút trong chat-input */
	.chat-input .send-btn,
	.chat-input .quick-menu-btn,
	.chat-input .mic-btn {
		flex-shrink: 0;
	}

	/* Quick actions */
	.quick-actions {
		max-height: 40vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Scroll button trên mobile */
	.scroll-btn {
		position: absolute;
		bottom: 80px;
		left: 50%;
		transform: translateX(-50%);
		z-index: 5;
	}

	/* Typing indicator */
	.typing-indicator {
		margin-bottom: 10px;
	}

	/* Chat disclaimer */
	.chat-disclaimer {
		font-size: 10px;
		padding: 4px 8px;
	}
	.hsv-product-rating {
		font-size: 10px;
		color: #666;
		margin-bottom: 4px;
	}

	/* Star color in rating blocks */
	.hsv-rating-stars i {
		color: #ffc107;
	}

	/* Mặc định: sao xám khi chưa có đánh giá */
	.hsv-product-rating .hsv-rating-stars,
	.hsv-product-rating .hsv-rating-stars i {
		color: #bbb;
	}

	/* Có đánh giá: sao vàng */
	.hsv-product-rating.has-rating .hsv-rating-stars,
	.hsv-product-rating.has-rating .hsv-rating-stars i {
		color: #ffc107;
	}
	/* Message content max width */
	.message-content {
		max-width: 90% !important;
		word-wrap: break-word;
		word-break: break-word;
	}

	/* Product list trong chat */
	.hsv-product-list {
		width: 100% !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Đảm bảo links có thể click được */
	.message-content a {
		color: #007bff;
		text-decoration: underline;
		pointer-events: auto;
	}
}
/* Desktop only: hạ nút chat xuống thêm một xíu */
@media (min-width: 769px) {
	.chat-button {
		bottom: 8px !important; /* chỉnh 8 → 10/12 tùy ý */
	}
}

:root {
	--chat-size: 60px;
}

.chat-button {
	position: fixed !important;
	right: 20px;
	bottom: 20px;
	width: var(--chat-size);
	height: var(--chat-size);
	border-radius: 50%;
	display: grid;
	place-items: center; /* căn giữa tuyệt đối */
	background: linear-gradient(135deg,#007bff,#0056b3);
	box-shadow: 0 6px 25px rgba(0,123,255,.35);
	cursor: pointer;
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
	z-index: 2147483647;
}

	/* vòng “ring” mỏng cho cảm giác premium */
	.chat-button::before {
		content: "";
		position: absolute;
		inset: 6px;
		border-radius: 50%;
		box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
		pointer-events: none;
	}

	.chat-button:hover {
		transform: translateY(-2px) scale(1.05);
		box-shadow: 0 8px 30px rgba(0,123,255,.5);
		cursor: pointer;
	}

	.chat-button:active {
		transform: translateY(0) scale(1);
		transition: transform 0.1s ease;
	}


.chat-icon {
	width: 64%;
	height: 64%;
	display: block;
}

.chat-button svg {
	width: auto;
	height: auto;
	fill: none;
}

/* chấm online */
.chat-online {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22C55E;
	box-shadow: 0 0 0 2px #fff;
}

/* mắt chớp nhẹ (vui mắt) */
@keyframes blink {
	0%,92%,100% {
		transform: scaleY(1)
	}

	96% {
		transform: scaleY(.1)
	}
}

#eye-left, #eye-right {
	transform-origin: center;
	animation: blink 4.5s infinite;
}
/* Nắn vị trí robot cho cân vòng trắng */
:root {
	--chat-icon-shift-y: 2px;
}
/* chỉnh 1–3px tùy mắt */

.chat-button .chat-icon {
	transform: translateY(var(--chat-icon-shift-y));
	/* fallback nếu trình duyệt cũ không hỗ trợ transform sub-pixel */
	margin-top: calc(var(--chat-icon-shift-y));
}
/* ---- MOBILE: cố định các nút theo viewport, không đẩy nhau ---- */
@media (max-width: 768px) {
	:root {
		--fab-base: max(12px, env(safe-area-inset-bottom));
		--fab-size: 47px; /* đúng kích thước chat-button của bạn */
		--fab-gap: 10px; /* khoảng cách menu với nút chat */
	}


	.scroll-top-btn.show {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	/* Toggle Button - Nút 3 chấm */
	.fab-toggle {
		position: fixed !important;
		right: 12px !important;
		bottom: calc(var(--fab-base) + (var(--fab-size) + var(--fab-gap)) * 2) !important;
		width: var(--fab-size) !important;
		height: var(--fab-size) !important;
		border-radius: 50% !important;
		background: linear-gradient(135deg, var(--hsv-green), var(--hsv-green-dark)) !important;
		border: none;
		color: white;
		font-size: 20px;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		box-shadow: 0 4px 15px rgba(77, 184, 72, 0.4);
		z-index: 2147483647 !important;
		transition: all 0.3s ease;
	}

	.fab-toggle:active {
		transform: scale(0.95);
	}

	.fab-toggle.active {
		background: linear-gradient(135deg, var(--hsv-green-dark), var(--hsv-green)) !important;
		transform: rotate(90deg);
	}

	/* MENU 3 NÚT (Zalo/Mess/Hotline) */
	.fixedpage-action .dropdown-menu {
		position: fixed !important;
		right: 12px !important;
		bottom: calc(var(--fab-base) + (var(--fab-size) + var(--fab-gap)) * 3) !important;
		background: white;
		border-radius: 15px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
		padding: 8px;
		min-width: 180px;
		display: none;
		opacity: 0;
		transform: translateY(20px) scale(0.9);
		transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
		z-index: 2147483646;
	}

	.fixedpage-action .dropdown-menu.show {
		display: block !important;
		opacity: 1;
		transform: translateY(0) scale(1);
	}

	.fixedpage-action .dropdown-menu li {
		list-style: none;
		margin: 4px 0;
	}

	.fixedpage-action .dropdown-menu .dropdown-item {
		display: flex;
		align-items: center;
		padding: 12px;
		border-radius: 10px;
		text-decoration: none;
		color: #333;
		transition: all 0.2s ease;
		gap: 10px;
	}

	.fixedpage-action .dropdown-menu .dropdown-item:hover {
		background: #f0f7ff;
		transform: translateX(-3px);
	}

	.fixedpage-action .dropdown-menu .dropdown-item img {
		width: 32px !important;
		height: 32px !important;
		flex-shrink: 0;
	}

	.fixedpage-action .dropdown-menu .dropdown-item span {
		display: flex;
		flex-direction: column;
		line-height: 1.3;
	}

	.fixedpage-action .dropdown-menu .dropdown-item b {
		font-size: 14px;
		font-weight: 600;
		color: #333;
	}

	.fixedpage-action .dropdown-menu .dropdown-item small {
		font-size: 11px;
		color: #999;
	}

	/* KHÔNG dùng hover để mở trên mobile */
	.dropdown:hover .dropdown-menu {
		display: none !important;
	}

	/* Ẩn toggle button trên desktop */
	.fab-toggle {
		display: flex;
	}
}

/* Desktop - Ẩn toggle button */
@media (min-width: 769px) {
	.fab-toggle {
		display: none !important;
	}
}
/* === HSV BRAND THEME (match logo) — paste at END of CSS === */
:root {
	--hsv-green: #4DB848; /* xanh lá trong logo */
	--hsv-green-dark: #2F902A;
	--hsv-blue: #0A67B5; /* xanh dương trong logo */
	--hsv-blue-dark: #084F89;
}

/* ------ NAV / MENU (đổi nếu class khác) ------ */
.navbar, .topbar, .main-menu, .menu, .nav-bar, .header-menu {
	background: var(--hsv-green) !important;
	border-color: var(--hsv-green) !important;
}

	.main-menu a, .menu a, .nav a {
		color: #fff !important;
	}

		.main-menu a:hover, .menu a:hover, .nav a:hover {
			background: var(--hsv-blue) !important;
			color: #fff !important;
		}

/* ------ Search & hotline nhấn theo xanh lá ------ */
input[type="search"], .search-input {
	border-color: var(--hsv-green) !important;
}

	input[type="search"]:focus, .search-input:focus {
		border-color: var(--hsv-blue) !important;
		box-shadow: 0 0 0 3px rgba(10,103,181,.15) !important;
	}

.hotline, .hotline a {
	color: var(--hsv-green) !important;
}

/* ------ Chat widget (đồng bộ logo) ------ */
.chat-header {
	background: var(--hsv-green) !important;
}

.send-btn {
	background: var(--hsv-green) !important;
}

	.send-btn:hover {
		background: var(--hsv-green-dark) !important;
	}

.chat-button {
	background: linear-gradient(135deg, var(--hsv-blue), var(--hsv-green)) !important;
	box-shadow: 0 6px 25px rgba(77,184,72,.35) !important;
}

.scroll-btn {
	background: linear-gradient(135deg, var(--hsv-blue-dark), var(--hsv-green)) !important;
}

/* Nút CTA “Mua ngay” cùng tông */
.hsv-buy-now {
	background: var(--hsv-green) !important;
	color: #fff !important;
}

	.hsv-buy-now:hover {
		background: var(--hsv-green-dark) !important;
	}

/* Link tiện ích từng dùng xanh dương cũ -> xanh logo */
.text-blue-600 {
	color: var(--hsv-blue) !important;
}

.bg-blue-500 {
	background-color: var(--hsv-blue) !important;
	color: #fff;
}

.bg-blue-600 {
	background-color: var(--hsv-blue-dark) !important;
	color: #fff;
}

.hover\:bg-blue-600:hover {
	background-color: var(--hsv-blue) !important;
}

.hover\:bg-blue-700:hover {
	background-color: var(--hsv-blue-dark) !important;
}

/* Focus input theo tông */
.chat-input input:focus {
	border-color: var(--hsv-green) !important;
}
