/* ZenVia Shop Assistant - floating customer chatbot widget */

/* Stacked above the peptide-quiz FAB (store/_peptide_quiz_modal.html),
   which occupies the same right:24px/bottom:24px corner. */
#zenvia-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgb(168, 202, 126);
    color: #fff;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1050;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#zenvia-chat-launcher:hover {
    background-color: #3A6EA5;
    transform: scale(1.05);
}

#zenvia-chat-launcher .zenvia-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: none;
}

#zenvia-chat-window {
    position: fixed;
    right: 24px;
    bottom: 168px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1050;
    font-family: 'Inter', sans-serif;
}

#zenvia-chat-window.zenvia-open {
    display: flex;
}

#zenvia-chat-header {
    background-color: rgb(168, 202, 126);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#zenvia-chat-header .zenvia-chat-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#zenvia-chat-header .zenvia-chat-subtitle {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 400;
}

#zenvia-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

#zenvia-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background-color: #f7f9f4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zenvia-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.87rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.zenvia-msg-assistant {
    align-self: flex-start;
    background-color: #eef1e9;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.zenvia-msg-user {
    align-self: flex-end;
    background-color: rgb(168, 202, 126);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.zenvia-msg-error {
    align-self: flex-start;
    background-color: #f8d7da;
    color: #842029;
    border-bottom-left-radius: 4px;
}

.zenvia-msg-link {
    color: #3A6EA5;
    font-weight: 600;
    text-decoration: underline;
}

.zenvia-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 10px 13px;
    background-color: #eef1e9;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.zenvia-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8a9a7c;
    animation: zenvia-bounce 1.2s infinite ease-in-out;
}

.zenvia-typing span:nth-child(2) { animation-delay: 0.15s; }
.zenvia-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes zenvia-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-4px); opacity: 1; }
}

#zenvia-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e9ecef;
    background: #fff;
    flex-shrink: 0;
}

#zenvia-chat-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.87rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

#zenvia-chat-input:focus {
    border-color: rgb(168, 202, 126);
}

#zenvia-chat-send {
    background-color: rgb(168, 202, 126);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

#zenvia-chat-send:hover {
    background-color: #3A6EA5;
}

#zenvia-chat-send:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 576px) {
    /* peptide-quiz FAB moves to right:16px/bottom:16px at this breakpoint
       (store/css/peptide_quiz.css) -- stay stacked above it. */
    #zenvia-chat-window {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 84px;
    }
    #zenvia-chat-launcher {
        right: 16px;
        bottom: 84px;
    }
}
