/* ============================================
   Valentine WhatsApp Chat Widget v2
   Classi ultra-specifiche vwac__ per evitare conflitti
   Tutti i valori con !important
   ============================================ */

#vwac__root,
#vwac__root *,
#vwac__root *::before,
#vwac__root *::after {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    line-height: normal !important;
    text-decoration: none !important;
    list-style: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: left !important;
    float: none !important;
    clear: none !important;
    background-image: none !important;
}

/* ---- FAB Button ---- */
#vwac__fab {
    position: fixed !important;
    bottom: 90px !important;
    right: 22px !important;
    z-index: 2147483640 !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    -webkit-border-radius: 50% !important;
    background-color: #25D366 !important;
    background-image: none !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    overflow: hidden !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    text-indent: 0 !important;
}

#vwac__fab:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55) !important;
    background-color: #25D366 !important;
}

#vwac__fab:active {
    transform: scale(0.95) !important;
}

#vwac__fab svg.vwac__svg {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    fill: #ffffff !important;
    display: block !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
    position: relative !important;
    background: transparent !important;
}

#vwac__fab svg.vwac__icon-close {
    position: absolute !important;
    opacity: 0 !important;
    transform: rotate(-90deg) scale(0.5) !important;
    width: 22px !important;
    height: 22px !important;
}

#vwac__fab.vwac__is-open svg.vwac__icon-wa {
    opacity: 0 !important;
    transform: rotate(90deg) scale(0.5) !important;
}

#vwac__fab.vwac__is-open svg.vwac__icon-close {
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}

/* Pulse */
#vwac__fab .vwac__pulse {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    background-color: #25D366 !important;
    animation: vwac__kf-pulse 2.2s ease-out infinite !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

#vwac__fab.vwac__is-open .vwac__pulse {
    animation: none !important;
    opacity: 0 !important;
}

@keyframes vwac__kf-pulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* ---- Proactive Bubble ---- */
#vwac__bubble {
    position: fixed !important;
    bottom: 158px !important;
    right: 22px !important;
    z-index: 2147483639 !important;
    width: 290px !important;
    max-width: calc(100vw - 40px) !important;
    background-color: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 28px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06) !important;
    padding: 14px 16px !important;
    cursor: pointer !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    display: none !important;
}

#vwac__bubble.vwac__show {
    display: block !important;
    animation: vwac__kf-bubIn 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards !important;
}

#vwac__bubble.vwac__bye {
    animation: vwac__kf-bubOut 0.25s ease forwards !important;
}

@keyframes vwac__kf-bubIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes vwac__kf-bubOut {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(8px) scale(0.96); }
}

#vwac__bubble .vwac__bub-x {
    position: absolute !important;
    top: 4px !important;
    right: 8px !important;
    background: transparent !important;
    font-size: 16px !important;
    color: #aaa !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
}
#vwac__bubble .vwac__bub-x:hover { color: #555 !important; }

#vwac__bubble .vwac__bub-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
}

.vwac__av {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #C9A96E, #A8873F) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.vwac__av-l {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-align: center !important;
    background: transparent !important;
}

#vwac__bubble .vwac__bub-nm {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    display: block !important;
    margin-bottom: 2px !important;
    background: transparent !important;
}

#vwac__bubble .vwac__bub-tx {
    font-size: 13.5px !important;
    color: #444444 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* ---- Chat Panel ---- */
#vwac__panel {
    position: fixed !important;
    bottom: 158px !important;
    right: 22px !important;
    z-index: 2147483639 !important;
    width: 355px !important;
    max-width: calc(100vw - 32px) !important;
    background-color: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 2px 10px rgba(0,0,0,0.06) !important;
    overflow: hidden !important;
    display: none !important;
}

#vwac__panel.vwac__show {
    display: block !important;
    animation: vwac__kf-panIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards !important;
}

#vwac__panel.vwac__bye {
    animation: vwac__kf-panOut 0.25s ease forwards !important;
}

@keyframes vwac__kf-panIn {
    0% { opacity: 0; transform: translateY(16px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes vwac__kf-panOut {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(16px) scale(0.96); }
}

/* Header */
#vwac__panel .vwac__ph {
    background: linear-gradient(135deg, #1a1a1a 0%, #282828 100%) !important;
    padding: 16px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#vwac__panel .vwac__ph-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#vwac__panel .vwac__dot {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: #25D366 !important;
    border: 2px solid #1a1a1a !important;
}

#vwac__panel .vwac__ph-nm {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: block !important;
    background: transparent !important;
}

#vwac__panel .vwac__ph-rl {
    color: #D4BA8A !important;
    font-size: 11.5px !important;
    display: block !important;
    margin-top: 1px !important;
    font-weight: 400 !important;
    background: transparent !important;
}

#vwac__panel .vwac__ph-x {
    background: transparent !important;
    color: rgba(255,255,255,0.5) !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 4px 6px !important;
    line-height: 1 !important;
}
#vwac__panel .vwac__ph-x:hover { color: #ffffff !important; }

/* Body */
#vwac__panel .vwac__pb {
    padding: 18px 16px !important;
    background-color: #f5f1eb !important;
}

#vwac__panel .vwac__m {
    background-color: #ffffff !important;
    border-radius: 4px 12px 12px 12px !important;
    padding: 12px 14px !important;
    max-width: 88% !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    margin-bottom: 14px !important;
    animation: vwac__kf-msg 0.4s 0.15s ease both !important;
}

@keyframes vwac__kf-msg {
    0% { opacity: 0; transform: translateX(-8px); }
    100% { opacity: 1; transform: translateX(0); }
}

#vwac__panel .vwac__m p {
    font-size: 13.5px !important;
    color: #333333 !important;
    line-height: 1.5 !important;
    margin: 0 0 5px 0 !important;
    background: transparent !important;
}

#vwac__panel .vwac__m p:last-of-type {
    margin-bottom: 6px !important;
}

#vwac__panel .vwac__m strong {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

#vwac__panel .vwac__m-t {
    font-size: 10.5px !important;
    color: #999999 !important;
    display: block !important;
    background: transparent !important;
}

/* Quick Replies */
#vwac__panel .vwac__qr {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    animation: vwac__kf-msg 0.4s 0.4s ease both !important;
}

#vwac__panel .vwac__qr button {
    background-color: #ffffff !important;
    border: 1.5px solid #D4BA8A !important;
    border-radius: 18px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    color: #A8873F !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-weight: 500 !important;
}

#vwac__panel .vwac__qr button:hover {
    background-color: #C9A96E !important;
    color: #ffffff !important;
    border-color: #C9A96E !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(201,169,110,0.3) !important;
}

/* Footer */
#vwac__panel .vwac__pf {
    padding: 12px 16px !important;
    background-color: #ffffff !important;
    border-top: 1px solid rgba(0,0,0,0.06) !important;
}

#vwac__panel .vwac__go {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 12px !important;
    background-color: #25D366 !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 3px 10px rgba(37,211,102,0.3) !important;
    text-align: center !important;
}

#vwac__panel .vwac__go:hover {
    background-color: #1EBE5A !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 16px rgba(37,211,102,0.4) !important;
    color: #ffffff !important;
}

#vwac__panel .vwac__go svg.vwac__svg {
    width: 18px !important;
    height: 18px !important;
    fill: #ffffff !important;
}

#vwac__panel .vwac__go span {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: transparent !important;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    #vwac__fab {
        bottom: 80px !important;
        right: 14px !important;
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 50px !important;
        max-height: 50px !important;
    }

    #vwac__fab svg.vwac__svg { width: 24px !important; height: 24px !important; }

    #vwac__bubble {
        bottom: 142px !important;
        right: 14px !important;
        left: 14px !important;
        width: auto !important;
    }

    #vwac__panel {
        bottom: 142px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
    }
}
