@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

#stoneai-chat-root, #stoneai-chat-root * {
	box-sizing: border-box;
	font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

/* دکمه شناور باز/بسته کردن چت */
.stoneai-toggle-btn {
	position: fixed;
	bottom: var(--stoneai-bottom, 24px);
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--stoneai-color, #8a6d3b);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
}

.stoneai-position-right .stoneai-toggle-btn { right: 24px; }
.stoneai-position-left .stoneai-toggle-btn  { left: 24px; }

/* پنجره چت */
.stoneai-window {
	position: fixed;
	bottom: calc(var(--stoneai-bottom, 24px) + 72px);
	width: 340px;
	max-width: 92vw;
	height: 480px;
	max-height: 75vh;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0,0,0,.2);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	font-family: Tahoma, Arial, sans-serif;
	direction: rtl;
}

.stoneai-position-right .stoneai-window { right: 24px; }
.stoneai-position-left .stoneai-window  { left: 24px; }

.stoneai-window.stoneai-open { display: flex; }

.stoneai-inline .stoneai-window {
	position: static;
	display: flex;
	width: 100%;
	max-width: 480px;
	height: 520px;
	margin: 0 auto;
	box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

.stoneai-header {
	background: var(--stoneai-color, #8a6d3b);
	color: #fff;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: bold;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.stoneai-header button {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.stoneai-messages {
	flex: 1;
	padding: 14px;
	overflow-y: auto;
	background: #f7f5f1;
}

.stoneai-msg {
	margin-bottom: 10px;
	padding: 10px 13px;
	border-radius: 12px;
	max-width: 80%;
	font-size: 13.5px;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.stoneai-msg a {
	color: inherit;
	text-decoration: underline;
	word-break: break-all;
}

.stoneai-msg.bot a {
	color: var(--stoneai-color, #8a6d3b);
}

.stoneai-msg.bot {
	background: #fff;
	border: 1px solid #eee;
	margin-right: auto;
	border-bottom-right-radius: 2px;
}

.stoneai-msg.user {
	background: var(--stoneai-color, #8a6d3b);
	color: #fff;
	margin-left: auto;
	border-bottom-left-radius: 2px;
}

.stoneai-msg.typing {
	color: #999;
	font-style: italic;
}

/* کارت‌های محصول پیشنهادی */
.stoneai-product-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 4px 0 14px;
	max-width: 85%;
	margin-right: auto;
}

.stoneai-product-card {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
	padding: 8px;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s ease, border-color .15s ease;
}

.stoneai-product-card:hover {
	box-shadow: 0 2px 10px rgba(0,0,0,.1);
	border-color: var(--stoneai-color, #8a6d3b);
}

.stoneai-product-card img {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f2f2f2;
}

.stoneai-product-card-body {
	min-width: 0;
}

.stoneai-product-card-name {
	font-size: 13px;
	font-weight: 600;
	color: #2a2a2a;
	white-space: normal;
	overflow-wrap: anywhere;
}

.stoneai-product-card-price {
	font-size: 12px;
	color: var(--stoneai-color, #8a6d3b);
	margin-top: 2px;
	font-weight: 500;
}

.stoneai-input-row {
	display: flex;
	border-top: 1px solid #eee;
	padding: 10px;
	gap: 8px;
}

.stoneai-input-row input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13.5px;
	font-family: inherit;
}

.stoneai-input-row button {
	background: var(--stoneai-color, #8a6d3b);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 13.5px;
}

.stoneai-input-row button:disabled {
	opacity: .6;
	cursor: not-allowed;
}
