/* DMH Core Integration — shopping assistant. Uses DMHITECH BELFORT design tokens with fallbacks. */
.dmhi-as {
	--as-primary: var(--primary, #1769FF);
	--as-ink: var(--primary-ink, #fff);
	--as-accent: var(--accent, #00C8E8);
	--as-navy: var(--navy, #101B2D);
	--as-surface: var(--surface, #fff);
	--as-surface-2: var(--surface-2, #EEF2F8);
	--as-text: var(--text, #182230);
	--as-muted: var(--muted, #5B6578);
	--as-line: var(--line, #E3E8EF);
	--as-success: var(--success, #12B76A);
	--as-sale: var(--sale, #FF3D5A);
	--as-radius: var(--radius, 14px);
	--as-radius-lg: var(--radius-lg, 20px);
	position: fixed;
	inset-block-end: calc(96px + var(--bottom-nav-h, 0px));
	inset-inline-end: 20px;
	z-index: 161;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: var(--font-body, inherit);
	color: var(--as-text);
}
.dmhi-as.is-start { inset-inline-end: auto; inset-inline-start: 20px; inset-block-end: calc(22px + var(--bottom-nav-h, 0px)); align-items: flex-start; }
.dmhi-as__toggle {
	display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
	background: linear-gradient(135deg, var(--as-primary), var(--as-accent)); color: var(--as-ink);
	box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--as-primary) 70%, transparent);
	transition: transform .25s ease;
}
.dmhi-as__toggle:hover { transform: scale(1.06); }
.dmhi-as__toggle:focus-visible, .dmhi-as button:focus-visible, .dmhi-as a:focus-visible, .dmhi-as select:focus-visible, .dmhi-as textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--as-primary) 45%, transparent); outline-offset: 2px; }
.dmhi-as.is-open .dmhi-as__toggle { display: none; }
.dmhi-as__panel {
	display: flex; flex-direction: column; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 140px - var(--bottom-nav-h, 0px)));
	overflow: hidden; border: 1px solid var(--as-line); border-radius: var(--as-radius-lg); background: var(--as-surface);
	box-shadow: var(--shadow-lg, 0 24px 48px -16px rgba(16, 27, 45, .28)); animation: dmhi-pop .28s cubic-bezier(.2, .8, .2, 1);
}
.dmhi-as__panel[hidden] { display: none; }
@keyframes dmhi-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dmhi-as__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: var(--as-navy); color: #fff; }
.dmhi-as__avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--as-primary), var(--as-accent)); }
.dmhi-as__avatar svg { width: 20px; height: 20px; }
.dmhi-as__title { flex: 1; min-width: 0; line-height: 1.25; }
.dmhi-as__title strong { display: block; font-size: 15px; }
.dmhi-as__title small { opacity: .75; font-size: 12px; }
.dmhi-as__icon { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.dmhi-as__icon:hover { background: rgba(255, 255, 255, .16); }
.dmhi-as__log { flex: 1; overflow-y: auto; padding: 14px; background: var(--as-surface-2); scroll-behavior: smooth; overscroll-behavior: contain; }
.dmhi-msg { max-width: 88%; margin: 0 0 10px; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.dmhi-msg p { margin: 0; white-space: pre-line; }
.dmhi-msg--bot { border-start-start-radius: 4px; background: var(--as-surface); box-shadow: 0 1px 2px rgba(16, 27, 45, .06); }
.dmhi-msg--user { margin-inline-start: auto; border-start-end-radius: 4px; background: var(--as-primary); color: var(--as-ink); }
.dmhi-msg__mode { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 99px; background: var(--as-surface-2); color: var(--as-muted); font-size: 11px; }
.dmhi-typing { display: inline-flex; gap: 4px; }
.dmhi-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--as-muted); animation: dmhi-dot 1.2s infinite ease-in-out; }
.dmhi-typing span:nth-child(2) { animation-delay: .15s; }
.dmhi-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dmhi-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.dmhi-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.dmhi-chip { padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--as-primary) 35%, var(--as-line)); border-radius: 99px; background: var(--as-surface); color: var(--as-primary); font: inherit; font-size: 13px; cursor: pointer; text-align: start; }
.dmhi-chip:hover { background: color-mix(in srgb, var(--as-primary) 8%, var(--as-surface)); }
.dmhi-cards { display: grid; gap: 10px; margin: 0 0 12px; }
.dmhi-card { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--as-line); border-radius: var(--as-radius); background: var(--as-surface); }
.dmhi-card.is-out { opacity: .7; }
.dmhi-card__media { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--img-bg, #F3F6FA); }
.dmhi-card__media img { width: 100%; height: 100%; object-fit: contain; }
.dmhi-card__noimg { color: var(--as-muted); font-weight: 700; letter-spacing: .05em; }
.dmhi-card__body { min-width: 0; }
.dmhi-card__tags { display: flex; gap: 4px; margin-bottom: 4px; }
.dmhi-tag { padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.dmhi-tag--cheapest { background: color-mix(in srgb, var(--as-success) 15%, transparent); color: color-mix(in srgb, var(--as-success) 80%, #000); }
.dmhi-tag--best_value { background: color-mix(in srgb, var(--as-primary) 14%, transparent); color: var(--as-primary); }
.dmhi-card__brand { display: block; color: var(--as-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dmhi-card__name { display: -webkit-box; overflow: hidden; color: var(--as-text); font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dmhi-card__name:hover { color: var(--as-primary); }
.dmhi-card__specs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.dmhi-card__specs li { padding: 1px 7px; border-radius: 6px; background: var(--as-surface-2); color: var(--as-muted); font-size: 11px; }
.dmhi-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.dmhi-card__price { color: var(--as-primary); font-size: 15px; unicode-bidi: isolate; }
.dmhi-card__regular { color: var(--as-muted); font-size: 12px; }
.dmhi-badge { padding: 1px 7px; border-radius: 99px; font-size: 11px; }
.dmhi-badge.is-in { background: color-mix(in srgb, var(--as-success) 14%, transparent); color: color-mix(in srgb, var(--as-success) 80%, #000); }
.dmhi-badge.is-out { background: color-mix(in srgb, var(--as-sale) 12%, transparent); color: var(--as-sale); }
.dmhi-badge.is-cond { background: var(--as-surface-2); color: var(--as-text); }
.dmhi-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dmhi-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--btn-radius, 10px); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.dmhi-btn--primary { background: var(--as-primary); color: var(--as-ink); }
.dmhi-btn--primary:disabled { opacity: .5; cursor: not-allowed; }
.dmhi-btn--ghost { border-color: var(--as-line); background: var(--as-surface); color: var(--as-text); }
.dmhi-select { min-height: 34px; max-width: 100%; padding: 0 8px; border: 1px solid var(--as-line); border-radius: 10px; background: var(--as-surface); color: var(--as-text); font: inherit; font-size: 13px; }
.dmhi-compare { margin: 0 0 12px; overflow-x: auto; border: 1px solid var(--as-line); border-radius: var(--as-radius); background: var(--as-surface); }
.dmhi-compare table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dmhi-compare th, .dmhi-compare td { padding: 7px 9px; border-bottom: 1px solid var(--as-line); text-align: start; vertical-align: top; }
.dmhi-compare thead th { background: var(--as-surface-2); font-size: 12px; }
.dmhi-compare tbody th { color: var(--as-muted); font-weight: 600; white-space: nowrap; }
.dmhi-as__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--as-line); background: var(--as-surface); }
.dmhi-as__input { flex: 1; min-height: 42px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--as-line); border-radius: 12px; background: var(--as-surface-2); color: var(--as-text); font: inherit; font-size: 14px; resize: none; }
.dmhi-as__send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: var(--as-primary); color: var(--as-ink); cursor: pointer; }
.dmhi-as__send:disabled { opacity: .5; }
[dir="rtl"] .dmhi-as__send svg, [dir="rtl"] .dmhi-as__icon svg[data-flip] { transform: scaleX(-1); }

/* Checkout: smaller, out of the way of the order button. */
.dmhi-as.is-checkout:not(.is-open) .dmhi-as__toggle { width: 46px; height: 46px; opacity: .92; }
@media (max-width: 640px) {
	.dmhi-as.is-checkout:not(.is-open) { inset-block-end: auto; inset-block-start: 76px; }
	.dmhi-as.has-product:not(.is-open) { inset-block-end: calc(150px + var(--bottom-nav-h, 0px)); }
}
@media (max-width: 640px) {
	.dmhi-as { inset-inline-end: 14px; inset-block-end: calc(88px + var(--bottom-nav-h, 0px)); }
	.dmhi-as.is-start { inset-inline-start: 14px; }
	.dmhi-as.no-mobile:not(.is-open) .dmhi-as__toggle { display: none; }
	.dmhi-as__toggle { width: 50px; height: 50px; }
	.dmhi-as.is-open { inset: 0; z-index: 1000; }
	.dmhi-as.is-open .dmhi-as__panel { width: 100%; height: 100%; border: 0; border-radius: 0; }
	.dmhi-card { grid-template-columns: 76px 1fr; }
	html.dmhi-as-lock, html.dmhi-as-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
	.dmhi-as__panel, .dmhi-typing span { animation: none; }
	.dmhi-as__toggle { transition: none; }
}
@media print { .dmhi-as { display: none; } }
