/* Explain: Styles for the floating WhatsApp chat widget. */
/* Floating WhatsApp chat widget — shown in the corner of every page */
.wa-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    pointer-events: none;
}

.wa-widget > * {
    pointer-events: auto;
}

/* The panel is shown from this one class only, so its display never fights a utility class */
.wa-panel {
    display: none;
    width: min(21rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--surface-color);
    box-shadow: 0 18px 40px -14px rgba(15, 23, 42, 0.4);
}

.wa-panel.is-open {
    display: block;
    animation: wa-pop 0.18s ease-out;
}

@keyframes wa-pop {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.wa-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--whatsapp-dark);
    padding: 0.85rem 1rem;
    color: #ffffff;
}

.wa-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.15rem;
}

.wa-dot {
    display: inline-block;
    height: 0.45rem;
    width: 0.45rem;
    border-radius: 9999px;
    background: var(--whatsapp-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.wa-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wa-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.wa-panel-body {
    padding: 1rem;
    background: var(--background-color);
}

.wa-bubble {
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem 0.9rem 0.9rem 0.25rem;
    background: var(--surface-color);
    padding: 0.7rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-color);
}

.wa-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    border-radius: 0.6rem;
    background: var(--whatsapp-color);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--whatsapp-deep);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.wa-start:hover,
.wa-start:focus-visible {
    background: var(--whatsapp-dark);
    color: #ffffff;
}

.wa-call {
    display: block;
    margin-top: 0.6rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wa-call:hover {
    color: var(--primary-color);
}

.wa-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    width: 3.5rem;
    border: 0;
    border-radius: 9999px;
    background: var(--whatsapp-color);
    color: #ffffff;
    font-size: 1.85rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 26px -10px rgba(7, 94, 84, 0.9);
    transition: transform 0.2s ease, background 0.2s ease;
}

.wa-toggle:hover {
    transform: translateY(-2px);
    background: var(--whatsapp-dark);
}

.wa-toggle:focus-visible {
    outline: 3px solid var(--whatsapp-dark);
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .wa-widget {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}