#woobot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#woobot-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#woobot-label {
    background: #2271b1;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    pointer-events: none;
    letter-spacing: .2px;
}

#woobot-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(34,113,177,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
    animation: woobot-pulse 2.5s ease-in-out infinite;
}

@keyframes woobot-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(34,113,177,.5); }
    50%       { box-shadow: 0 4px 28px rgba(34,113,177,.85), 0 0 0 8px rgba(34,113,177,.12); }
}

#woobot-toggle:hover {
    background: #135e96;
    transform: scale(1.07);
    animation: none;
}

#woobot-chat-window {
    width: 340px;
    max-width: calc(100vw - 48px);
    /* fereastra stă în jumătatea de jos a ecranului, fără să depășească viewport-ul */
    max-height: min(50vh, calc(100vh - 175px));
    min-height: 260px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    background: #fff;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    animation: woobot-fadein .2s ease;
}

@keyframes woobot-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#woobot-header {
    background: #2271b1;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
}

#woobot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

#woobot-new,
#woobot-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
    opacity: .7;
    transition: opacity .15s;
}

#woobot-new:hover,
#woobot-close:hover { opacity: 1; }

#woobot-messages {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
}

.woobot-msg {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.woobot-msg.bot {
    background: #e8f0fe;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.woobot-msg.user {
    background: #2271b1;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.woobot-msg.typing {
    background: #e8f0fe;
    color: #888;
    align-self: flex-start;
    font-style: italic;
    font-size: 13px;
}

.woobot-msg.bot a {
    color: #1a56db;
    word-break: break-all;
    text-decoration: underline;
}

/* Quick replies */
.woobot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 4px;
    align-self: flex-start;
    max-width: 100%;
}
.woobot-qr-btn {
    background: #fff;
    border: 1.5px solid #2271b1;
    color: #2271b1;
    border-radius: 16px;
    padding: 5px 13px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.woobot-qr-btn:hover {
    background: #2271b1;
    color: #fff;
}

.woobot-products {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
    align-self: stretch;
}

/* Wrapper produs (card + formular notificare) */
.woobot-product-item {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.woobot-product-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid #d0e4f7;
    border-left: 3px solid #2271b1;
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}

.woobot-product-card:hover {
    background: #eef5fc;
    border-left-color: #135e96;
}

.woobot-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.woobot-product-price {
    font-size: 13px;
    color: #2271b1;
    font-weight: 600;
}

.woobot-product-stock {
    font-size: 11.5px;
}

.woobot-product-stock.instock    { color: #2e7d32; }
.woobot-product-stock.outofstock { color: #c62828; }

/* Formular notificare stoc */
.woobot-notify-wrap {
    display: flex;
    gap: 5px;
    padding: 6px 10px;
    background: #fafafa;
    border: 1px solid #d0e4f7;
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.woobot-notify-email {
    flex: 1;
    min-width: 0;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    outline: none;
    transition: border-color .2s;
}
.woobot-notify-email:focus   { border-color: #2271b1; }
.woobot-notify-email.error   { border-color: #c62828; }
.woobot-notify-btn {
    background: #e8f0fe;
    border: 1px solid #2271b1;
    color: #2271b1;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.woobot-notify-btn:hover { background: #2271b1; color: #fff; }
.woobot-notify-ok {
    font-size: 12px;
    color: #2e7d32;
    padding: 2px 0;
}
.woobot-notify-info {
    font-size: 11.5px;
    color: #888;
    padding: 2px 0;
}

#woobot-input-area {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}

#woobot-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

#woobot-input:focus { border-color: #2271b1; }

#woobot-send {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: background .2s;
    white-space: nowrap;
}

#woobot-send:hover { background: #135e96; }
#woobot-send:disabled { background: #aaa; cursor: not-allowed; }

/* ─── Mobile (≤ 767px) ──────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Container mai aproape de colț pe mobil */
    #woobot-container {
        bottom: 16px;
        right: 16px;
    }

    /* Toggle mai vizibil: inel alb + umbră mai puternică */
    #woobot-toggle {
        width: 60px;
        height: 60px;
        font-size: 26px;
        box-shadow: 0 4px 20px rgba(34,113,177,.7), 0 0 0 3px #fff;
    }

    /* Puls mai pronunțat pe mobil */
    @keyframes woobot-pulse {
        0%, 100% {
            box-shadow: 0 4px 20px rgba(34,113,177,.7), 0 0 0 3px #fff;
        }
        50% {
            box-shadow: 0 4px 32px rgba(34,113,177,.95), 0 0 0 3px #fff,
                        0 0 0 10px rgba(34,113,177,.15);
        }
    }

    /* Etichetă mai proeminentă */
    #woobot-label {
        font-size: 12.5px;
        padding: 6px 14px;
        box-shadow: 0 2px 10px rgba(0,0,0,.25);
    }

    /* Fereastra chat — aproape fullscreen pe mobil */
    #woobot-chat-window {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 90px;   /* lasă spațiu pentru toggle + launcher */
        width: auto;
        max-width: none;
        max-height: none;
        min-height: 0;
        height: auto;
        border-radius: 14px;
        margin-bottom: 0;
    }

    /* Zona de mesaje umple toată fereastra disponibilă */
    #woobot-messages {
        min-height: 0;
    }

    /* Header ușor mai compact */
    #woobot-header {
        padding: 10px 14px;
        font-size: 13.5px;
    }

    /* Input area mai compactă */
    #woobot-input-area {
        padding: 8px 10px;
    }

    #woobot-input {
        font-size: 16px; /* previne zoom automat pe iOS */
    }

    #woobot-send {
        padding: 7px 14px;
        font-size: 13px;
    }
}
