.alaya-salesbot {
	--alaya-theme: #1c6b57;
	position: fixed;
	bottom: 24px;
	z-index: 999999;
	font-family: "Segoe UI", sans-serif;
}

/* Fix hidden attribute to properly hide elements */
.alaya-salesbot__panel[hidden] {
	display: none !important;
}

.alaya-salesbot__typing[hidden] {
	display: none !important;
}

.alaya-salesbot__typing {
	pointer-events: none;
}

.alaya-salesbot[data-position="left"] {
	left: 24px;
}

.alaya-salesbot[data-position="right"] {
	right: 24px;
}

.alaya-salesbot__launcher {
	position: relative;
	z-index: 2;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--alaya-theme), #0f2f27);
	color: #fff;
	padding: 14px 18px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	box-shadow: 0 20px 45px rgba(10, 35, 29, 0.35);
	cursor: pointer;
}

.alaya-salesbot__launcher-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #d9ff8e;
	box-shadow: 0 0 0 6px rgba(217, 255, 142, 0.18);
}

.alaya-salesbot__panel {
	position: relative;
	z-index: 1;
	width: min(380px, calc(100vw - 24px));
	max-height: min(720px, calc(100vh - 100px));
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 28px;
	box-shadow: 0 30px 80px rgba(17, 24, 39, 0.2);
	overflow: hidden;
	display: grid;
	grid-template-rows: auto 1fr auto auto;
	margin-top: 14px;
	animation: alayaFadeIn 0.25s ease;
}

.alaya-salesbot__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px;
	color: #fff;
	background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 45%), linear-gradient(135deg, var(--alaya-theme), #14362d);
}

.alaya-salesbot__header-main {
	display: flex;
	align-items: center;
	gap: 12px;
}

.alaya-salesbot__avatar {
	width: 48px;
	height: 48px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.2);
	display: grid;
	place-items: center;
	font-weight: 700;
	overflow: hidden;
}

.alaya-salesbot__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.alaya-salesbot__name,
.alaya-salesbot__tagline {
	margin: 0;
}

.alaya-salesbot__tagline {
	opacity: 0.82;
	font-size: 13px;
}

.alaya-salesbot__close,
.alaya-salesbot__restart,
.alaya-salesbot__send {
	border: 0;
	cursor: pointer;
}

.alaya-salesbot__close {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 12px;
	font-size: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.alaya-salesbot__messages {
	padding: 18px;
	overflow-y: auto;
	background:
		radial-gradient(circle at top, rgba(28, 107, 87, 0.08), transparent 32%),
		linear-gradient(180deg, #f8fbf9, #fff);
}

.alaya-salesbot__message {
	max-width: 85%;
	margin-bottom: 12px;
	padding: 12px 14px;
	border-radius: 18px;
	line-height: 1.45;
	word-break: break-word;
}

.alaya-salesbot__message--bot {
	background: #fff;
	color: #1f2937;
	border-top-left-radius: 6px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.alaya-salesbot__message--user {
	background: linear-gradient(135deg, var(--alaya-theme), #154135);
	color: #fff;
	margin-left: auto;
	border-top-right-radius: 6px;
}

.alaya-salesbot__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 14px;
}

.alaya-salesbot__chip,
.alaya-salesbot__card-button {
	border: 0;
	border-radius: 999px;
	padding: 10px 14px;
	background: #edf7f3;
	color: #124236;
	cursor: pointer;
	font-weight: 600;
}

.alaya-salesbot__card {
	background: #fff;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
	margin-bottom: 14px;
}

.alaya-salesbot__card-image {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.alaya-salesbot__card-content {
	padding: 16px;
}

.alaya-salesbot__card-content h4 {
	margin: 6px 0;
	font-size: 18px;
}

.alaya-salesbot__card-meta,
.alaya-salesbot__card-stock {
	font-size: 12px;
	color: #64748b;
}

.alaya-salesbot__card-price {
	color: var(--alaya-theme);
	font-weight: 700;
	margin-bottom: 8px;
}

.alaya-salesbot__card-actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.alaya-salesbot__card-button {
	flex: 1;
}

.alaya-salesbot__card-button--primary {
	background: linear-gradient(135deg, var(--alaya-theme), #154135);
	color: #fff;
}

.alaya-salesbot__typing {
	display: flex;
	gap: 6px;
	padding: 0 18px 12px;
}

.alaya-salesbot__typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(28, 107, 87, 0.4);
	animation: alayaPulse 1s infinite;
}

.alaya-salesbot__typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.alaya-salesbot__typing span:nth-child(3) {
	animation-delay: 0.3s;
}

.alaya-salesbot__composer {
	padding: 14px 18px 18px;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	background: #fff;
}

.alaya-salesbot__restart {
	border-radius: 14px;
	background: #eef2f7;
	padding: 12px 14px;
	color: #1f2937;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 500;
}

@media (max-width: 640px) {
	.alaya-salesbot__restart {
		min-height: 48px;
		padding: 12px 14px;
		font-size: 16px;
	}
}

.alaya-salesbot__form {
	display: flex;
	gap: 10px;
}

.alaya-salesbot__input {
	flex: 1;
	border-radius: 16px;
	border: 1px solid #d7e0e9;
	padding: 12px 14px;
}

.alaya-salesbot__send {
	border-radius: 16px;
	padding: 12px 18px;
	background: linear-gradient(135deg, var(--alaya-theme), #154135);
	color: #fff;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 500;
}

@media (max-width: 640px) {
	.alaya-salesbot__send {
		min-height: 48px;
		padding: 12px 16px;
		font-size: 16px;
	}
}

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

@keyframes alayaFadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 640px) {
	.alaya-salesbot[data-position="left"] {
		left: 12px;
		right: auto;
		bottom: 12px;
	}

	.alaya-salesbot[data-position="right"] {
		right: 12px;
		left: auto;
		bottom: 12px;
	}

	.alaya-salesbot__panel {
		width: 100%;
		max-height: calc(100vh - 90px);
	}

	.alaya-salesbot__card-actions,
	.alaya-salesbot__composer,
	.alaya-salesbot__form {
		grid-template-columns: 1fr;
		display: grid;
	}
}
