﻿/* Zaffro Chat Widget */
:root {
    --zaffro-primary:     #17817C;
    --zaffro-primary-rgb: 23,129,124;
    --zaffro-primary-dk:  #126962;
}

#zaffro-chat-widget {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: fit-content !important;
    min-width: 220px !important;
}

/* Toggle gomb — card launcher */
.zaffro-toggle {
    width: 100% !important;
    min-width: 220px !important;
    height: auto !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #1a1a2e !important;
    border: none !important;
    cursor: pointer !important;
    padding: 10px 18px 10px 10px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08) !important;
    transition: transform .2s, box-shadow .2s;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}
.zaffro-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.10) !important;
}
/* Launcher belső elrendezés */
.zaffro-icon-open {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    overflow: visible !important;
    width: 100% !important;
}
.zaffro-launcher-logo {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.zaffro-launcher-logo img,
.zaffro-launcher-logo svg {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    display: block !important;
}
.zaffro-launcher-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    text-align: left !important;
    overflow: visible !important;
    flex: 1 !important;
}
.zaffro-launcher-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: block !important;
}
.zaffro-launcher-sub {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: block !important;
}
/* Bezárás állapot */
.zaffro-icon-close {
    display: none;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.zaffro-close-x {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 50%;
    flex-shrink: 0;
}
.zaffro-close-tagline {
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.3;
    text-align: left;
    flex: 1;
}
.zaffro-widget.is-open .zaffro-icon-open { display: none !important; }
.zaffro-widget.is-open .zaffro-icon-close { display: flex !important; }

/* Chat ablak */
.zaffro-window {
    display: none;
    flex-direction: column;
    width: 340px;
    max-height: 520px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    overflow: hidden;
    margin-bottom: 12px;
    position: absolute;
    bottom: 80px;
    right: 0;
    animation: zaffroSlideIn .2s ease;
}
.zaffro-widget.is-open .zaffro-window { display: flex; }

@keyframes zaffroSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.zaffro-header {
    background: var(--zaffro-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.zaffro-avatar { font-size: 24px; }
.zaffro-avatar-img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; background: rgba(255,255,255,.15); }
.zaffro-header-info strong { display: block; font-size: 15px; }
.zaffro-status { font-size: 11px; opacity: .85; }
.zaffro-status::before {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #6ef06e;
    margin-right: 4px;
    vertical-align: middle;
}

/* Üzenetek */
.zaffro-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.zaffro-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.zaffro-bubble--agent {
    background: #f2f2f2;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.zaffro-bubble--user {
    background: var(--zaffro-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Gépelés animáció */
.zaffro-typing span {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #888;
    animation: zaffroDot .8s infinite;
    margin: 0 2px;
}
.zaffro-typing span:nth-child(2) { animation-delay: .15s; }
.zaffro-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes zaffroDot {
    0%, 80%, 100% { transform: scale(.6); opacity: .5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input */
.zaffro-input-row {
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    gap: 8px;
}
#zaffroInput {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
#zaffroInput:focus { border-color: var(--zaffro-primary); }

#zaffroSend {
    background: var(--zaffro-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 38px; height: 38px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}
#zaffroSend:hover { background: var(--zaffro-primary-dk); }
#zaffroSend:disabled { background: #aaa; cursor: not-allowed; }

/* Footer */
.zaffro-footer {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 6px;
    border-top: 1px solid #f0f0f0;
}
.zaffro-footer a { color: var(--zaffro-primary); text-decoration: none; }

/* Mobilon — reszponzív kártya launcher */
@media (max-width: 600px) {
    #zaffro-chat-widget {
        bottom: 16px !important;
        right: 16px !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
    }
    .zaffro-toggle {
        min-width: 0 !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        padding: 8px 12px 8px 8px !important;
        overflow: hidden !important;
    }
    .zaffro-icon-open {
        overflow: hidden !important;
    }
    .zaffro-launcher-logo {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0 !important;
    }
    .zaffro-launcher-logo img,
    .zaffro-launcher-logo svg {
        width: 34px !important;
        height: 34px !important;
    }
    .zaffro-launcher-title {
        font-size: 13px !important;
    }
    .zaffro-launcher-sub {
        font-size: 11px !important;
    }
    .zaffro-icon-close {
        max-width: calc(100vw - 48px) !important;
        overflow: hidden !important;
    }
    .zaffro-close-tagline {
        font-size: 12px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    .zaffro-window {
        width: calc(100vw - 32px) !important;
        right: 0 !important;
        bottom: 72px !important;
        max-height: 75vh !important;
    }
}

/* Rendelés gomb */
.zaffro-checkout-wrap {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zaffro-deal-summary {
    background: #f5f5f5;
    border: 1.5px solid var(--zaffro-primary);
    border-radius: 10px;
    padding: 10px 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}
.zaffro-deal-summary strong { color: var(--zaffro-primary); font-size: 14px; }
.zaffro-deal-summary code {
    background: #dff0df;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #1a5c1a;
    font-weight: 600;
    letter-spacing: .05em;
}

.zaffro-checkout-btn {
    display: block;
    background: var(--zaffro-primary);
    color: #fff !important;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .2s, transform .1s;
    box-shadow: 0 2px 8px rgba(var(--zaffro-primary-rgb),.25);
}
.zaffro-checkout-btn:hover {
    background: var(--zaffro-primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--zaffro-primary-rgb),.35);
}

.zaffro-checkout-note {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}
