:root {
	--asc-color-gold: #CFAC61;
	--asc-color-navy: #1B252F;
	--asc-color-light: #E2E9EE;
	--asc-theme-color: var(--asc-color-gold);
}

.asc-floating-widget {
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: inherit;
	direction: rtl;
}
.asc-floating-widget.asc-pos-right { right: 20px; }
.asc-floating-widget.asc-pos-left { left: 20px; }

.asc-toggle-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--asc-color-navy);
	color: var(--asc-color-gold);
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(27,37,47,0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: transform 0.15s ease;
}
.asc-toggle-btn:hover { transform: scale(1.06); }
.asc-toggle-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.asc-floating-panel {
	position: fixed;
	top: 16px;
	bottom: 96px;
	width: 380px;
	max-width: calc(100vw - 32px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0,0,0,0.2);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.asc-floating-panel[hidden] {
	display: none !important;
}
.asc-pos-right .asc-floating-panel { right: 20px; }
.asc-pos-left .asc-floating-panel { left: 20px; }

.asc-inline-chat-root {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 520px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 16px rgba(0,0,0,0.12);
	overflow: hidden;
	font-family: inherit;
	direction: rtl;
	border: 1px solid #eee;
}

.asc-chat-header {
	background: #fff;
	color: var(--asc-color-navy);
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border-bottom: 1px solid #eef1f4;
	flex-shrink: 0;
}
.asc-header-title {
	display: flex;
	align-items: center;
	gap: 10px;
}
.asc-header-avatar-wrap {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--asc-color-navy);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}
.asc-header-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.asc-header-avatar--emoji { color: var(--asc-color-gold); font-size: 18px; }
.asc-header-texts { display: flex; flex-direction: column; }
.asc-header-name { font-weight: 700; font-size: 15px; color: var(--asc-color-navy); line-height: 1.4; }
.asc-header-sub { font-size: 11px; color: #8b98a5; margin-top: 2px; }
.asc-header-close {
	background: var(--asc-color-light);
	border: none;
	color: var(--asc-color-navy);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.9;
}
.asc-header-close:hover { opacity: 1; }

.asc-chat-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 16px 14px;
	background: var(--asc-color-light);
}
.asc-chat-body-inner {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.asc-msg { display: flex; align-items: flex-end; gap: 6px; }
.asc-msg--user { justify-content: flex-start; }
.asc-msg--assistant { justify-content: flex-end; }

.asc-msg-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--asc-color-navy);
	color: var(--asc-color-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	flex-shrink: 0;
	overflow: hidden;
}
.asc-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.asc-bubble {
	max-width: 82%;
	min-width: 0;
	padding: 11px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.7;
	word-wrap: break-word;
	overflow-wrap: break-word;
	box-sizing: border-box;
}
.asc-msg--user .asc-bubble {
	background: var(--asc-theme-color);
	color: var(--asc-color-navy);
	border-bottom-left-radius: 4px;
	font-weight: 500;
}
.asc-msg--assistant .asc-bubble {
	background: #fff;
	color: var(--asc-color-navy);
	box-shadow: 0 1px 4px rgba(27,37,47,0.08);
	border-bottom-right-radius: 4px;
}
.asc-typing .asc-bubble { opacity: 0.65; font-style: italic; }

.asc-chat-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #eef1f4;
	background: #fff;
	flex-shrink: 0;
}
.asc-chat-input-wrap {
	flex: 1;
	background: var(--asc-color-light);
	border-radius: 999px;
	padding: 6px 14px;
	display: flex;
	align-items: center;
	min-width: 0;
}
.asc-chat-input {
	flex: 1;
	resize: none;
	border: none;
	background: transparent;
	padding: 6px 0;
	font-size: 14px;
	font-family: inherit;
	max-height: 100px;
	direction: rtl;
	color: var(--asc-color-navy);
}
.asc-chat-input::placeholder { color: #9aa5ad; }
.asc-chat-input:focus { outline: none; }

.asc-chat-send {
	background: var(--asc-theme-color);
	color: var(--asc-color-navy);
	border: none;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: filter 0.15s ease;
}
.asc-chat-send svg { transform: scaleX(-1); }
.asc-chat-send:hover { filter: brightness(0.94); }

/* کارت‌های محصول داخل چت */
.asc-card-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	min-width: 0;
}
.asc-product-card {
	display: block;
	min-width: 0;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 8px;
	text-decoration: none;
	color: #222;
	box-sizing: border-box;
}
.asc-product-card img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 80px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 6px;
}
.asc-pc-name {
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 3px;
	line-height: 1.4;
	overflow-wrap: break-word;
}
.asc-pc-price { font-size: 12px; color: var(--asc-theme-color); font-weight: 700; }

.asc-cart-success { text-align: center; }
.asc-btn {
	display: inline-block;
	margin-top: 8px;
	background: var(--asc-theme-color);
	color: var(--asc-color-navy) !important;
	padding: 6px 14px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

@media (max-width: 480px) {
	.asc-floating-panel {
		top: 12px;
		bottom: 90px;
		width: calc(100vw - 20px);
		right: 10px !important;
		left: 10px !important;
	}
}
