/* ─── Ask Panel ──────────────────────────────────────────────── */

.hksm-ask-panel .hksm-ask-body {
	flex: 1;
	padding: 16px;
	overflow-y: auto;
	min-height: 0;
}

/* Chips */
.hksm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.hksm-chip {
	display: inline-block;
	padding: 8px 14px;
	background: #fff;
	border: 1px solid #d0d5dd;
	border-radius: 20px;
	font-size: 13px;
	color: #344054;
	cursor: pointer;
	transition: all 0.2s;
	-webkit-tap-highlight-color: transparent;
}

.hksm-chip:hover,
.hksm-chip:focus {
	background: #0066cc;
	color: #fff;
	border-color: #0066cc;
	outline: none;
}

/* Input bar — pinned to bottom of panel (above tab bar) */
.hksm-ask-input-bar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 14px;
	background: #f7f8fa;
	border-top: 1px solid #e6e9ee;
	flex-shrink: 0;
}

#hksm-ask-input {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	padding: 11px 14px;
	border: 1px solid #e4e7ec;
	border-radius: 22px;
	font-size: 15px;
	line-height: 1.35;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
	background: #fff;
	resize: none;
	overflow-y: auto;
	font-family: inherit;
}

#hksm-ask-input:focus {
	border-color: #0066cc;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.08);
}

#hksm-ask-send {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
	transition: width 0.22s ease, opacity 0.22s ease, margin 0.22s ease, transform 0.22s ease;
	opacity: 1;
}

#hksm-ask-voice {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	border: 0;
	background: #0066cc;
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

#hksm-ask-voice.is-recording {
	background: #d92d20;
	color: #fff;
	box-shadow: 0 0 0 5px rgba(217, 45, 32, 0.12);
}

.hksm-ask-input-msg {
	padding: 0 16px 10px;
	background: #f7f8fa;
	font-size: 12px;
	color: #b42318;
	min-height: 18px;
}

.hksm-ask-input-bar.is-recording #hksm-ask-send {
	width: 0;
	opacity: 0;
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
	pointer-events: none;
	transform: scale(0.9);
	overflow: hidden;
}

.hksm-ask-input-bar.is-recording #hksm-ask-input {
	flex: 1 1 auto;
}

/* Results area */
.hksm-ask-results {
	min-height: 40px;
}

/* Loading */
.hksm-loading {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px;
	color: #666;
	font-size: 14px;
}

.hksm-loading-dots {
	display: flex;
	gap: 4px;
}

.hksm-loading-dots span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0066cc;
	opacity: 0.7;
	animation: hksmDots 1s infinite ease-in-out;
}

.hksm-loading-dots span:nth-child(2) {
	animation-delay: 0.15s;
}

.hksm-loading-dots span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes hksmDots {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: 0.4;
	}
	40% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* Answer card */
.hksm-answer-card {
	background: #fff;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	font-size: 14px;
	line-height: 1.6;
	color: #333;
	white-space: pre-wrap;
}

/* Product cards */
.hksm-ask-panel .hksm-product-card {
	display: grid !important;
	grid-template-columns: 64px minmax(0, 1fr) !important;
	column-gap: 12px;
	align-items: start !important;
	background: #fff;
	border-radius: 10px;
	padding: 10px;
	margin-bottom: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s;
}

.hksm-product-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hksm-ask-panel .hksm-product-img {
	width: 64px;
	height: 64px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f0f0f0;
	display: block;
}

.hksm-ask-panel .hksm-product-info {
	flex: 1 1 auto;
	min-width: 0;
	display: grid !important;
	grid-template-rows: auto auto auto !important;
	row-gap: 6px;
	align-items: start !important;
	justify-items: start !important;
}

.hksm-ask-panel .hksm-product-name {
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.35;
}

.hksm-ask-panel .hksm-product-price {
	font-size: 13px;
	font-weight: 700;
	color: #0066cc;
	margin: 0 !important;
	white-space: nowrap;
}

.hksm-ask-panel .hksm-product-actions {
	display: block !important;
	margin-top: 0 !important;
}

.hksm-ask-panel .hksm-product-actions .hksm-btn {
	font-size: 12px;
	padding: 5px 10px;
	border-radius: 6px;
	display: inline-flex !important;
	width: auto !important;
}

#hksm-ask-send.is-loading {
	position: relative;
}

#hksm-ask-send.is-loading svg {
	visibility: hidden;
}

#hksm-ask-send.is-loading::after {
	content: "";
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255,255,255,0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hksmSpin 0.9s linear infinite;
	position: absolute;
}

@keyframes hksmSpin {
	to {
		transform: rotate(360deg);
	}
}

/* See more button */
.hksm-see-more {
	display: block;
	width: 100%;
	padding: 12px;
	background: #fff;
	border: 1px solid #0066cc;
	border-radius: 10px;
	color: #0066cc;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	margin: 12px 0;
	transition: all 0.2s;
}

.hksm-see-more:hover {
	background: #0066cc;
	color: #fff;
}

/* ─── Shared Buttons ─────────────────────────────────────────── */

.hksm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s;
	line-height: 1.4;
}

.hksm-btn-primary {
	background: #0066cc;
	color: #fff;
}

.hksm-btn-primary:hover {
	background: #0052a3;
}

.hksm-btn-outline {
	background: transparent;
	color: #0066cc;
	border: 1px solid #0066cc;
}

.hksm-btn-outline:hover {
	background: #0066cc;
	color: #fff;
}

/* ─── Enquiry Form ───────────────────────────────────────────── */

.hksm-enquiry-form {
	background: #fff;
	border-radius: 12px;
	padding: 20px 16px;
	margin-top: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hksm-enquiry-form h3 {
	font-size: 14px;
	color: #666;
	margin: 0 0 16px;
	line-height: 1.5;
}

.hksm-form-field {
	margin-bottom: 12px;
}

.hksm-form-field input,
.hksm-form-field textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
	font-family: inherit;
	box-sizing: border-box;
}

.hksm-form-field input:focus,
.hksm-form-field textarea:focus {
	border-color: #0066cc;
}

.hksm-enquiry-form .hksm-btn {
	width: 100%;
	padding: 12px;
	font-size: 15px;
	margin-top: 4px;
}

.hksm-enquiry-msg {
	margin-top: 12px;
	font-size: 14px;
	text-align: center;
}

.hksm-enquiry-msg.success {
	color: #52c41a;
}

.hksm-enquiry-msg.error {
	color: #ff4d4f;
}
