/* Explain: Styles for the WhatsApp sales bot widget. */
/* ---------- WhatsApp sales bot widget ---------- */
.wa-widget {
    position: fixed;
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 80;
}

.wa-panel [hidden] { display: none !important; }

.wa-fab {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    font-size: 1.7rem;
    color: #04140a;
    background: linear-gradient(150deg, #25d366, #128c7e);
    box-shadow: 0 16px 40px -14px rgba(37, 211, 102, 0.85);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wa-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 22px 48px -14px rgba(37, 211, 102, 1); }
.wa-fab:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 3px; }
.wa-fab .wa-fab-close { display: none; font-size: 1.5rem; }
.wa-widget.is-open .wa-fab .wa-fab-open { display: none; }
.wa-widget.is-open .wa-fab .wa-fab-close { display: block; }

.wa-fab-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -3px;
    display: grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    padding-inline: 0.3rem;
    border: 2px solid var(--background-color);
    border-radius: 999px;
    background: var(--accent-color);
    color: #04140a;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ---------- Panel ---------- */
.wa-panel {
    position: absolute;
    bottom: 74px;
    inset-inline-end: 0;
    display: none;
    flex-direction: column;
    width: min(90vw, 24rem);
    max-height: min(78vh, 34rem);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(20, 30, 46, 0.98), rgba(9, 14, 24, 0.99));
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.wa-widget.is-open .wa-panel { display: flex; animation: wa-pop 0.24s ease; }
@keyframes wa-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.wa-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 14, 24, 0.72);
}
.wa-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.3rem;
    color: #04140a;
    background: linear-gradient(150deg, #25d366, #128c7e);
}
.wa-head-info { display: flex; flex-direction: column; min-width: 0; }
.wa-head-name { font-weight: 700; font-size: 0.95rem; }
.wa-head-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: var(--accent-color);
}
.wa-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: pulse-ring 2s infinite;
}
.wa-close {
    margin-inline-start: auto;
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.wa-close:hover { color: var(--text-color); border-color: var(--primary-color); background: rgba(34, 211, 238, 0.09); }

.wa-feed {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 190px;
    padding: 1rem;
    overflow-y: auto;
}
.wa-bubble {
    max-width: 88%;
    padding: 0.65rem 0.95rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.wa-bubble.is-bot {
    align-self: flex-start;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-start-start-radius: 4px;
}
.wa-bubble.is-user {
    align-self: flex-end;
    color: #04140a;
    background: linear-gradient(180deg, #25d366, #12a05a);
    border-start-end-radius: 4px;
    font-weight: 600;
}
.wa-bubble.is-typing { display: inline-flex; align-items: center; gap: 0.3rem; padding-block: 0.8rem; }
.wa-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1.2s infinite ease-in-out;
}
.wa-dot:nth-child(2) { animation-delay: 0.18s; }
.wa-dot:nth-child(3) { animation-delay: 0.36s; }

.wa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}
.wa-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    min-height: 44px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-color);
    font-size: 0.83rem;
    font-weight: 500;
    text-align: start;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.wa-chip i { color: #25d366; flex: none; }
.wa-chip:hover { transform: translateY(-2px); border-color: #25d366; background: rgba(37, 211, 102, 0.1); }

.wa-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-top: 1px solid var(--border-color);
    background: rgba(9, 14, 24, 0.6);
}
.wa-input {
    flex: 1 1 auto;
    width: 100%;
    max-height: 7rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
}
.wa-input::placeholder { color: var(--text-dim); }
.wa-input:focus { outline: none; border-color: #25d366; background: rgba(37, 211, 102, 0.06); }
.wa-send {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    color: #04140a;
    background: linear-gradient(180deg, #25d366, #12a05a);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wa-send:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(37, 211, 102, 0.95); }

.wa-actions { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem 1rem; }
.wa-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.75rem 1.1rem;
    border: 0;
    border-radius: 12px;
    color: #04140a;
    font-weight: 700;
    font-size: 0.92rem;
    background: linear-gradient(180deg, #25d366, #12a05a);
    box-shadow: 0 14px 32px -14px rgba(37, 211, 102, 0.9);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wa-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 42px -14px rgba(37, 211, 102, 1); }
.wa-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.86rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.wa-call i { color: #25d366; }
.wa-call:hover { border-color: #25d366; background: rgba(37, 211, 102, 0.1); }
.wa-reset {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.35rem;
}
.wa-reset:hover { color: var(--primary-color); }

@media (prefers-reduced-motion: reduce) {
    .wa-widget.is-open .wa-panel { animation: none; }
    .wa-dot, .wa-online-dot { animation: none; }
}