/* Amedex AI shop assistant – widget styles (scoped to #amx-ast). v4 2026-11-07 */
#amx-ast { --amx-red: #E23636; --amx-red-d: #c92c2c; --amx-ink: #1d1d1f; --amx-muted: #6e6e73; --amx-line: #e8e8ed; --amx-bg: #fff; --amx-soft: #f6f6f8;
	position: fixed; right: 20px; bottom: 20px; z-index: 99990; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--amx-ink); text-align: left; }
#amx-ast *, #amx-ast *::before, #amx-ast *::after { box-sizing: border-box; }
/* Neutralise theme button/link styles (Woodmart sets min-height, uppercase, shadows). */
#amx-ast button, #amx-ast a { font-family: inherit; min-height: 0; height: auto; margin: 0; letter-spacing: normal; text-transform: none; text-shadow: none; box-shadow: none; line-height: 1.3; }
#amx-ast svg { flex: none; display: block; }

/* ---------- launcher: round button with AI badge (v3) ---------- */
#amx-ast .amx-ast-btn { position: relative; display: flex; align-items: center; justify-content: center; margin-left: auto; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
	background: linear-gradient(140deg, #f25555 0%, #d42a2a 100%); color: #fff; cursor: pointer;
	box-shadow: 0 8px 22px rgba(212,42,42,.38), 0 2px 6px rgba(0,0,0,.12); transition: transform .2s ease, box-shadow .2s ease; }
#amx-ast .amx-ast-btn:hover { transform: scale(1.06); box-shadow: 0 12px 28px rgba(212,42,42,.45), 0 2px 6px rgba(0,0,0,.12); }
#amx-ast .amx-ast-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#amx-ast .amx-ast-btn i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .2s ease, transform .25s ease; }
#amx-ast .amx-ast-btn i svg { width: 28px; height: 28px; }
#amx-ast .amx-ast-btn .amx-x { opacity: 0; transform: rotate(-90deg) scale(.6); }
#amx-ast .amx-ast-btn .amx-x svg { width: 22px; height: 22px; }
#amx-ast.is-open .amx-ast-btn .amx-o { opacity: 0; transform: rotate(90deg) scale(.6); }
#amx-ast.is-open .amx-ast-btn .amx-x { opacity: 1; transform: none; }
#amx-ast .amx-ast-btn b { position: absolute; top: -3px; right: -5px; padding: 2px 6px; border-radius: 10px; background: #fff; color: #d42a2a; font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: .3px; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: opacity .2s; }
#amx-ast.is-open .amx-ast-btn b { opacity: 0; }
@media (min-width: 1025px) { body:has(#amx-ast) .scrollToTop { bottom: 92px; } }
@media (max-width: 1024px) {
	#amx-ast { right: 14px; bottom: 72px; }
	#amx-ast .amx-ast-btn { width: 52px; height: 52px; }
	#amx-ast .amx-ast-btn i svg { width: 24px; height: 24px; }
}
/* ---------- panel (v4: wider, modern) ---------- */
.amx-ast-panel { position: absolute; right: 0; bottom: 76px; width: 440px; height: min(720px, calc(100vh - 130px)); display: flex; flex-direction: column;
	background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.24), 0 0 0 1px rgba(0,0,0,.06); overflow: hidden;
	transform-origin: bottom right; animation: amxin .22s cubic-bezier(.2,.9,.3,1.2); }
.amx-ast-panel[hidden] { display: none; }
@keyframes amxin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

.amx-ast-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 18px; color: #fff;
	background: radial-gradient(120% 140% at 0% 0%, rgba(226,54,54,.35) 0%, rgba(226,54,54,0) 55%), linear-gradient(135deg, #1d1d1f 0%, #2a2a2e 100%); }
.amx-ast-ava { position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.amx-ast-ava svg { width: 36px; height: 36px; filter: drop-shadow(0 3px 6px rgba(227,40,58,.45)); }
.amx-ast-ava::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #34c759; border: 2px solid #232326; }
.amx-ast-htext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.amx-ast-htext strong { font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; letter-spacing: -.1px; }
.amx-ast-htext span { font-size: 12.5px; color: #b0b0b6; }
.amx-ast-tag { font-size: 10px; font-style: normal; font-weight: 700; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px; background: #ffcc00; color: #1d1d1f; }
#amx-ast .amx-ast-icon { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); color: #e5e5ea; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
#amx-ast .amx-ast-icon:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- messages ---------- */
.amx-ast-body { flex: 1; overflow-y: auto; padding: 20px 18px 8px; background: #f7f7f9; overscroll-behavior: contain; scrollbar-width: thin; }
.amx-ast-msg { position: relative; display: flex; flex-direction: column; margin-bottom: 16px; animation: amxmsg .25s ease-out; }
@keyframes amxmsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.amx-ast-msg.is-user { align-items: flex-end; }
.amx-ast-msg.is-bot { padding-left: 38px; }
.amx-ast-msg.is-bot::before { content: ''; position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 10px;
	background: #fff; border: 1px solid #ececf0; }
.amx-ast-msg.is-bot::after { content: ''; position: absolute; left: 0; top: 2px; width: 28px; height: 28px;
	background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%2756%2056%20400%20400%27%3E%3Cdefs%3E%3CclipPath%20id%3D%27amxL%27%3E%3Cpath%20d%3D%27M222%2075H424Q446%2075%20438%2096L312%20400Q304%20420%20282%20420H88Q66%20420%2074%20399L200%2095Q208%2075%20222%2075Z%27%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%27amxG%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%27.45%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f57d82%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23e3283a%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20clip-path%3D%27url%28%23amxL%29%27%3E%3Crect%20x%3D%2756%27%20y%3D%2756%27%20width%3D%27400%27%20height%3D%27271%27%20fill%3D%27url%28%23amxG%29%27%2F%3E%3Crect%20x%3D%2756%27%20y%3D%27327%27%20width%3D%27400%27%20height%3D%27129%27%20fill%3D%27%23eceef2%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / 21px no-repeat; }
.amx-ast-bubble { max-width: 88%; padding: 11px 15px; border-radius: 18px; background: #fff; word-wrap: break-word; font-size: 14px; line-height: 1.55; border: 1px solid #ececf0; }
.amx-ast-bubble p { margin: 0 0 6px; } .amx-ast-bubble p:last-child { margin-bottom: 0; }
.amx-ast-bubble ul { margin: 6px 0; padding-left: 18px; list-style: disc; } .amx-ast-bubble li { margin: 3px 0; }
.amx-ast-bubble li::marker { color: var(--amx-red); }
.amx-ast-bubble strong { font-weight: 700; color: inherit; }
.is-user .amx-ast-bubble { background: linear-gradient(140deg, #f04848, #d42a2a); border: 0; color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 4px 12px rgba(212,42,42,.22); }
.is-bot .amx-ast-bubble { border-top-left-radius: 6px; }

.amx-ast-typing { display: flex; gap: 5px; padding: 15px 16px; }
.amx-ast-typing i { width: 7px; height: 7px; border-radius: 50%; background: #aeaeb2; animation: amxdot 1s infinite ease-in-out; }
.amx-ast-typing i:nth-child(2) { animation-delay: .15s; } .amx-ast-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes amxdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- welcome screen ---------- */
.amx-ast-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 14px 10px; animation: amxmsg .3s ease-out; }
.amx-ast-hava { width: 72px; height: 72px; border-radius: 22px; background: radial-gradient(120% 140% at 0% 0%, rgba(226,54,54,.35) 0%, rgba(226,54,54,0) 55%), linear-gradient(135deg, #1d1d1f 0%, #2a2a2e 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px rgba(0,0,0,.22); margin-bottom: 16px; }
.amx-ast-hava svg { width: 50px; height: 50px; filter: drop-shadow(0 3px 8px rgba(227,40,58,.5)); }
#amx-ast .amx-ast-hero h3 { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--amx-ink); letter-spacing: -.2px; text-transform: none; }
.amx-ast-hero p { margin: 0; max-width: 320px; font-size: 14px; line-height: 1.55; color: var(--amx-muted); }

/* ---------- product cards ---------- */
.amx-ast-cards { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; }
.amx-ast-card { display: flex; gap: 12px; padding: 10px; background: #fff; border: 1px solid #ececf0; border-radius: 16px; transition: box-shadow .2s, border-color .2s, transform .2s; }
.amx-ast-card:hover { border-color: #e0e0e6; box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
#amx-ast .amx-ast-cimg { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #f0f0f3; display: flex; align-items: center; justify-content: center; }
#amx-ast .amx-ast-cimg img { width: 100%; height: 100%; max-width: none; object-fit: contain; padding: 5px; }
.amx-ast-cinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#amx-ast .amx-ast-cname { font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--amx-ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#amx-ast .amx-ast-cname:hover { color: var(--amx-red); }
.amx-ast-cprice { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.amx-ast-cprice s { color: var(--amx-muted); font-size: 12px; }
.amx-ast-cprice strong { color: var(--amx-red); font-size: 15.5px; font-weight: 700; white-space: nowrap; }
.amx-ast-stock { font-size: 12px; color: var(--amx-muted); display: flex; align-items: center; gap: 5px; }
.amx-ast-stock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.amx-ast-stock.is-in { color: #248a3d; }
.amx-ast-cacts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
#amx-ast .amx-ast-b1, #amx-ast .amx-ast-b2 { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 15px; border-radius: 16px; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
#amx-ast .amx-ast-b1 { border: 0; background: var(--amx-red); color: #fff; }
#amx-ast .amx-ast-b1:hover { background: var(--amx-red-d); }
#amx-ast .amx-ast-b1:disabled { opacity: .75; cursor: default; }
#amx-ast .amx-ast-b2 { border: 1px solid #dcdce1; color: var(--amx-ink); background: #fff; }
#amx-ast .amx-ast-b2:hover { border-color: var(--amx-red); color: var(--amx-red); }

#amx-ast .amx-ast-viber { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 16px; border-radius: 14px; background: #7360f2; color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; box-shadow: 0 4px 12px rgba(115,96,242,.3); }
#amx-ast .amx-ast-viber:hover { background: #5b48e0; color: #fff; }

/* ---------- quick questions (2-column cards) ---------- */
.amx-ast-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 18px 14px; background: #f7f7f9; }
.amx-ast-chips[hidden] { display: none; }
#amx-ast .amx-ast-chip { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 12px; border: 1px solid #e5e5ea; border-radius: 14px; background: #fff; color: var(--amx-ink); font-size: 13px; font-weight: 500; line-height: 1.3; text-align: center; cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s, transform .15s; }
#amx-ast .amx-ast-chip:hover { border-color: var(--amx-red); color: var(--amx-red); box-shadow: 0 4px 12px rgba(0,0,0,.06); transform: translateY(-1px); }

/* ---------- composer (send button inside the field) ---------- */
.amx-ast-form { position: relative; display: flex; align-items: flex-end; margin: 0; padding: 12px 14px 6px; background: #fff; border-top: 1px solid #f0f0f3; }
#amx-ast .amx-ast-form textarea { flex: 1; resize: none; height: 48px; min-height: 48px; max-height: 130px; margin: 0; padding: 13px 56px 13px 18px; border: 1px solid #e5e5ea; border-radius: 24px; font: inherit; font-size: 14px; line-height: 1.45; outline: none; background: #f4f4f7; color: var(--amx-ink); box-shadow: none; transition: border-color .15s, background .15s, box-shadow .15s; }
#amx-ast .amx-ast-form textarea:focus { border-color: var(--amx-red); background: #fff; box-shadow: 0 0 0 4px rgba(226,54,54,.1); }
#amx-ast .amx-ast-send { position: absolute; right: 20px; bottom: 12px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(140deg, #f25555, #d42a2a); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s, opacity .15s; }
#amx-ast .amx-ast-send:hover { transform: scale(1.06); }
#amx-ast .amx-ast-send:disabled { opacity: .4; cursor: default; transform: none; }
#amx-ast .amx-ast-send svg { width: 18px; height: 18px; }
.amx-ast-foot { padding: 2px 16px 10px; font-size: 10.5px; line-height: 1.4; color: #8e8e93; background: #fff; text-align: center; }
#amx-ast .amx-ast-foot a { color: #8e8e93; text-decoration: underline; }

@media (max-width: 560px) {
	#amx-ast.is-open { inset: 0; z-index: 100001; }
	#amx-ast.is-open .amx-ast-btn { display: none; }
	.amx-ast-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; animation: none; }
	#amx-ast .amx-ast-form textarea { font-size: 16px; }
	.amx-ast-bubble { max-width: 92%; }
	.amx-ast-chips { padding: 6px 14px 12px; }
}
