/* Titrit chat window — Amber Amazigh colours. */
.tt-root {
	--tt-night: #24140a;
	--tt-ink: #2b1a0c;
	--tt-muted: #6b5440;
	--tt-bronze: #8a5414;
	--tt-gold: #c9974a;
	--tt-amber: #d9690b;
	--tt-line: #dccbb0;
	--tt-parchment: #f3e9d8;
	--tt-linen: #fbf7f0;
	--tt-sans: Jost, "Helvetica Neue", Arial, sans-serif;
	--tt-serif: "Cormorant Garamond", "Times New Roman", serif;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: var(--tt-sans);
	color: var(--tt-ink);
}
.tt-root--right { right: 20px; }
.tt-root--left { left: 20px; }
.tt-root--stack { bottom: 92px; }

.tt-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 58px;
	padding: 5px 18px 5px 5px;
	border: 1px solid rgba(201, 151, 74, .55);
	border-radius: 999px;
	background: var(--tt-night);
	color: var(--tt-parchment);
	font: 500 14px/1 var(--tt-sans);
	letter-spacing: .02em;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(36, 20, 10, .28);
	transition: transform .2s ease, box-shadow .2s ease;
}
.tt-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(36, 20, 10, .32); }
.tt-launcher:focus-visible { outline: 3px solid var(--tt-amber); outline-offset: 3px; }
.tt-launcher img { width: 48px; height: 48px; border-radius: 50%; display: block; }
.tt-root.is-open .tt-launcher { display: none; }

.tt-panel {
	position: absolute;
	bottom: 0;
	width: 380px;
	height: min(620px, calc(100vh - 40px));
	display: flex;
	flex-direction: column;
	background: var(--tt-linen);
	border: 1px solid var(--tt-line);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(36, 20, 10, .28);
	overflow: hidden;
	animation: tt-in .22s ease;
}
.tt-root--right .tt-panel { right: 0; }
.tt-root--left .tt-panel { left: 0; }
.tt-root--stack .tt-panel { bottom: -72px; }
.tt-panel[hidden] { display: none; }
@keyframes tt-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tt-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 10px 12px 14px;
	background: var(--tt-night);
	color: var(--tt-parchment);
}
.tt-head__avatar { width: 40px; height: 40px; border-radius: 50%; }
.tt-head__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-head__name { font: 500 22px/1.1 var(--tt-serif); letter-spacing: .02em; }
.tt-head__sub { font-size: 12px; color: #d9c9ae; }
.tt-icon {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--tt-parchment);
	cursor: pointer;
}
.tt-icon:hover { background: rgba(243, 233, 216, .1); }
.tt-icon:focus-visible { outline: 2px solid var(--tt-gold); }

.tt-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px 8px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}
.tt-msg { display: flex; gap: 8px; max-width: 100%; }
.tt-msg.is-new { animation: tt-in .2s ease; }
.tt-msg--user { justify-content: flex-end; }
.tt-msg__avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; margin-top: 2px; }
.tt-msg__col { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: calc(100% - 36px); }
.tt-bubble {
	padding: 10px 13px;
	border-radius: 4px 14px 14px 14px;
	background: #fff;
	border: 1px solid #ecdfca;
	font-size: 14.5px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.tt-bubble a { color: var(--tt-bronze); text-decoration: underline; }
.tt-msg--user .tt-bubble {
	background: var(--tt-night);
	border-color: var(--tt-night);
	color: var(--tt-parchment);
	border-radius: 14px 4px 14px 14px;
	max-width: 82%;
	white-space: pre-wrap;
}

.tt-cards { display: flex; flex-direction: column; gap: 8px; }
.tt-cards--products { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--tt-gold) transparent; }
.tt-cards--products::-webkit-scrollbar { height: 6px; }
.tt-cards--products::-webkit-scrollbar-thumb { background: var(--tt-gold); border-radius: 3px; }
.tt-cards-wrap { position: relative; }
.tt-scroll {
	position: absolute;
	top: 38%;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 1px solid var(--tt-line);
	border-radius: 50%;
	background: rgba(255, 255, 255, .95);
	color: var(--tt-ink);
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(36, 20, 10, .15);
	z-index: 1;
}
.tt-scroll--prev { left: -6px; }
.tt-scroll--next { right: -6px; }
.tt-scroll[hidden] { display: none; }
.tt-scroll:focus-visible { outline: 2px solid var(--tt-amber); }
@media (hover: none) { .tt-scroll { display: none; } }
.tt-card {
	display: flex;
	gap: 10px;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid #ecdfca;
	border-radius: 8px;
	overflow: hidden;
}
.tt-card:hover { border-color: var(--tt-gold); }
.tt-card:focus-visible { outline: 2px solid var(--tt-amber); }
.tt-card--product { flex: 0 0 148px; flex-direction: column; gap: 0; scroll-snap-align: start; }
.tt-card--product img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--tt-parchment); }
.tt-card__body { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; }
.tt-card__name { font: 500 16px/1.15 var(--tt-serif); }
.tt-card__price { font-size: 13.5px; font-weight: 500; }
.tt-card__price s { color: var(--tt-muted); font-weight: 400; margin-left: 4px; }
.tt-card__stock { font-size: 12px; color: #55642f; }
.tt-card__stock.is-out { color: #7a2416; }
.tt-card--order { flex-direction: column; gap: 4px; padding: 10px 12px; }
.tt-order__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.tt-order__meta, .tt-order__items { font-size: 12.5px; color: var(--tt-muted); }
.tt-status {
	font-size: 11.5px;
	font-weight: 500;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(107, 84, 64, .1);
	color: var(--tt-muted);
	white-space: nowrap;
}
.tt-status--processing { background: rgba(217, 105, 11, .12); color: #a24d06; }
.tt-status--completed { background: rgba(85, 100, 47, .12); color: #55642f; }
.tt-status--cancelled, .tt-status--failed { background: rgba(122, 36, 22, .1); color: #7a2416; }
.tt-status--on-hold { background: rgba(138, 84, 20, .12); color: var(--tt-bronze); }

.tt-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tt-kpi { background: #fff; border: 1px solid #ecdfca; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; }
.tt-kpi__label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--tt-muted); }
.tt-kpi__value { font: 500 20px/1.2 var(--tt-serif); font-variant-numeric: lining-nums; }

.tt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-action {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--tt-ink);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	color: var(--tt-ink);
}
.tt-action--whatsapp { background: #1e8e4f; border-color: #1e8e4f; color: #fff; }
.tt-action:hover { opacity: .88; }

.tt-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 10px; max-height: 92px; overflow-y: auto; }
.tt-quick:empty { display: none; }
.tt-chip {
	flex: none;
	min-height: 36px;
	padding: 6px 13px;
	border: 1px solid var(--tt-line);
	border-radius: 999px;
	background: #fff;
	color: var(--tt-ink);
	font: 500 13px/1 var(--tt-sans);
	cursor: pointer;
}
.tt-chip:hover { border-color: var(--tt-bronze); color: var(--tt-bronze); }
.tt-chip:focus-visible { outline: 2px solid var(--tt-amber); }

.tt-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #ecdfca; background: #fff; }
.tt-input {
	flex: 1;
	resize: none;
	min-height: 42px;
	max-height: 110px;
	padding: 10px 12px;
	border: 1px solid var(--tt-line);
	border-radius: 10px;
	background: var(--tt-linen);
	font: 15px/1.4 var(--tt-sans);
	color: var(--tt-ink);
}
.tt-input:focus { outline: none; border-color: var(--tt-bronze); box-shadow: 0 0 0 2px rgba(138, 84, 20, .15); }
.tt-send {
	width: 44px;
	height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--tt-night);
	color: var(--tt-gold);
	cursor: pointer;
}
.tt-send:focus-visible { outline: 3px solid var(--tt-amber); outline-offset: 2px; }
.tt-foot { padding: 0 14px 8px; background: #fff; font-size: 11px; color: var(--tt-muted); text-align: center; }
.tt-foot:empty { display: none; }

.tt-typing .tt-dots { display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid #ecdfca; border-radius: 4px 14px 14px 14px; margin-left: 36px; }
.tt-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tt-gold); animation: tt-dot 1s infinite ease-in-out; }
.tt-dots i:nth-child(2) { animation-delay: .15s; }
.tt-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tt-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 600px) {
	.tt-root { bottom: 16px; }
	.tt-root--right { right: 16px; }
	.tt-root--left { left: 16px; }
	.tt-root--stack { bottom: 84px; }
	.tt-launcher { height: 56px; padding: 4px; }
	.tt-launcher__label { display: none; }
	.tt-root.is-open { inset: 0; }
	.tt-panel, .tt-root--stack .tt-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.tt-panel, .tt-msg.is-new { animation: none; }
	.tt-dots i { animation: none; opacity: .7; }
	.tt-launcher { transition: none; }
}

/* The theme styles every textarea: keep the chat field compact. */
.tt-root .tt-form textarea.tt-input {
	box-sizing: border-box;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 11px 12px;
	line-height: 1.4;
	box-shadow: none;
	overflow-y: hidden;
	scrollbar-width: thin;
}
