/* Chat assistant (includes/chat.php). Uses the theme tokens, with fallbacks. */
.rs-chat-launch {
	position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70;
	display: inline-flex; align-items: center; gap: .5rem; min-height: 52px; padding: 0 1.1rem 0 .9rem;
	border: 2px solid #fff; border-radius: 999px; background: var(--rs-teal, #028c83); color: #fff;
	font: 600 .95rem/1 var(--rs-head, system-ui, sans-serif); cursor: pointer;
	box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .55), 0 0 0 4px rgba(2, 140, 131, .18); transition: transform .3s var(--rs-ease, ease), bottom .35s var(--rs-ease, ease);
}
.rs-chat-launch:hover { transform: translateY(-2px); }
.rs-chat-launch:focus-visible { outline: 3px solid var(--rs-teal-hi, #3dbfb4); outline-offset: 3px; }
.rs-chat-launch svg { width: 22px; height: 22px; flex: none; }
/* Above the mobile sticky CTA bar when it is shown. */
body:has(.rs-sticky.is-visible) .rs-chat-launch { bottom: calc(84px + env(safe-area-inset-bottom)); }
/* Left of the floating side-cart basket (60px at right: 1px), never on top of it. */
body:has(.xoo-wsc-basket) .rs-chat-launch { right: calc(76px + env(safe-area-inset-right)); }
.rs-chat-launch__short { display: none; }
@media (max-width: 640px) {
	.rs-chat-launch { min-height: 56px; padding: 0 1.15rem 0 1rem; font-size: 1.05rem; }
	.rs-chat-launch svg { width: 24px; height: 24px; }
	.rs-chat-launch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.rs-chat-launch__short { display: inline; }
}
.rs-chat-open .rs-chat-launch { display: none; }
/* The side-cart basket sits above everything (z-index 9999997) and would cover the send button. */
.rs-chat-open .xoo-wsc-basket { display: none !important; }
/* Belt and braces: the open chat sits above the side cart (z-index 9999997) even if the basket stays. */
.rs-chat-open .rs-chat { z-index: 10000000; }
.rs-chat-open .xoo-wsc-modal, .rs-chat-open .xoo-wsc-container { visibility: hidden; }

.rs-chat {
	position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80;
	width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 32px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--rs-surface, #15191c); color: var(--rs-text, #f2f4f5);
	border: 1px solid var(--rs-line, #2a3034); border-radius: var(--rs-r, 20px); box-shadow: var(--rs-shadow, 0 30px 80px -30px rgba(0, 0, 0, .65));
	font: 400 .95rem/1.5 var(--rs-body, system-ui, sans-serif);
}
.rs-chat[hidden] { display: none; }
@media (max-width: 640px) {
	.rs-chat { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
	.rs-chat-open { overflow: hidden; }
}

.rs-chat__head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--rs-line, #2a3034); background: var(--rs-surface-2, #1c2125); }
.rs-chat__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--rs-teal, #028c83); color: #fff; font: 700 .9rem/1 var(--rs-head, system-ui); flex: none; }
.rs-chat__title { margin: 0; font: 700 1rem/1.2 var(--rs-head, system-ui); }
.rs-chat__sub { margin: .1rem 0 0; font-size: .78rem; color: var(--rs-muted, #a9b1b6); }
.rs-chat__close { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.rs-chat__close:hover, .rs-chat__close:focus-visible { background: rgba(255, 255, 255, .08); }

.rs-chat__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; overscroll-behavior: contain; }
.rs-chat__msg { max-width: 86%; padding: .6rem .85rem; border-radius: 16px; word-wrap: break-word; }
.rs-chat__msg p { margin: 0 0 .5em; }
.rs-chat__msg p:last-child, .rs-chat__msg ul:last-child { margin-bottom: 0; }
.rs-chat__msg ul { margin: 0 0 .5em; padding-left: 1.1em; }
.rs-chat__msg a { color: var(--rs-orange-hi, #ff9a1f); text-decoration: underline; text-underline-offset: 2px; }
.rs-chat__msg--bot { align-self: flex-start; background: var(--rs-surface-2, #1c2125); border-bottom-left-radius: 4px; }
.rs-chat__msg--me { align-self: flex-end; background: var(--rs-teal-deep, #016a63); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.rs-chat__msg--err { border: 1px solid rgba(196, 56, 44, .5); }
.rs-chat__typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .8rem .9rem; background: var(--rs-surface-2, #1c2125); border-radius: 16px; }
.rs-chat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--rs-muted, #a9b1b6); animation: rs-chat-dot 1s infinite ease-in-out; }
.rs-chat__typing span:nth-child(2) { animation-delay: .15s; }
.rs-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rs-chat-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .rs-chat__typing span { animation: none; } .rs-chat-launch { transition: none; } }

.rs-chat__chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.rs-chat__chip { border: 1px solid var(--rs-line, #2a3034); background: transparent; color: var(--rs-text, #f2f4f5); border-radius: 999px; padding: .4rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; }
.rs-chat__chip:hover, .rs-chat__chip:focus-visible { border-color: var(--rs-orange, #ee8600); color: var(--rs-orange-hi, #ff9a1f); }

.rs-chat__form { display: flex; gap: .5rem; align-items: flex-end; padding: .7rem 1rem .4rem; border-top: 1px solid var(--rs-line, #2a3034); }
.rs-chat__input { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: .6rem .8rem; border: 1px solid var(--rs-line, #2a3034); border-radius: 14px; background: var(--rs-bg, #0e1113); color: inherit; font: inherit; font-size: 16px; }
.rs-chat__input:focus { outline: none; border-color: var(--rs-teal-hi, #3dbfb4); }
.rs-chat__send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--rs-orange, #ee8600); color: #111; cursor: pointer; display: grid; place-items: center; }
.rs-chat__send:disabled { opacity: .45; cursor: default; }
.rs-chat__send svg { width: 20px; height: 20px; }
.rs-chat__note { margin: 0; padding: 0 1rem .7rem; font-size: .72rem; line-height: 1.4; color: var(--rs-muted, #a9b1b6); }
.rs-chat__note a { color: inherit; text-decoration: underline; }

/* V2: menu chip, compact chip row on phones, product cards. */
.rs-chat__chip--menu { border-style: dashed; opacity: .85; }
@media (max-width: 640px) {
	.rs-chat__chip { font-size: .9rem; padding: .5rem .8rem; }
}
.rs-chat__cards { display: flex; flex-direction: column; gap: .5rem; align-self: stretch; }
.rs-chat__card { display: flex; gap: .7rem; padding: .6rem; border: 1px solid var(--rs-line, #2a3034); border-radius: 14px; background: var(--rs-surface-2, #1c2125); }
.rs-chat__card img { width: 84px; height: 64px; object-fit: contain; border-radius: 10px; flex: none; background: #fff; align-self: center; }
.rs-chat__card-body { min-width: 0; flex: 1; }
.rs-chat__card-name { margin: 0 0 .15rem; font-weight: 700; font-size: .92rem; line-height: 1.25; }
.rs-chat__card-price { margin: 0 0 .3rem; font-weight: 700; color: var(--rs-orange-hi, #ff9a1f); font-size: .92rem; }
.rs-chat__card-price s { color: var(--rs-muted, #9aa3a8); font-weight: 400; margin-left: .25rem; }
.rs-chat__card-out { color: var(--rs-muted, #9aa3a8); font-weight: 400; }
.rs-chat__card-pts { margin: 0 0 .4rem; padding-left: 1rem; font-size: .82rem; line-height: 1.35; }
.rs-chat__card-actions { display: flex; flex-wrap: nowrap; gap: .4rem; }
.rs-chat__card-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 .7rem; white-space: nowrap; border-radius: 999px; border: 1px solid var(--rs-line, #2a3034); color: inherit; text-decoration: none; font-size: .85rem; font-weight: 600; }
.rs-chat__card-btn--cart { background: var(--rs-orange, #ee8600); border-color: transparent; color: #111; }
.rs-chat__card-btn:focus-visible { outline: 2px solid var(--rs-teal-hi, #3dbfb4); outline-offset: 2px; }
.rs-chat__card-btn.is-added { background: var(--rs-teal, #028c83); color: #fff; }
.rs-chat__chip--go { background: var(--rs-orange, #ee8600); border-color: transparent; color: #111; font-weight: 700; }
