/* Shukrani Assistant — widget flottant. Mobile-first. */

#ska-root {
	position: fixed;
	bottom: 18px;
	z-index: 9990;
	--ska-p: #F28C28;
	--ska-s: #142B4A;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
#ska-root.ska-pos-right { right: 18px; }
#ska-root.ska-pos-left  { left: 18px; }

/* ---------- bouton bulle ---------- */

#ska-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	background: var(--ska-s);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0,0,0,.28);
	transition: transform .18s, background .18s;
}
#ska-toggle:hover { transform: scale(1.07); background: var(--ska-p); color: var(--ska-s); }

/* ---------- fenêtre ---------- */

#ska-win {
	position: absolute;
	bottom: 68px;
	right: 0;
	width: min(360px, calc(100vw - 36px));
	height: min(520px, calc(100vh - 110px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(15,32,56,.30);
	overflow: hidden;
	opacity: 0;
	transform: translateY(10px) scale(.98);
	pointer-events: none;
}
#ska-root.ska-pos-left #ska-win { left: 0; right: auto; }
#ska-win.ska-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
	transition: opacity .18s ease-out, transform .18s ease-out;
}

/* en-tête */

.ska-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--ska-s);
	color: #fff;
}
.ska-head__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ska-p);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}
.ska-head__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ska-head__avatar:empty::before { content: "🤖"; font-size: 18px; }
.ska-head__txt { flex: 1; min-width: 0; }
.ska-head__txt strong { display: block; font-size: .95rem; line-height: 1.2; }
.ska-head__txt em {
	font-style: normal;
	font-size: .75rem;
	color: rgba(255,255,255,.82);
	display: flex;
	align-items: center;
	gap: 5px;
}
.ska-dot {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #2ecc71;
	display: inline-block;
}
#ska-close {
	background: none;
	border: 0;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

/* ---------- corps ---------- */

.ska-body {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #F4F7FB;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ska-msg { display: flex; }
.ska-msg--me { justify-content: flex-end; }
.ska-bubble {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: .9rem;
	line-height: 1.45;
	word-wrap: break-word;
}
.ska-msg--bot .ska-bubble {
	background: #fff;
	color: #263449;
	border: 1px solid #E9EEF5;
	border-top-left-radius: 4px;
}
.ska-msg--me .ska-bubble {
	background: var(--ska-s);
	color: #fff;
	border-top-right-radius: 4px;
}
.ska-bubble p { margin: 0 0 .5em; }
.ska-bubble p:last-child { margin-bottom: 0; }
.ska-bubble a { color: var(--ska-p); font-weight: 700; }

/* boutons rapides */

.ska-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}
.ska-quick__btn {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1.5px solid var(--ska-p);
	background: #fff;
	color: var(--ska-s);
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.ska-quick__btn:hover { background: var(--ska-p); color: var(--ska-s); }

/* cartes (services / produits) */

.ska-cards {
	display: grid;
	gap: 8px;
}
.ska-card {
	background: #fff;
	border: 1px solid #E9EEF5;
	border-radius: 10px;
	overflow: hidden;
}
.ska-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.ska-card__t { display: block; padding: 8px 10px 0; font-size: .9rem; color: #142B4A; }
.ska-card__p {
	display: block;
	padding: 2px 10px 0;
	color: var(--ska-p);
	font-weight: 800;
	font-size: .9rem;
}
.ska-card__s { padding: 4px 10px 8px; margin: 0; font-size: .8rem; color: #5A6B7E; }
.ska-card__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 10px 10px;
}
.ska-card__btn {
	padding: 5px 10px;
	border-radius: 7px;
	border: 1px solid var(--ska-s);
	background: var(--ska-s);
	color: #fff;
	font-size: .78rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.ska-card__btn:nth-child(n+2) { background: #fff; color: var(--ska-s); }
.ska-card__btn:hover { background: var(--ska-p); border-color: var(--ska-p); color: var(--ska-s); }

/* indicateur de frappe */

.ska-typing i {
	display: inline-block;
	width: 6px; height: 6px;
	margin: 0 1px;
	border-radius: 50%;
	background: #9fb2c6;
	animation: ska-blink 1.2s infinite;
}
.ska-typing i:nth-child(2) { animation-delay: .2s; }
.ska-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ska-blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------- pied ---------- */

.ska-foot {
	display: flex;
	gap: 8px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #E9EEF5;
}
#ska-input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid #cdd7e2;
	border-radius: 999px;
	font-size: .9rem;
}
#ska-input:focus { outline: none; border-color: var(--ska-p); }
#ska-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: var(--ska-p);
	color: var(--ska-s);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
#ska-send:hover { filter: brightness(.95); }

/* ---------- mobile ---------- */

@media (max-width: 480px) {
	#ska-root { bottom: 12px; }
	#ska-root.ska-pos-right { right: 12px; }
	#ska-root.ska-pos-left  { left: 12px; }
	#ska-win {
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		height: 78vh;
		border-radius: 16px 16px 0 0;
		bottom: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	#ska-win.ska-open, #ska-toggle, .ska-typing i { transition: none; animation: none; }
}
