/* AI Sa Huỳnh Food Commerce — Coastal Heritage Storefront Chat Widget (Desktop + Mobile Bottom Sheet) */
.amac-chat-fab {
	position: fixed;
	right: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	background: #0B3954;
	color: #FFFFFF;
	border: 1.5px solid #F5C451;
	border-radius: 999px;
	padding: 12px 18px;
	font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 10px 26px rgba(7, 39, 59, 0.30);
	cursor: pointer;
	transition: background 0.16s ease, transform 0.15s ease, border-color 0.16s ease;
}
.amac-chat-fab:hover {
	background: #1565A8;
	border-color: #1565A8;
	transform: translateY(-2px);
}

.amac-chat-panel {
	position: fixed;
	right: 20px;
	bottom: calc(78px + env(safe-area-inset-bottom, 0px));
	width: 380px;
	max-width: calc(100vw - 24px);
	max-height: 76vh;
	display: flex;
	flex-direction: column;
	background: #FFFFFF;
	border: 1px solid #DCE5EE;
	border-radius: 16px;
	box-shadow: 0 18px 44px rgba(7, 39, 59, 0.24);
	z-index: 99991;
	overflow: hidden;
	font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.amac-chat-panel[hidden] { display: none; }

.amac-chat-head {
	background: linear-gradient(120deg, #07273B 0%, #0B3954 100%);
	color: #FFFFFF;
	padding: 13px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 2px solid #F5C451;
}
.amac-chat-head strong { font-size: 14.5px; letter-spacing: 0.01em; }
.amac-chat-close {
	background: rgba(255, 255, 255, 0.12);
	border: none;
	color: #FCE09B;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	font-size: 20px;
	cursor: pointer;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.amac-chat-close:hover { background: rgba(255, 255, 255, 0.22); color: #FFFFFF; }

.amac-chat-body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 13px;
	background: #F6F9FC;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.amac-msg {
	max-width: 90%;
	padding: 10px 13px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}
.amac-msg-user { align-self: flex-end; background: #1565A8; color: #FFFFFF; border-bottom-right-radius: 4px; }
.amac-msg-bot { align-self: flex-start; background: #FFFFFF; border: 1px solid #DCE5EE; color: #162533; border-bottom-left-radius: 4px; }

.amac-verified-box {
	background: #F6F9FC;
	border: 1px solid #B4CFE9;
	border-radius: 9px;
	padding: 8px 10px;
	margin-top: 7px;
	font-size: 12.5px;
}
.amac-verified-box a { color: #1565A8; font-weight: 700; text-decoration: none; }
.amac-verified-box a:hover { color: #B45309; text-decoration: underline; }

.amac-ai-note {
	margin-top: 6px;
	font-size: 11px;
	color: #526476;
	border-top: 1px dashed #DCE5EE;
	padding-top: 4px;
}

.amac-chat-foot {
	border-top: 1px solid #DCE5EE;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
	background: #FFFFFF;
}
.amac-chat-form { display: flex; gap: 6px; }
.amac-chat-form input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid #CBD8E6;
	border-radius: 9px;
	font-size: 13.5px;
	font-family: inherit;
	color: #162533;
}
.amac-chat-form input:focus { outline: none; border-color: #1565A8; box-shadow: 0 0 0 3px rgba(21, 101, 168, 0.14); }
.amac-chat-form button {
	background: #D97706;
	color: #FFFFFF;
	border: none;
	border-radius: 9px;
	padding: 9px 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}
.amac-chat-form button:hover { background: #B45309; }
.amac-chat-form button:disabled { opacity: 0.65; cursor: not-allowed; }

.amac-chat-handoff {
	margin-top: 7px;
	width: 100%;
	background: #E8F2FC;
	color: #0B3954;
	border: 1px solid #C6DEF5;
	border-radius: 9px;
	padding: 8px;
	font-size: 12.5px;
	font-family: inherit;
	cursor: pointer;
	font-weight: 700;
}
.amac-chat-handoff:hover { background: #D4E7FA; }

.amac-handoff-panel {
	border-top: 1px solid #DCE5EE;
	background: #F6F9FC;
	padding: 11px 12px;
	display: flex;
	flex-direction: column;
	gap: 7px;
}
.amac-handoff-panel[hidden] { display: none; }
.amac-handoff-title { font-size: 12.5px; font-weight: 700; color: #0B3954; }
.amac-handoff-panel input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #CBD8E6;
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	background: #FFFFFF;
}
.amac-handoff-err { font-size: 12px; color: #B91C1C; font-weight: 600; }
.amac-handoff-actions { display: flex; gap: 6px; }
.amac-handoff-submit {
	flex: 1;
	background: #D97706;
	color: #FFFFFF;
	border: none;
	border-radius: 8px;
	padding: 9px 10px;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}
.amac-handoff-submit:hover { background: #B45309; }
.amac-handoff-cancel {
	background: #FFFFFF;
	color: #526476;
	border: 1px solid #CBD8E6;
	border-radius: 8px;
	padding: 9px 13px;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
}

/* Mobile Full-Width Bottom Sheet UX (prevents iOS Safari auto-zoom & overlap) */
@media (max-width: 640px) {
	.amac-chat-fab {
		right: 14px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		padding: 10px 15px;
		font-size: 13px;
	}
	.amac-chat-panel {
		left: 10px;
		right: 10px;
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		height: 82dvh;
		max-height: calc(100dvh - 20px);
		border-radius: 16px;
	}
	.amac-chat-form input,
	.amac-handoff-panel input {
		font-size: 16px;
	}
}
