/**
 * استایل دکمه‌های شناور مشاوره خرید/فنی + چت‌باکس
 * محل فایل: assets/styles/whatsapp-chat.css
 */

:root {
	--tehranchi-orange: #F7931E; /* رنگ نارنجی برند - در صورت داشتن کد رنگ دقیق، همین‌جا عوض کنید */
	--tehranchi-orange-dark: #D97706;
	--tehranchi-sales-green: #25D366;
	--tehranchi-ink: #1f2937;
}

/* ---------- دکمه‌های شناور ---------- */

.c-tehranchi-whatsapp-fab {
	position: fixed;
	bottom: 24px;
	left: 24px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 14px;
	direction: rtl;
}

.c-tehranchi-whatsapp-fab__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	color: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	transition: transform .2s ease, box-shadow .2s ease;
}

.c-tehranchi-whatsapp-fab__btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 22px rgba(0, 0, 0, .32);
}

.c-tehranchi-whatsapp-fab__btn--sales {
	background: var(--tehranchi-sales-green);
}

.c-tehranchi-whatsapp-fab__btn--technical {
	background: var(--tehranchi-orange);
}

.c-tehranchi-whatsapp-fab__icon {
	width: 28px;
	height: 28px;
	display: flex;
}

.c-tehranchi-whatsapp-fab__icon svg {
	width: 100%;
	height: 100%;
}

/* نماد "جرقه" هوش مصنوعی که روی آیکون آچار سوار میشه */
.c-tehranchi-whatsapp-fab__icon svg .c-tehranchi-ai-spark {
	fill: #fff;
	stroke: none;
}

.c-tehranchi-whatsapp-fab__tooltip {
	position: absolute;
	left: 68px;
	top: 50%;
	transform: translateY(-50%);
	background: var(--tehranchi-ink);
	color: #fff;
	font-size: .8rem;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}

.c-tehranchi-whatsapp-fab__tooltip::after {
	content: '';
	position: absolute;
	left: -5px;
	top: 50%;
	transform: translateY(-50%);
	border-width: 5px 5px 5px 0;
	border-style: solid;
	border-color: transparent var(--tehranchi-ink) transparent transparent;
}

.c-tehranchi-whatsapp-fab__btn:hover .c-tehranchi-whatsapp-fab__tooltip {
	opacity: 1;
}

@media (max-width: 576px) {
	.c-tehranchi-whatsapp-fab {
		bottom: 16px;
		left: 16px;
		gap: 10px;
	}

	.c-tehranchi-whatsapp-fab__btn {
		width: 48px;
		height: 48px;
	}

	.c-tehranchi-whatsapp-fab__icon {
		width: 24px;
		height: 24px;
	}

	.c-tehranchi-whatsapp-fab__tooltip {
		display: none;
	}
}

/* ---------- چت‌باکس ---------- */

.c-tehranchi-chatbox {
	position: fixed;
	bottom: 100px;
	left: 24px;
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: 520px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
	z-index: 10000;
	direction: rtl;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: inherit;
}

.c-tehranchi-chatbox[hidden] {
	display: none;
}

.c-tehranchi-chatbox__header {
	background: var(--tehranchi-orange);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
	font-size: .95rem;
	flex-shrink: 0;
}

.c-tehranchi-chatbox__header--sales {
	background: var(--tehranchi-sales-green);
}

.c-tehranchi-chatbox__close {
	background: none;
	border: none;
	color: #fff;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.c-tehranchi-chatbox__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f3f4f6;
}

.c-tehranchi-chat-bubble {
	max-width: 88%;
	padding: 10px 14px;
	border-radius: 12px;
	font-size: .85rem;
	line-height: 1.7;
	white-space: pre-line;
}

.c-tehranchi-chat-bubble--bot {
	background: #fff;
	color: #111827;
	align-self: flex-start;
	border-bottom-right-radius: 2px;
}

.c-tehranchi-chat-bubble--user {
	background: var(--tehranchi-orange);
	color: #fff;
	align-self: flex-end;
	border-bottom-left-radius: 2px;
}

.c-tehranchi-chat-bubble--typing {
	background: #fff;
	color: #9ca3af;
	align-self: flex-start;
	font-size: .8rem;
}

.c-tehranchi-chat-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}

.c-tehranchi-chat-options button {
	background: #fff;
	border: 1px solid var(--tehranchi-orange);
	color: var(--tehranchi-orange-dark);
	border-radius: 10px;
	padding: 8px 12px;
	font-size: .82rem;
	cursor: pointer;
	text-align: right;
	transition: background .15s ease, color .15s ease;
}

.c-tehranchi-chat-options button:hover {
	background: var(--tehranchi-orange);
	color: #fff;
}

.c-tehranchi-chat-cta,
.c-tehranchi-chat-human-link {
	display: inline-block;
	margin-top: 4px;
	text-decoration: none;
	text-align: center;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: .82rem;
	font-weight: 700;
}

.c-tehranchi-chat-cta {
	background: var(--tehranchi-sales-green);
	color: #fff;
}

.c-tehranchi-chat-human-link {
	background: #fff;
	color: var(--tehranchi-orange-dark);
	border: 1px solid var(--tehranchi-orange);
	align-self: center;
}

.c-tehranchi-chatbox__footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	flex-shrink: 0;
}

.c-tehranchi-chatbox__footer[hidden] {
	display: none;
}

.c-tehranchi-chatbox__input {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	padding: 8px 14px;
	font-size: .85rem;
	outline: none;
	font-family: inherit;
}

.c-tehranchi-chatbox__input:focus {
	border-color: var(--tehranchi-orange);
}

.c-tehranchi-chatbox__send {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--tehranchi-orange);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.c-tehranchi-chatbox__send svg {
	width: 18px;
	height: 18px;
}

.c-tehranchi-chatbox__send:disabled {
	opacity: .5;
	cursor: not-allowed;
}
