/* ===== WIDGET CHAT WHATSAPP ===== */
#wa-chat-widget {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Bouton flottant --- */
#wa-chat-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(37,211,102,.5);
    position: relative;
    transition: transform .25s, box-shadow .25s;
    animation: wa-pulse 2.8s infinite;
    margin-left: auto;
}
#wa-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(37,211,102,.65);
    animation: none;
}
@keyframes wa-pulse {
    0%,100% { box-shadow: 0 4px 18px rgba(37,211,102,.5); }
    50%      { box-shadow: 0 4px 28px rgba(37,211,102,.8), 0 0 0 10px rgba(37,211,102,.1); }
}
.wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF1286;
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badge-bounce .6s ease 1.5s both;
}
@keyframes badge-bounce {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- Fenêtre popup --- */
#wa-chat-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(.85) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
#wa-chat-box.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.wa-chat-header {
    background: #075E54;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.wa-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
    position: relative;
}
.wa-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #25D366;
    border-radius: 50%;
    border: 2px solid #075E54;
}
.wa-chat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wa-chat-info strong { font-size: .93rem; }
.wa-chat-info span   { font-size: .75rem; opacity: .8; }
.wa-chat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color .2s;
}
.wa-chat-close-btn:hover { color: #fff; }

/* Corps */
.wa-chat-body {
    position: relative;
    min-height: 160px;
    padding: 16px;
    background: #ECE5DD;
}
.wa-chat-bg {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23b2b2b2' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: .5;
}
.wa-chat-messages { position: relative; display: flex; flex-direction: column; gap: 10px; }
.wa-msg {
    max-width: 85%;
    background: #fff;
    border-radius: 10px 10px 10px 0;
    padding: 10px 13px 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    position: relative;
    animation: msg-in .4s ease both;
}
.wa-msg--delay { animation-delay: .5s; opacity: 0; animation-fill-mode: both; }
@keyframes msg-in {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
.wa-msg p { margin: 0; font-size: .87rem; color: #111; line-height: 1.5; }
.wa-msg-time { display: block; font-size: .7rem; color: #999; text-align: right; margin-top: 4px; }
.wa-msg--out {
    background: #DCF8C6;
    border-radius: 10px 10px 0 10px;
    align-self: flex-end;
    margin-left: auto;
}
.wa-msg--out .wa-msg-time { color: #7a9e7a; }
.wa-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 10px 10px 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    width: fit-content;
}
.wa-typing span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: wa-typing-dot .9s infinite;
}
.wa-typing span:nth-child(2) { animation-delay: .15s; }
.wa-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes wa-typing-dot {
    0%,60%,100% { transform: translateY(0); }
    30%          { transform: translateY(-5px); }
}
.wa-cta-btn {
    display: block;
    text-align: center;
    background: #25D366;
    color: #fff !important;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: .83rem;
    margin-top: 10px;
    transition: background .2s;
}
.wa-cta-btn:hover { background: #1ebe5d; }

/* Footer / input */
.wa-chat-footer {
    background: #f0f0f0;
    padding: 10px 12px 8px;
    border-top: 1px solid #e0e0e0;
}
.wa-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 24px;
    padding: 6px 6px 6px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.wa-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: .88rem;
    background: transparent;
    color: #111;
}
#wa-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .2s;
}
#wa-send-btn:hover { background: #1ebe5d; }
.wa-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .7rem;
    color: #999;
    margin: 6px 0 0;
}

/* Responsive */
@media (max-width: 600px) {
    #wa-chat-widget { bottom: 78px; right: 16px; }
    #wa-chat-box    { width: calc(100vw - 40px); right: -6px; }
}
