/* Mondo AI Chat – scoped under #mondo-chat, hardened against Flatsome form/button styles. */
#mondo-chat {
	--mc-accent: #1f6f43;
	--mc-bg: #efeae2;
	--mc-bot: #ffffff;
	--mc-user: #d9fdd3;
	--mc-text: #111b21;
	--mc-muted: #667781;
	--mc-border: #d1d7db;
	position: fixed;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000; /* above sticky add-to-cart bars, cookie banners and old chat buttons */
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--mc-text);
	-webkit-font-smoothing: antialiased;
}
#mondo-chat.mc-pos-right { right: 20px; }
#mondo-chat.mc-pos-left { left: 20px; }
#mondo-chat *, #mondo-chat *::before, #mondo-chat *::after { box-sizing: border-box; }
#mondo-chat button, #mondo-chat input, #mondo-chat textarea {
	font: inherit; letter-spacing: normal; text-transform: none; margin: 0; box-shadow: none; min-height: 0; height: auto; line-height: 1.4;
}
#mondo-chat button { cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
#mondo-chat button:focus-visible, #mondo-chat a:focus-visible, #mondo-chat input:focus-visible, #mondo-chat textarea:focus-visible {
	outline: 2px solid var(--mc-accent); outline-offset: 2px;
}
#mondo-chat svg { display: block; }

/* Launcher */
#mondo-chat .mc-launcher {
	width: 60px; height: 60px; border-radius: 50%;
	background: var(--mc-accent); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .15s ease;
}
#mondo-chat .mc-launcher svg { width: 28px; height: 28px; }
#mondo-chat .mc-launcher:hover { transform: scale(1.06); }
#mondo-chat.mc-pos-left .mc-launcher { margin-right: auto; }
#mondo-chat.mc-pos-right .mc-launcher { margin-left: auto; }

/* Panel */
#mondo-chat .mc-panel {
	position: absolute; bottom: 76px; width: 380px; height: min(620px, calc(100vh - 120px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--mc-bg); border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
#mondo-chat.mc-pos-right .mc-panel { right: 0; }
#mondo-chat.mc-pos-left .mc-panel { left: 0; }
#mondo-chat .mc-panel[hidden] { display: none; }

#mondo-chat .mc-header {
	display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px;
	background: var(--mc-accent); color: #fff;
}
#mondo-chat .mc-avatar {
	width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
	background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-weight: 700;
}
#mondo-chat .mc-avatar { overflow: hidden; }
#mondo-chat .mc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 50%; }
#mondo-chat .mc-avatar-sm { width: 32px; height: 32px; flex: 0 0 32px; font-size: 13px; background: var(--mc-accent); color: #fff; }
#mondo-chat .mc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#mondo-chat .mc-title strong { font-size: 16px; color: #fff; }
#mondo-chat .mc-title span { font-size: 12px; opacity: .85; }
#mondo-chat .mc-hbtn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
#mondo-chat .mc-hbtn:hover { background: rgba(255, 255, 255, .15); }
#mondo-chat .mc-hbtn.mc-confirm { width: auto; padding: 0 12px; border-radius: 18px; background: #fff; color: var(--mc-accent); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* Messages */
#mondo-chat .mc-log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
#mondo-chat .mc-row { display: flex; }
#mondo-chat .mc-user { justify-content: flex-end; }
#mondo-chat .mc-bubble {
	max-width: 85%; padding: 8px 11px; border-radius: 10px; word-wrap: break-word; overflow-wrap: anywhere;
	box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
}
#mondo-chat .mc-assistant .mc-bubble { background: var(--mc-bot); border-top-left-radius: 2px; }
#mondo-chat .mc-user .mc-bubble { background: var(--mc-user); border-top-right-radius: 2px; }
#mondo-chat .mc-info .mc-bubble { background: #fff8e1; }
#mondo-chat .mc-bubble a { color: var(--mc-accent); text-decoration: underline; font-weight: 600; }
#mondo-chat .mc-bubble strong { font-weight: 700; }

#mondo-chat .mc-typing { display: flex; gap: 4px; padding: 12px 14px; }
#mondo-chat .mc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mc-muted); animation: mc-dot 1.2s infinite ease-in-out; }
#mondo-chat .mc-typing i:nth-child(2) { animation-delay: .15s; }
#mondo-chat .mc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mc-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Quick replies */
#mondo-chat .mc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
#mondo-chat .mc-chip {
	background: #fff; border: 1px solid var(--mc-accent); color: var(--mc-accent);
	padding: 6px 12px; border-radius: 16px; font-size: 14px;
}
#mondo-chat .mc-chip:hover { background: var(--mc-accent); color: #fff; }

/* Link cards */
#mondo-chat .mc-cards { display: flex; flex-direction: column; gap: 6px; max-width: 85%; }
#mondo-chat .mc-card {
	display: flex; align-items: center; gap: 10px; padding: 6px; background: #fff; border-radius: 10px;
	text-decoration: none; color: var(--mc-text); box-shadow: 0 1px .5px rgba(0, 0, 0, .13); border: 1px solid transparent;
}
#mondo-chat .mc-card:hover { border-color: var(--mc-accent); }
#mondo-chat .mc-card img, #mondo-chat .mc-card-ph { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 8px; object-fit: cover; background: #e9edef; margin: 0; }
#mondo-chat .mc-card-body { display: flex; flex-direction: column; min-width: 0; }
#mondo-chat .mc-card-body strong { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#mondo-chat .mc-card-body span { font-size: 13px; color: var(--mc-accent); font-weight: 600; }

/* Composer */
#mondo-chat .mc-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; background: #f0f2f5; }
#mondo-chat .mc-composer textarea {
	flex: 1; resize: none; border: 0; border-radius: 20px; padding: 10px 14px; background: #fff; color: var(--mc-text);
	max-height: 120px; font-size: 15px; width: auto;
}
#mondo-chat .mc-send { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--mc-accent); color: #fff; display: flex; align-items: center; justify-content: center; }
#mondo-chat .mc-send:disabled { opacity: .5; cursor: default; }
#mondo-chat .mc-foot { font-size: 11px; color: var(--mc-muted); text-align: center; padding: 0 10px 8px; background: #f0f2f5; }

/* Contact form */
#mondo-chat .mc-form-wrap { width: 100%; max-width: 100%; }
#mondo-chat .mc-form { display: flex; flex-direction: column; gap: 8px; }
#mondo-chat .mc-form-title { font-size: 15px; }
#mondo-chat .mc-form-intro { margin: -4px 0 0; font-size: 13px; color: var(--mc-muted); }
#mondo-chat .mc-field { display: flex; flex-direction: column; gap: 3px; }
#mondo-chat .mc-field label { font-size: 12px; color: var(--mc-muted); font-weight: 600; margin: 0; }
#mondo-chat .mc-field input, #mondo-chat .mc-field textarea {
	width: 100%; border: 1px solid var(--mc-border); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--mc-text); font-size: 15px; max-width: none;
}
#mondo-chat .mc-field textarea { resize: vertical; min-height: 84px; }
#mondo-chat .mc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#mondo-chat .mc-upload {
	position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px dashed var(--mc-accent); border-radius: 8px;
	color: var(--mc-accent); font-size: 14px; font-weight: 600; margin: 0; overflow: hidden;
}
#mondo-chat .mc-upload-face { display: flex; align-items: center; gap: 8px; pointer-events: none; }
#mondo-chat .mc-upload:focus-within { outline: 2px solid var(--mc-accent); outline-offset: 2px; }
#mondo-chat .mc-upload .mc-file {
	position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; padding: 0;
	opacity: 0; cursor: pointer; font-size: 40px; /* large font = whole area clickable in old browsers */ border: 0; max-width: none; box-shadow: none;
}
#mondo-chat .mc-previews { display: flex; gap: 6px; flex-wrap: wrap; }
#mondo-chat .mc-thumb { position: relative; width: 64px; height: 64px; }
#mondo-chat .mc-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; margin: 0; }
#mondo-chat .mc-thumb button {
	position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
	background: #111b21; color: #fff; font-size: 15px; line-height: 22px; text-align: center;
}
#mondo-chat .mc-form-status { font-size: 13px; color: #b3261e; min-height: 0; }
#mondo-chat .mc-form-status:empty { display: none; }
#mondo-chat .mc-submit { background: var(--mc-accent); color: #fff; border-radius: 8px; padding: 10px; font-weight: 700; text-align: center; }
#mondo-chat .mc-submit:disabled { opacity: .6; cursor: default; }

/* Feedback */
#mondo-chat .mc-fb { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mc-muted); margin: -2px 0 4px 4px; }
#mondo-chat .mc-fb button { font-size: 15px; padding: 2px 6px; border-radius: 12px; opacity: .75; }
#mondo-chat .mc-fb button:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
#mondo-chat .mc-fb-done { font-style: italic; }

/* Teaser */
#mondo-chat .mc-teaser {
	position: absolute; bottom: 72px; width: 250px; display: flex; align-items: flex-start; gap: 4px;
	background: #fff; color: var(--mc-text); border-radius: 12px; padding: 10px 8px 10px 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18); animation: mc-pop .25s ease-out;
}
#mondo-chat.mc-pos-right .mc-teaser { right: 0; }
#mondo-chat.mc-pos-left .mc-teaser { left: 0; }
#mondo-chat .mc-teaser-text { flex: 1; text-align: left; font-size: 14px; line-height: 1.4; }
#mondo-chat .mc-teaser-close { font-size: 18px; line-height: 1; color: var(--mc-muted); padding: 0 4px; }
@keyframes mc-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mobile: full screen panel */
@media (max-width: 480px) {
	#mondo-chat { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	#mondo-chat.mc-pos-right { right: 14px; }
	#mondo-chat.mc-pos-left { left: 14px; }
	#mondo-chat .mc-panel { position: fixed; inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; bottom: auto; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--mc-bg); }
	#mondo-chat .mc-teaser { width: min(250px, calc(100vw - 28px)); }
	#mondo-chat.mc-open .mc-launcher { display: none; }
	#mondo-chat .mc-composer textarea, #mondo-chat .mc-field input, #mondo-chat .mc-field textarea { font-size: 16px; } /* prevents iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
	#mondo-chat .mc-launcher, #mondo-chat .mc-typing i, #mondo-chat .mc-teaser { transition: none; animation: none; }
}
@media print { #mondo-chat { display: none; } }
