/* =====================================================
   86Leads — WhatsApp Chat Widget
   ===================================================== */

/* ── CSS bridge: scoped reset, prevents theme bleed ─────────────────────────
   Themes frequently override box-sizing, line-height, button/anchor styles,
   and font stacks. Scoping these to our root class keeps the widget isolated
   without touching anything else on the page.
   ─────────────────────────────────────────────────────────────────────────── */
.leads86-wa,
.leads86-wa *,
.leads86-wa *::before,
.leads86-wa *::after {
    box-sizing: border-box !important;
}

:root {
    --wa-color: #25d366;
}

.leads86-wa {
    position: fixed !important;
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.leads86-wa--bottom-right { bottom: 24px !important; right: 24px !important; }
.leads86-wa--bottom-left  { bottom: 24px !important; left: 24px !important; }

@media (max-width: 767px) {
    .leads86-wa--hide-mobile { display: none !important; }
    .leads86-wa--bottom-right { bottom: 16px !important; right: 16px !important; }
    .leads86-wa--bottom-left  { bottom: 16px !important; left: 16px !important; }
}

/* ------ Floating button ------ */

.leads86-wa__btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--wa-color) !important;
    border: none !important;
    outline: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    color: #fff !important;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0 !important;
    margin: 0;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

.leads86-wa__btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    background: var(--wa-color) !important;
    color: #fff !important;
}

.leads86-wa__btn-icon--close {
    display: none;
    font-size: 28px;
    line-height: 1;
    margin-top: -2px;
}

.leads86-wa--open .leads86-wa__btn-icon--open  { display: none; }
.leads86-wa--open .leads86-wa__btn-icon--close { display: block; }

/* ------ Popup panel ------ */

.leads86-wa__panel {
    position: absolute !important;
    bottom: 70px;
    width: 320px;
    background: #fff !important;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.leads86-wa--bottom-right .leads86-wa__panel { right: 0; }
.leads86-wa--bottom-left  .leads86-wa__panel { left: 0; }

.leads86-wa--open .leads86-wa__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ------ Panel header ------ */

.leads86-wa__panel-header {
    background: var(--wa-color) !important;
    color: #fff !important;
    padding: 16px 16px 14px;
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: none;
}

.leads86-wa__header-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.leads86-wa__header-text {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    gap: 2px;
}

.leads86-wa__header-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff !important;
    margin: 0;
    padding: 0;
}

.leads86-wa__header-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
    padding: 0;
}

.leads86-wa__header-status--open  { color: #d4ffd4 !important; }
.leads86-wa__header-status--closed { color: #ffe0e0 !important; }

.leads86-wa__close {
    background: none !important;
    border: none !important;
    outline: none;
    color: #fff !important;
    font-size: 22px;
    cursor: pointer;
    padding: 0 !important;
    margin: 0;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.leads86-wa__close:hover { opacity: 1; }

/* ------ Greeting ------ */

.leads86-wa__greeting {
    padding: 14px 16px 10px;
    background: #f0f9f3 !important;
    border-bottom: 1px solid #e0f0e6 !important;
    margin: 0;
}

.leads86-wa__greeting p {
    margin: 0 !important;
    font-size: 0.875rem;
    color: #333 !important;
    line-height: 1.5;
    padding: 0;
}

/* ------ Agents ------ */

.leads86-wa__agents {
    padding: 8px 0;
    margin: 0;
}

.leads86-wa__agent {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent;
    margin: 0;
    outline: none;
}

.leads86-wa__agent:last-child { border-bottom: none !important; }

.leads86-wa__agent:hover {
    background: #f8fffe !important;
    text-decoration: none !important;
    color: inherit !important;
}

.leads86-wa__avatar {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none !important;
}

.leads86-wa__avatar--initials {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50%;
    background: var(--wa-color) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    margin: 0;
}

.leads86-wa__agent-info {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.leads86-wa__agent-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a !important;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

.leads86-wa__agent-cta {
    font-size: 0.78rem;
    color: #25d366 !important;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

.leads86-wa__agent-wa {
    flex-shrink: 0;
    opacity: 0.7;
}

.leads86-wa__agent:hover .leads86-wa__agent-wa { opacity: 1; }
