/* === Woo Listeo AI Chatbot Widget === */

:root {
    --wlac-primary: #2563eb;
    --wlac-secondary: #ffffff;
    --wlac-text: #1f2937;
    --wlac-user-bubble: #2563eb;
    --wlac-bot-bubble: #f3f4f6;
    --wlac-font: inherit;
    --wlac-font-size: 14px;
    --wlac-radius: 16px;
    --wlac-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1);
    --wlac-z: 999999;
}

/* --- Widget Container --- */
.wlac-widget {
    position: fixed;
    z-index: var(--wlac-z);
    bottom: 24px;
    right: 24px;
    font-family: var(--wlac-font) !important;
    font-size: var(--wlac-font-size) !important;
    line-height: 1.5;
    box-sizing: border-box;
}

.wlac-widget.wlac-pos-bottom-left {
    right: auto;
    left: 24px;
}

.wlac-widget *,
.wlac-widget *::before,
.wlac-widget *::after {
    box-sizing: border-box;
}

/* --- Toggle Button --- */
.wlac-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wlac-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
    color: #fff;
    padding: 0;
    outline: none;
}

.wlac-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,.3);
}

.wlac-toggle:focus-visible {
    outline: 3px solid var(--wlac-primary);
    outline-offset: 3px;
}

.wlac-toggle svg {
    width: 24px;
    height: 24px;
    transition: opacity .2s ease, transform .2s ease;
}

.wlac-icon-chat  { opacity: 1;  transform: scale(1); }
.wlac-icon-close { opacity: 0;  transform: scale(.5); position: absolute; }

.wlac-widget.wlac-open .wlac-icon-chat  { opacity: 0;  transform: scale(.5); }
.wlac-widget.wlac-open .wlac-icon-close { opacity: 1;  transform: scale(1);  }

.wlac-unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    display: none;
}

.wlac-unread-badge.wlac-visible { display: flex; }

/* --- Chat Window --- */
.wlac-window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 360px;
    max-height: 540px;
    background: var(--wlac-secondary);
    border-radius: var(--wlac-radius);
    box-shadow: var(--wlac-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(.92) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}

.wlac-pos-bottom-left .wlac-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.wlac-widget.wlac-open .wlac-window {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all; min-height:450px;
}

/* --- Header --- */
.wlac-header {
    background: var(--wlac-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.wlac-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wlac-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wlac-avatar svg { width: 18px; height: 18px; }

.wlac-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.wlac-status {
    font-size: 11px;
    opacity: .85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wlac-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

.wlac-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.8);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.wlac-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.15);
}

.wlac-close-btn svg { width: 18px; height: 18px; }

/* --- Messages Area --- */
.wlac-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.d-flex.one-line{ display:grid; gap:10px; grid-template-columns: 4fr 1fr; width:100%;  }

.wlac-messages::-webkit-scrollbar { width: 4px; }
.wlac-messages::-webkit-scrollbar-track { background: transparent; }
.wlac-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

/* Message bubbles */
.wlac-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: var(--wlac-radius);
    font-size: var(--wlac-font-size);
    line-height: 1.5;
    word-break: break-word;
    animation: wlac-pop .18s ease;
}

@keyframes wlac-pop {
    from { opacity: 0; transform: translateY(6px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1);    }
}

.wlac-msg-bot {
    background: var(--wlac-bot-bubble);
    color: var(--wlac-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.wlac-msg-user {
    background: var(--wlac-user-bubble);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.wlac-msg-time {
    font-size: 10px;
    opacity: .55;
    margin-top: 3px;
    display: block;
}

/* Typing indicator */
.wlac-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--wlac-bot-bubble);
    border-radius: var(--wlac-radius);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 64px;
}

.wlac-typing span {
    width: 7px;
    height: 7px;
    background: var(--wlac-text);
    opacity: .45;
    border-radius: 50%;
    display: inline-block;
    animation: wlac-bounce .9s infinite;
}

.wlac-typing span:nth-child(2) { animation-delay: .15s; }
.wlac-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes wlac-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: .45; }
    30%            { transform: translateY(-5px); opacity: .85; }
}

/* --- Quick Actions --- */
.wlac-quick-actions {
    padding: 0 14px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.wlac-quick-btn {
    background: transparent;
    border: 1.5px solid var(--wlac-primary);
    color: var(--wlac-primary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: var(--wlac-font);
    white-space: nowrap;
}

.wlac-quick-btn:hover {
    background: var(--wlac-primary);
    color: #fff;
}

/* --- Order Lookup Form --- */
.wlac-order-form {
    padding: 12px 14px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.wlac-order-form-label {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--wlac-text);
}

.wlac-input {
    width: 85%;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color .15s;
    font-family: var(--wlac-font);
    background: #fff;
    color: var(--wlac-text);
}

.wlac-input:focus { border-color: var(--wlac-primary); }

.wlac-order-form-actions {
    display: flex;
    gap: 8px;
}

.wlac-submit-btn {
    flex: 1;
    background: var(--wlac-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--wlac-font);
    transition: opacity .15s;
}

.wlac-submit-btn:hover { opacity: .88; }

.wlac-cancel-btn {
    background: transparent;
    border: 1.5px solid #d1d5db;
    color: #6b7280;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--wlac-font);
}

/* --- Input Area --- */
.wlac-input-area {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px 12px !important;
    border-top: 5px solid #e5e7eb !important;
    background: var(--wlac-secondary) !important;
    
    overflow: hidden !important;
    box-sizing: border-box !important;
    
}

.wlac-textarea {
    min-width: 0 !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 999px !important;
    padding: 9px 18px !important;
    font-size: var(--wlac-font-size) !important;
    resize: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--wlac-font) !important;
    line-height: 1.4 !important;
    max-height: 80px !important;
    min-height: 38px !important;
    overflow-y: auto !important;
    color: var(--wlac-text) !important;
    background: #fff !important;
    transition: border-color .15s !important;
    display: block !important;
    box-sizing: border-box !important;
    margin-bottom:0px !important;
}

.wlac-textarea:focus {
    border-color: #555 !important;
    box-shadow: none !important;
    outline: none !important;
}

.wlac-textarea::placeholder {
    color: #aaa !important;
}

.wlac-send-btn {
    flex: 0 0 38px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    border-radius: 50% !important;
    background: #1c1c1e !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    transition: background .15s !important;
    padding: 0 !important;
    text-decoration: none !important;
    margin: 0 !important;
    position: static !important;
}

.wlac-send-btn:hover { background: #3a3a3a !important; }
.wlac-send-btn:disabled { opacity: .35 !important; cursor: not-allowed !important; }
.wlac-send-btn svg { width: 15px !important; height: 15px !important; }

/* --- Message Formatting --- */
.wlac-msg-bot .wlac-line {
    display: block;
    margin-bottom: 3px;
}

.wlac-msg-bot .wlac-heading {
    font-weight: 700;
    margin: 6px 0 3px;
    font-size: calc(var(--wlac-font-size) + 1px);
}

.wlac-msg-bot .wlac-list {
    margin: 4px 0 6px 0;
    padding-left: 18px;
}

.wlac-msg-bot ul.wlac-list {
    list-style-type: disc;
}

.wlac-msg-bot ol.wlac-list {
    list-style-type: decimal;
}

.wlac-msg-bot .wlac-list li {
    margin-bottom: 4px;
    line-height: 1.45;
}

.wlac-msg-bot a {
    color: var(--wlac-primary);
    text-decoration: underline;
    word-break: break-all;
}

.wlac-msg-bot a:hover {
    opacity: .8;
}

/* Powered by */
.wlac-powered {
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    margin: 0;
    padding: 4px 0 8px;
    flex-shrink: 0;
    line-height:18px;
}

/* --- Responsive --- */
@media (max-width: 420px) {
    .wlac-window {
        width: calc(100vw - 24px);
        right: -12px;
    }
    .wlac-widget {
        right: 12px;
        bottom: 16px;
    }
    .wlac-pos-bottom-left .wlac-window {
        left: -12px;
        right: auto;
    }
}
