#wlac,
#wlac * {
    box-sizing: border-box;
}

#wlac {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: Arial, sans-serif;
}

#wlac button,
#wlac input {
    font-family: inherit;
}

#wlac-toggle {
    width: 65px;
    height: 65px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #a31e31;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(163, 30, 49, .35);
    transition: transform .18s ease, background .18s ease;
}

#wlac-toggle:hover {
    transform: translateY(-2px);
    background: #8e1829;
}

.wlac-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 23px;
    line-height: 1;
}

#wlac-window {
    display: none;
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 400px;
    height: 750px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 90px);
    overflow: hidden;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .20);
}

#wlac-window.is-open {
    display: flex;
    flex-direction: column;
}

.wlac-header {
    flex: 0 0 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #a31e31;
    color: #fff;
}

.wlac-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wlac-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .30);
    font-size: 12px;
    font-weight: 700;
}

.wlac-brand-text {
    min-width: 0;
}

.wlac-brand-text strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wlac-brand-text span {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    opacity: .88;
}

.wlac-brand-text i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a624;
}

#wlac-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.wlac-quick-actions {
    display: flex;
    gap: 7px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    background: #fff;
    scrollbar-width: none;
}

.wlac-quick-actions::-webkit-scrollbar {
    display: none;
}

.wlac-quick {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid #ead9dc;
    border-radius: 20px;
    background: #fff;
    color: #a31e31;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wlac-quick:hover {
    background: #fff5f6;
}

.wlac-quick:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#wlac-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 14px;
    background: #f8f8f9;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.wlac-message {
    max-width: 86%;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

.wlac-message.ai {
    background: #fff;
    color: #252525;
    border: 1px solid #ededed;
    border-bottom-left-radius: 5px;
}

.wlac-message.user {
    margin-left: auto;
    background: #a31e31;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.wlac-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 55px;
    padding: 12px;
}

.wlac-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #999;
    animation: wlacTyping 1.1s infinite ease-in-out;
}

.wlac-typing span:nth-child(2) {
    animation-delay: .15s;
}

.wlac-typing span:nth-child(3) {
    animation-delay: .30s;
}

@keyframes wlacTyping {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .35;
    }

    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.wlac-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 94%;
    margin: 2px 0 12px;
}

.wlac-product-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e9e9e9;
    border-radius: 13px;
    background: #fff;
}

.wlac-product-image {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: contain;
    border-radius: 8px;
    background: #f7f7f7;
}

.wlac-product-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wlac-product-name {
    color: #222;
    font-size: 13px;
    line-height: 1.35;
}

.wlac-product-price {
    margin-top: 4px;
    color: #a31e31;
    font-size: 13px;
    font-weight: 700;
}

.wlac-stock {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
}

.wlac-stock.in {
    color: #278448;
}

.wlac-stock.out {
    color: #b33a3a;
}

.wlac-product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-top: 7px;
    padding: 0 10px;
    border-radius: 7px;
    background: #a31e31;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
}

.wlac-product-link:hover {
    background: #8e1829;
    color: #fff;
}

#wlac-form {
    flex: 0 0 auto;
    margin: 0;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

.wlac-input-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 4px 4px 4px 11px;
    border: 1px solid #ddd;
    border-radius: 24px;
    background: #fff;
}

#wlac-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #222;
    font-size: 13px;
}

#wlac-input::placeholder {
    color: #888;
}

#wlac-mic,
#wlac-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

#wlac-mic {
    background: #f3f3f3;
    color: #555;
}

#wlac-mic:hover {
    background: #ececec;
}

#wlac-mic.is-recording {
    background: #a31e31;
    color: #fff;
    animation: wlacPulse 1.2s infinite;
}

#wlac-send {
    background: #a31e31;
    color: #fff;
}

#wlac-send:hover {
    background: #8e1829;
}

#wlac-mic:disabled,
#wlac-send:disabled {
    opacity: .55;
    cursor: not-allowed;
}
#wlac-mic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f3f3;
    color: #a31e31;
    cursor: pointer;
}

#wlac-mic:hover {
    background: #f9e8eb;
}

.wlac-mic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a31e31;
}

.wlac-mic-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

#wlac-mic.is-recording {
    background: #a31e31;
    color: #fff;
}

#wlac-mic.is-recording .wlac-mic-icon {
    color: #fff;
}

.wlac-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #f0d6da;
    border-radius: 10px;
    background: #fff7f8;
    color: #a31e31;
    font-size: 12px;
}

.wlac-recording[hidden] {
    display: none;
}

.wlac-record-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #a31e31;
    animation: wlacPulse 1s infinite;
}

#wlac-record-time {
    font-weight: 700;
}

#wlac-stop {
    margin-left: auto;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: #a31e31;
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

@keyframes wlacPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(163, 30, 49, .25);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(163, 30, 49, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(163, 30, 49, 0);
    }
}

#wlac-toggle:focus-visible,
#wlac-close:focus-visible,
#wlac-mic:focus-visible,
#wlac-send:focus-visible,
#wlac-stop:focus-visible,
.wlac-quick:focus-visible,
.wlac-product-link:focus-visible {
    outline: 2px solid #a31e31;
    outline-offset: 2px;
}

@media (max-width: 480px) {

    #wlac {
        right: 12px;
        bottom: 12px;
    }

    #wlac-toggle {
        width: 54px;
        height: 54px;
    }

    #wlac-window {
        position: fixed;
        right: 8px;
        bottom: 72px;
        left: 8px;
        width: auto;
        height: min(600px, calc(100dvh - 88px));
        max-width: none;
        max-height: none;
        border-radius: 16px;
    }

    .wlac-message {
        max-width: 90%;
    }

    .wlac-products {
        width: 97%;
    }

    .wlac-product-image {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {

    #wlac *,
    #wlac *::before,
    #wlac *::after {
        animation: none !important;
        transition: none !important;
    }
}
.wlac-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
}

.wlac-avatar svg {
    display: block;
    width: 22px;
    height: 22px;
}