/* AI Website Assistant — widget styles. Everything is scoped under .asa-root. */

.asa-root {
	--asa-brand: #1f5f8b;
	--asa-ink: #1c2329;
	--asa-muted: #5f6b75;
	--asa-line: #e3e7ea;
	--asa-surface: #ffffff;
	--asa-wash: #f5f7f8;
	--asa-tint: color-mix(in srgb, var(--asa-brand) 10%, #ffffff);
	--asa-radius: 14px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--asa-ink);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.asa-root *, .asa-root *::before, .asa-root *::after { box-sizing: border-box; }
.asa-root [hidden] { display: none !important; }
.asa-root p { margin: 0; padding: 0; }
.asa-root button {
	font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
	cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; line-height: 1;
}
.asa-root button:focus-visible, .asa-root a:focus-visible, .asa-root textarea:focus-visible {
	outline: 2px solid var(--asa-brand); outline-offset: 2px;
}
.asa-root svg { display: block; width: 100%; height: 100%; }
.asa-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Open/closed state for the floating panel. !important so theme or plugin
   scripts that set inline display:none cannot hide an open panel. */
.asa-root.asa-floating .asa-panel { display: none !important; }
.asa-root.asa-floating.asa-open .asa-panel { display: flex !important; visibility: visible !important; opacity: 1 !important; }
.asa-root.asa-inline .asa-panel { display: flex !important; }

/* ---------- Floating launcher ---------- */
.asa-floating { position: fixed; bottom: 20px; z-index: 999990; }
.asa-floating.asa-pos-right { right: 20px; }
.asa-floating.asa-pos-left { left: 20px; }

.asa-root .asa-launcher {
	width: 58px; height: 58px; border-radius: 50%;
	background: var(--asa-brand); color: #fff;
	display: grid; place-items: center;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--asa-brand) 35%, transparent), 0 2px 4px rgba(0,0,0,.12);
	transition: transform .18s ease;
}
.asa-root .asa-launcher:hover { transform: scale(1.05); }
.asa-launcher svg { width: 26px; height: 26px; grid-area: 1 / 1; transition: opacity .15s, transform .2s; }
.asa-launcher .asa-icon-close { opacity: 0; transform: rotate(-45deg); }
.asa-open .asa-launcher .asa-icon-chat { opacity: 0; transform: rotate(45deg); }
.asa-open .asa-launcher .asa-icon-close { opacity: 1; transform: none; }

/* ---------- Panel ---------- */
.asa-panel {
	display: flex; flex-direction: column;
	background: var(--asa-surface);
	border: 1px solid var(--asa-line);
	border-radius: var(--asa-radius);
	overflow: hidden;
}
.asa-floating .asa-panel {
	position: absolute; bottom: 74px;
	width: 384px; height: min(620px, calc(100vh - 110px));
	box-shadow: 0 18px 50px rgba(20, 30, 40, .18), 0 2px 6px rgba(20, 30, 40, .08);
	transform-origin: bottom right;
	animation: asa-pop .18s ease-out;
}
.asa-floating.asa-pos-right .asa-panel { right: 0; }
.asa-floating.asa-pos-left .asa-panel { left: 0; transform-origin: bottom left; }
.asa-inline .asa-panel { height: 560px; max-width: 760px; margin: 1.5em 0; }
@keyframes asa-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.asa-header {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 10px 12px 14px;
	border-bottom: 1px solid var(--asa-line);
}
.asa-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--asa-tint); color: var(--asa-brand); padding: 6px; flex: none; }
.asa-heading { flex: 1; min-width: 0; }
.asa-root .asa-name { font-weight: 650; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asa-root .asa-sub { font-size: 12.5px; color: var(--asa-muted); line-height: 1.3; }
.asa-root .asa-icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--asa-muted); flex: none; }
.asa-root .asa-icon-btn:hover { background: var(--asa-wash); color: var(--asa-ink); }
.asa-icon-btn svg { width: 20px; height: 20px; }

/* ---------- Messages ---------- */
.asa-messages {
	flex: 1; overflow-y: auto; overscroll-behavior: contain;
	padding: 16px 14px 8px;
	display: flex; flex-direction: column; gap: 12px;
	scroll-behavior: smooth;
}
.asa-msg { max-width: 92%; word-wrap: break-word; overflow-wrap: anywhere; }
.asa-msg-user {
	align-self: flex-end;
	background: var(--asa-brand); color: #fff;
	padding: 9px 13px; border-radius: 16px 16px 4px 16px;
	white-space: pre-wrap;
}
.asa-msg-assistant { align-self: flex-start; padding-left: 12px; border-left: 2px solid var(--asa-brand); }
.asa-msg-assistant .asa-text a { color: var(--asa-brand); text-decoration: underline; text-underline-offset: 2px; }
.asa-msg-assistant .asa-text ul { margin: 6px 0; padding-left: 18px; }
.asa-msg-assistant .asa-text li { margin: 2px 0; }
.asa-msg-assistant .asa-text p + p { margin-top: 8px; }
.asa-msg-voice::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; margin-right: 6px; vertical-align: middle; }
.asa-msg-pending { color: var(--asa-muted); font-style: italic; }
.asa-msg-notice { align-self: center; font-size: 13px; color: var(--asa-muted); text-align: center; max-width: 100%; }
.asa-msg-error { align-self: stretch; font-size: 13.5px; color: #8a2a1f; background: #fbeeec; padding: 8px 12px; border-radius: 10px; max-width: 100%; }

.asa-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.asa-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--asa-muted); animation: asa-blink 1.2s infinite ease-in-out; }
.asa-typing i:nth-child(2) { animation-delay: .15s; }
.asa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes asa-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Product cards: a horizontal strip under the reply */
.asa-products {
	display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 6px; margin-top: 6px;
	scroll-snap-type: x mandatory;
}
.asa-root .asa-card {
	flex: 0 0 150px; scroll-snap-align: start;
	display: flex; flex-direction: column;
	border: 1px solid var(--asa-line); border-radius: 12px; overflow: hidden;
	background: var(--asa-surface); color: var(--asa-ink); text-decoration: none;
	transition: border-color .15s;
}
.asa-root .asa-card:hover { border-color: var(--asa-brand); }
.asa-card-img { aspect-ratio: 1 / 1; background: var(--asa-wash); }
.asa-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border: 0; border-radius: 0; }
.asa-card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.asa-card-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asa-card-price { font-size: 13.5px; color: var(--asa-brand); font-weight: 650; }
.asa-card-stock { font-size: 12px; color: var(--asa-muted); }
.asa-card-stock.asa-oos { color: #8a2a1f; }

.asa-sources { margin-top: 8px; font-size: 12.5px; color: var(--asa-muted); }
.asa-sources a { color: var(--asa-muted); text-decoration: underline; text-underline-offset: 2px; }
.asa-sources a:hover { color: var(--asa-brand); }

/* ---------- Voice bar ---------- */
.asa-voicebar {
	display: flex; align-items: center; gap: 10px;
	margin: 0 12px 8px; padding: 8px 8px 8px 12px;
	background: var(--asa-tint); border-radius: 12px; color: var(--asa-ink); font-size: 13.5px;
}
.asa-voice-status { flex: 1; }
.asa-root .asa-voice-end { background: #fff; color: #8a2a1f; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.asa-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.asa-wave i { width: 3px; height: 6px; border-radius: 2px; background: var(--asa-brand); }
.asa-voice-live .asa-wave i { animation: asa-wave 1s infinite ease-in-out; }
.asa-wave i:nth-child(2) { animation-delay: .12s; }
.asa-wave i:nth-child(3) { animation-delay: .24s; }
.asa-wave i:nth-child(4) { animation-delay: .36s; }
@keyframes asa-wave { 0%, 100% { height: 5px; } 50% { height: 17px; } }

/* ---------- Composer ---------- */
.asa-composer {
	display: flex; align-items: flex-end; gap: 6px;
	margin: 0 12px; padding: 6px 6px 6px 12px;
	border: 1px solid var(--asa-line); border-radius: 14px; background: var(--asa-surface);
}
.asa-composer:focus-within { border-color: var(--asa-brand); }
.asa-root .asa-input {
	flex: 1; min-width: 0; resize: none; border: 0 !important; outline: 0; box-shadow: none !important;
	background: transparent; color: var(--asa-ink);
	font: inherit; font-size: 15px; line-height: 1.45;
	padding: 7px 0; margin: 0; max-height: 120px; min-height: 0; height: auto; width: auto;
}
.asa-root .asa-input:focus-visible { outline: 0; }
.asa-root .asa-send {
	width: 36px; height: 36px; border-radius: 10px; flex: none;
	background: var(--asa-brand); color: #fff; display: grid; place-items: center;
}
.asa-send svg { width: 18px; height: 18px; }
.asa-root .asa-send:disabled { opacity: .35; cursor: default; }
.asa-root .asa-mic[aria-pressed="true"] { background: var(--asa-brand); color: #fff; }
.asa-root .asa-foot { font-size: 11.5px; color: var(--asa-muted); text-align: center; padding: 6px 14px 10px; line-height: 1.35; }

/* ---------- Small screens: full-screen sheet ---------- */
@media (max-width: 520px) {
	.asa-floating { bottom: 14px; }
	.asa-floating.asa-pos-right { right: 14px; }
	.asa-floating.asa-pos-left { left: 14px; }
	.asa-floating .asa-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
		border-radius: 0; border: 0; bottom: auto;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}
	.asa-floating.asa-open .asa-launcher { display: none; }
	.asa-root .asa-input { font-size: 16px; } /* stops iOS zooming on focus */
}

@media (prefers-reduced-motion: reduce) {
	.asa-root *, .asa-root *::before, .asa-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@supports not (color: color-mix(in srgb, red 10%, white)) {
	.asa-root { --asa-tint: #eef3f6; }
	.asa-root .asa-launcher { box-shadow: 0 6px 20px rgba(0,0,0,.2); }
}

/* ---------- Message list & email card ---------- */
.asa-list { display: flex; flex-direction: column; gap: 12px; }
.asa-lead {
	margin-top: 4px; padding: 12px 12px 10px; border: 1px solid var(--asa-line);
	border-radius: 12px; background: var(--asa-wash);
}
.asa-root .asa-lead-title { font-weight: 650; font-size: 14.5px; }
.asa-root .asa-lead-text { font-size: 13.5px; color: var(--asa-muted); margin-top: 2px; }
.asa-lead form { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; padding: 0; border: 0; }
.asa-root .asa-lead input[type="text"], .asa-root .asa-lead input[type="email"] {
	width: 100%; margin: 0; padding: 9px 11px; height: auto; min-height: 0;
	font: inherit; font-size: 14.5px; color: var(--asa-ink); background: var(--asa-surface);
	border: 1px solid var(--asa-line); border-radius: 9px; box-shadow: none; outline: 0;
}
.asa-root .asa-lead input:focus { border-color: var(--asa-brand); }
.asa-root .asa-lead-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--asa-muted); cursor: pointer; margin: 0; }
.asa-root .asa-lead-consent input { margin: 2px 0 0; flex: none; width: 15px; height: 15px; accent-color: var(--asa-brand); }
.asa-root .asa-lead-msg { font-size: 12.5px; color: #8a2a1f; min-height: 0; }
.asa-root .asa-lead-msg:empty { display: none; }
.asa-lead-actions { display: flex; gap: 8px; align-items: center; }
.asa-root .asa-lead-send { background: var(--asa-brand); color: #fff; border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.asa-root .asa-lead-send:disabled { opacity: .5; }
.asa-root .asa-lead-skip { color: var(--asa-muted); font-size: 13.5px; padding: 9px 6px; text-decoration: underline; text-underline-offset: 2px; }
.asa-root .asa-foot a { color: inherit; text-decoration: underline; }
@media (max-width: 520px) { .asa-root .asa-lead input[type="text"], .asa-root .asa-lead input[type="email"] { font-size: 16px; } }





.asa-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.asa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.asa-avatar svg {
    width: 100%;
    height: 100%;
}
p.asa-foot {
    display: none;
}

section#asa-panel-1 {
    padding-bottom: 10px;
}