/* Dyofix Bot — widget צ'אט, עברית RTL, מובייל-פירסט */

#dyofix-bot-root, #dyofix-bot-root * { box-sizing: border-box; }

#dyofix-bot-root {
	--dfx-primary: #2b6cb0;
	--dfx-primary-dark: #1f4e82;
	--dfx-bg: #ffffff;
	--dfx-user: #2b6cb0;
	--dfx-bot: #f1f3f5;
	--dfx-text: #1a202c;
	direction: rtl;
	font-family: system-ui, "Segoe UI", Arial, sans-serif;
}

/* כפתור צף */
#dyofix-bot-toggle {
	position: fixed;
	bottom: 20px;
	/* פינה ימנית פיזית — עגלת הקנייה הצפה יושבת בפינה השמאלית (RTL), אז לא מתנגשים */
	right: 20px;
	z-index: 99998;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--dfx-primary);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	transition: transform .15s ease, background .2s ease;
}
#dyofix-bot-toggle:hover { background: var(--dfx-primary-dark); transform: scale(1.05); }

/* חלון הצ'אט */
#dyofix-bot-panel {
	position: fixed;
	bottom: 90px;
	right: 20px;
	/* מעל כפתור הקוקיז הצף (z ענק) כדי שלא ידרוס את שדה הקלט כשהפאנל פתוח */
	z-index: 2147482500;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: var(--dfx-bg);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0,0,0,.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
#dyofix-bot-panel.open { display: flex; }

#dyofix-bot-header {
	background: var(--dfx-primary);
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	font-size: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
#dyofix-bot-close {
	background: none; border: none; color: #fff;
	font-size: 22px; cursor: pointer; line-height: 1;
}

#dyofix-bot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafbfc;
}

.dfx-msg {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-wrap: break-word;
	direction: rtl;
	text-align: right;
}

/* עוקף כללי theme שמיישרים למרכז/שמאל — id + !important גובר על כל כלל תבנית */
#dyofix-bot-root #dyofix-bot-messages,
#dyofix-bot-root .dfx-msg,
#dyofix-bot-root #dyofix-bot-input {
	text-align: right !important;
	direction: rtl !important;
}

/* כפתורים לחיצים (quick replies) */
#dyofix-bot-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-self: flex-end;
	max-width: 100%;
	margin-top: 2px;
	direction: rtl;
}
.dfx-chip {
	background: #fff;
	border: 1.5px solid var(--dfx-primary);
	color: var(--dfx-primary);
	border-radius: 18px;
	padding: 7px 14px;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
	white-space: nowrap;
}
.dfx-chip:hover { background: var(--dfx-primary); color: #fff; }
.dfx-msg a { color: inherit; text-decoration: underline; }
.dfx-user {
	align-self: flex-start;
	background: var(--dfx-user);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.dfx-bot {
	align-self: flex-end;
	background: var(--dfx-bot);
	color: var(--dfx-text);
	border-bottom-left-radius: 4px;
}

.dfx-typing { display: flex; gap: 4px; align-items: center; padding: 4px 2px; }
.dfx-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: #b0b8c1; animation: dfx-blink 1.2s infinite both;
}
.dfx-typing span:nth-child(2) { animation-delay: .2s; }
.dfx-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dfx-blink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

#dyofix-bot-inputbar {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e6e8eb;
	background: #fff;
}
#dyofix-bot-input {
	flex: 1;
	border: 1px solid #d0d5da;
	border-radius: 20px;
	padding: 9px 14px;
	/* חייב 16px+ — אחרת iOS Safari מזמין אוטומטית כשנכנסים לשדה והזום נשאר אחרי סגירה */
	font-size: 16px;
	font-family: inherit;
	outline: none;
	resize: none;
}
#dyofix-bot-input:focus { border-color: var(--dfx-primary); }
#dyofix-bot-send {
	border: none;
	background: var(--dfx-primary);
	color: #fff;
	border-radius: 50%;
	width: 40px; height: 40px;
	cursor: pointer;
	font-size: 18px;
	flex-shrink: 0;
}
#dyofix-bot-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
	#dyofix-bot-panel {
		/* עוגן שמאל-עליון בלבד + רוחב/גובה לפי ה-VIEWPORT האמיתי (vw/vh),
		   לא לפי אחוזים/left+right שנמדדים מול תיבת-פריסה רחבה מדי כשיש גלישה אופקית
		   בעמוד (קרוסלת swiper עם שקופיות ב-left שלילי). dvw/dvh = ה-viewport הנראה. */
		top: 0; left: 0; right: auto; bottom: auto;
		width: 100vw;  width: 100dvw;
		max-width: 100vw;  max-width: 100dvw;
		height: 100vh; height: 100dvh;
		max-height: 100vh; max-height: 100dvh;
		border-radius: 0;
	}
	#dyofix-bot-messages { overflow-x: hidden; }
	#dyofix-bot-root .dfx-msg { max-width: 85%; }
}


/* שער הסכמה לפרטיות (privacy consent gate) */
#dyofix-bot-consent {
	display: flex;
	justify-content: center;
	margin: 4px 0 2px;
}
.dfx-consent-btn {
	background: var(--dfx-primary);
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 10px 30px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: opacity .15s ease;
}
.dfx-consent-btn:hover { opacity: .9; }
#dyofix-bot-input:disabled { background: #f2f4f6; color: #9aa2ab; cursor: not-allowed; }
