:root.bai-scroll-lock,
body.bai-scroll-lock {
    overflow: hidden !important;
}

.bai-root {
    --bai-accent: #e31e24;
    --bai-accent-dark: #c9151b;
    --bai-text: #20242a;
    --bai-muted: #777d86;
    --bai-border: #e7e8ea;
    --bai-surface: #ffffff;
    --bai-soft: #f4f5f6;
    --bai-shadow: 0 22px 70px rgba(19, 23, 31, .24);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--bai-text);
    position: relative;
    z-index: 2147482000;
}

.bai-launcher {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 2147482001;
    min-width: 264px;
    min-height: 62px;
    padding: 10px 22px 10px 58px;
    border: 1px solid color-mix(in srgb, var(--bai-accent) 48%, white);
    border-radius: 22px;
    background: linear-gradient(100deg, color-mix(in srgb, var(--bai-accent) 12%, white), color-mix(in srgb, var(--bai-accent) 5%, white));
    color: var(--bai-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .11);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.bai-root--left .bai-launcher,
.bai-launcher--left {
    left: 22px;
    right: auto;
}

.bai-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 38px rgba(0, 0, 0, .15);
    border-color: var(--bai-accent);
}

.bai-launcher:focus-visible,
.bai-icon-button:focus-visible,
.bai-send:focus-visible,
.bai-input:focus-visible,
.bai-quick__button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--bai-accent) 28%, transparent);
    outline-offset: 2px;
}

.bai-launcher__glow {
    position: absolute;
    inset: -100%;
    background: conic-gradient(from 90deg, transparent 0 32%, rgba(255, 255, 255, .8) 38%, transparent 44% 100%);
    animation: baiLauncherSweep 4.8s linear infinite;
    pointer-events: none;
}

.bai-launcher__text,
.bai-launcher__hint {
    position: relative;
    display: block;
    z-index: 2;
}

.bai-launcher__text {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.bai-launcher__hint {
    margin-top: 3px;
    color: var(--bai-muted);
    font-size: 13px;
    line-height: 1.2;
}

.bai-sparkles {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 28px;
    height: 28px;
    transform: translateY(-50%);
    z-index: 2;
}

.bai-sparkles i {
    position: absolute;
    display: block;
    background: var(--bai-accent);
    transform: rotate(45deg);
    border-radius: 2px;
    animation: baiSparkle 1.9s ease-in-out infinite;
}

.bai-sparkles i:nth-child(1) { width: 14px; height: 14px; left: 0; top: 7px; }
.bai-sparkles i:nth-child(2) { width: 8px; height: 8px; right: 0; top: 0; animation-delay: .45s; opacity: .72; }
.bai-sparkles i:nth-child(3) { width: 6px; height: 6px; right: 2px; bottom: 0; animation-delay: .9s; opacity: .5; }

.bai-launcher--inline {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 420px;
    margin: 14px 0;
}

.bai-overlay[hidden] {
    display: none !important;
}

.bai-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 19, 24, .58);
    opacity: 0;
    transition: opacity .18s ease;
    backdrop-filter: blur(2px);
}

.bai-overlay--open {
    opacity: 1;
}

.bai-dialog {
    width: min(620px, 100%);
    height: min(820px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--bai-surface);
    border-radius: 26px;
    box-shadow: var(--bai-shadow);
    transform: translateY(12px) scale(.985);
    transition: transform .18s ease;
}

.bai-overlay--open .bai-dialog {
    transform: translateY(0) scale(1);
}

.bai-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--bai-border);
}

.bai-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}

.bai-brand__icon {
    color: var(--bai-accent);
    font-size: 27px;
    line-height: 1;
    animation: baiBrandPulse 2.4s ease-in-out infinite;
}

.bai-header__actions {
    display: flex;
    gap: 4px;
}

.bai-icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--bai-text);
    font-size: 25px;
    cursor: pointer;
    transition: background .16s ease;
}

.bai-icon-button:hover { background: var(--bai-soft); }
.bai-clear { font-size: 20px; }

.bai-product {
    padding: 12px 20px;
    border-bottom: 1px solid var(--bai-border);
    background: #fff;
}

.bai-product__link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.bai-product__image {
    width: 64px;
    height: 52px;
    flex: 0 0 64px;
    object-fit: contain;
    border-radius: 9px;
    background: #fff;
}

.bai-product__image--placeholder {
    display: grid;
    place-items: center;
    background: var(--bai-soft);
    color: var(--bai-accent);
    font-weight: 800;
}

.bai-product__content { min-width: 0; }
.bai-product__name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.35;
}
.bai-product__price {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
}

.bai-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 20px 18px;
    scrollbar-width: thin;
    scrollbar-color: #9a9da2 transparent;
}

.bai-welcome {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 26px;
    text-align: center;
    color: var(--bai-muted);
}

.bai-welcome__icon {
    color: var(--bai-accent);
    font-size: 38px;
}

.bai-welcome__text {
    max-width: 410px;
    font-size: 16px;
    line-height: 1.55;
}

.bai-message {
    display: flex;
    margin: 0 0 18px;
}

.bai-message--user { justify-content: flex-end; }
.bai-message--assistant { justify-content: flex-start; }

.bai-message__bubble {
    max-width: 84%;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bai-message--user .bai-message__bubble {
    background: #eef0f2;
    border-bottom-right-radius: 7px;
}

.bai-message--assistant .bai-message__bubble {
    padding-left: 0;
    background: transparent;
    border-radius: 0;
}

.bai-message--new { animation: baiMessageIn .22s ease-out; }

.bai-typing {
    margin: 12px 0 22px;
    color: var(--bai-muted);
}

.bai-typing__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 15px;
}

.bai-typing__label i {
    width: 15px;
    height: 15px;
    display: inline-block;
    border: 2px solid #dedfe1;
    border-top-color: var(--bai-accent);
    border-radius: 50%;
    animation: baiSpin .75s linear infinite;
}

.bai-typing__line {
    display: block;
    width: 62%;
    height: 12px;
    margin-top: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, #f0f1f2 20%, #fafafa 38%, #f0f1f2 56%);
    background-size: 300% 100%;
    animation: baiSkeleton 1.3s ease infinite;
}

.bai-typing__line--short { width: 43%; }

.bai-error {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--bai-accent) 35%, white);
    border-radius: 13px;
    background: color-mix(in srgb, var(--bai-accent) 7%, white);
    color: #9d151a;
    font-size: 14px;
    line-height: 1.4;
}

.bai-footer {
    padding: 12px 20px 14px;
    border-top: 1px solid var(--bai-border);
    background: #fff;
}

.bai-quick {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 10px;
    scrollbar-width: none;
}
.bai-quick::-webkit-scrollbar { display: none; }

.bai-quick__button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 15px;
    background: var(--bai-soft);
    color: var(--bai-text);
    font-size: 13px;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}
.bai-quick__button:hover { background: #e9eaec; transform: translateY(-1px); }

.bai-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.bai-input {
    width: 100%;
    min-height: 50px;
    max-height: 116px;
    padding: 14px 17px;
    resize: none;
    border: 1px solid transparent;
    border-radius: 20px;
    background: var(--bai-soft);
    color: var(--bai-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    transition: border-color .16s ease, background .16s ease;
}
.bai-input:focus { border-color: color-mix(in srgb, var(--bai-accent) 45%, white); background: #fff; }
.bai-input::placeholder { color: #7f848c; }

.bai-send {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border: 0;
    border-radius: 16px;
    background: var(--bai-accent);
    color: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}
.bai-send:hover { transform: translateY(-1px); filter: brightness(.95); }
.bai-send:disabled { opacity: .38; cursor: default; transform: none; }

.bai-disclaimer {
    margin-top: 8px;
    color: #a0a4aa;
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
}

@keyframes baiLauncherSweep { to { transform: rotate(360deg); } }
@keyframes baiSparkle { 0%, 100% { transform: rotate(45deg) scale(.65); opacity: .45; } 50% { transform: rotate(45deg) scale(1.05); opacity: 1; } }
@keyframes baiBrandPulse { 0%, 100% { transform: scale(.9) rotate(0); } 50% { transform: scale(1.12) rotate(8deg); } }
@keyframes baiMessageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes baiSpin { to { transform: rotate(360deg); } }
@keyframes baiSkeleton { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 720px) {
    .bai-root--hide-mobile .bai-launcher { display: none !important; }
    .bai-launcher {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
        min-width: 0;
        min-height: 58px;
        border-radius: 20px;
    }
    .bai-launcher--inline {
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
    }
    .bai-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .bai-dialog {
        width: 100%;
        height: min(92dvh, 880px);
        border-radius: 24px 24px 0 0;
        transform: translateY(30px);
    }
    .bai-header { min-height: 58px; padding: 0 14px; }
    .bai-brand { font-size: 17px; }
    .bai-product { padding: 10px 14px; }
    .bai-product__image { width: 56px; height: 46px; flex-basis: 56px; }
    .bai-messages { padding: 18px 16px 12px; }
    .bai-footer { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
    .bai-message__bubble { max-width: 91%; font-size: 15px; }
    .bai-welcome { padding: 28px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .bai-root *, .bai-root *::before, .bai-root *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}

/* BELMASH AI Consultant 1.2 final overrides */
.bai-root { z-index: auto; }

.bai-launcher:not(.bai-launcher--inline) {
    right: 112px;
    bottom: 22px;
    z-index: 100000;
    transform: scale(.92);
    transform-origin: right bottom;
}
.bai-launcher:not(.bai-launcher--inline):hover { transform: translateY(-3px) scale(.92); }
.bai-overlay { z-index: 2147483000; }
.bai-dialog { position: relative; }

.bai-header__actions { display: flex; gap: 8px; }
.bai-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 0;
    color: #3c4148;
}
.bai-icon-button svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.bai-clear { color: #727b86; }

.bai-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.bai-product__main { min-width: 0; flex: 1 1 auto; }
.bai-product__link, .bai-product__content { min-width: 0; }
.bai-product__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.bai-product__actions { flex: 0 0 auto; }
.bai-cart-button {
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: var(--bai-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, opacity .16s ease, background .16s ease;
}
.bai-cart-button:hover { transform: translateY(-1px); filter: brightness(.96); }
.bai-cart-button:disabled { opacity: .62; cursor: default; transform: none; }
.bai-cart-button--in-basket { background: #2fa84f; }
.bai-cart-button--in-basket:hover { background: #288f43; }

.bai-messages { position: relative; }
.bai-history-toggle {
    display: block;
    margin: 4px auto 26px;
    padding: 8px 14px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--bai-accent) 7%, white);
    color: var(--bai-accent);
    font-size: 14px;
    cursor: pointer;
}
.bai-history-toggle[hidden] { display: none !important; }
.bai-history-toggle:not([hidden]) {
    position: sticky;
    top: 0;
    z-index: 10;
    width: max-content;
    max-width: calc(100% - 32px);
    box-shadow: 0 -12px 0 12px #fff, 0 8px 14px rgba(255,255,255,.95);
}
.bai-history-toggle:hover { background: color-mix(in srgb, var(--bai-accent) 12%, white); }

.bai-input {
    overflow-y: auto !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.bai-input::-webkit-scrollbar { width: 0; height: 0; display: none; }

.bai-disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.bai-disclaimer > span { min-width: 0; }
.bai-info-button {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca1a8;
    cursor: help;
}
.bai-info-button:hover, .bai-info-button:focus-visible { color: var(--bai-accent); transform: scale(1.08); }
.bai-info-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bai-clear-confirm[hidden], .bai-cart-confirm[hidden], .bai-info-modal[hidden] { display: none !important; }
.bai-clear-confirm, .bai-cart-confirm, .bai-info-modal {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 23, 28, .55);
    opacity: 0;
    transition: opacity .16s ease;
}
.bai-layer--open { opacity: 1; }

.bai-clear-confirm__dialog, .bai-cart-confirm__dialog, .bai-info-modal__dialog {
    position: relative;
    width: min(360px, 100%);
    padding: 24px 22px 22px;
    box-sizing: border-box;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(18, 22, 29, .3);
    transform: translateY(8px) scale(.98);
    transition: transform .16s ease;
}
.bai-layer--open > .bai-clear-confirm__dialog,
.bai-layer--open > .bai-cart-confirm__dialog,
.bai-layer--open > .bai-info-modal__dialog { transform: translateY(0) scale(1); }

.bai-clear-confirm__title, .bai-cart-confirm__title, .bai-info-modal__title {
    color: var(--bai-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}
.bai-clear-confirm__text, .bai-cart-confirm__text {
    margin-top: 8px;
    color: var(--bai-muted);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}
.bai-clear-confirm__actions, .bai-cart-confirm__actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}
.bai-clear-confirm__accept, .bai-clear-confirm__cancel,
.bai-cart-confirm__go, .bai-cart-confirm__cancel {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 10px 18px;
    border: 0;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}
.bai-clear-confirm__accept, .bai-cart-confirm__go { background: var(--bai-accent); color: #fff; }
.bai-clear-confirm__cancel, .bai-cart-confirm__cancel { background: var(--bai-soft); color: var(--bai-text); }
.bai-cart-confirm__go:hover { color: #fff; text-decoration: none; filter: brightness(.96); }
.bai-clear-confirm__cancel:hover, .bai-cart-confirm__cancel:hover { background: #e9eaec; }
.bai-cart-confirm__icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e7f7eb;
    color: #2fa84f;
    font-size: 30px;
    font-weight: 700;
}

.bai-info-modal__dialog {
    width: min(410px, 100%);
    max-height: calc(100% - 20px);
    overflow-y: auto;
    padding: 26px 24px 24px;
}
.bai-info-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #92979e;
    cursor: pointer;
}
.bai-info-modal__close:hover { background: var(--bai-soft); color: var(--bai-text); }
.bai-info-modal__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.bai-info-modal__title { padding-right: 30px; text-align: left; font-weight: 500; }
.bai-info-modal__content { margin-top: 14px; color: #252a30; font-size: 14px; line-height: 1.55; }
.bai-info-modal__content p { margin: 0 0 14px; }
.bai-info-modal__content p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
    .bai-launcher:not(.bai-launcher--inline) {
        left: auto;
        right: 92px;
        bottom: 18px;
        width: auto;
        max-width: calc(100vw - 110px);
        min-width: 230px;
        transform: scale(.90);
        transform-origin: right bottom;
    }
    .bai-launcher:not(.bai-launcher--inline):hover { transform: translateY(-2px) scale(.90); }
    .bai-product { gap: 10px; }
    .bai-cart-button { height: 38px; padding: 0 15px; font-size: 15px; }
    .bai-clear-confirm, .bai-cart-confirm, .bai-info-modal { padding: 16px; }
    .bai-clear-confirm__dialog, .bai-cart-confirm__dialog, .bai-info-modal__dialog { border-radius: 20px; }
    .bai-info-modal__dialog { max-height: calc(100% - 12px); padding: 24px 20px 22px; }
}
