/* =============================================================
   WhatsApp-Chat-Widget — Mike Hillebrand Media
   Nutzt bestehende Design-Tokens aus main.css (--primary, --font-sans, --z-*)
   ============================================================= */

.wa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1900;
    font-family: var(--font-sans);
}

.wa-widget__button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(229, 12, 126, 0.4);
    transition: transform var(--transition-fast, 0.2s ease), box-shadow var(--transition-fast, 0.2s ease);
}

.wa-widget__button:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 28px rgba(229, 12, 126, 0.55);
}

.wa-widget__button svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.wa-widget__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #34d399;
    border: 2px solid var(--bg-light, #fff);
}

.wa-widget__panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 340px;
    max-width: calc(100vw - 48px);
    background: var(--bg-light, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s var(--ease-out, ease), transform 0.22s var(--ease-out, ease);
}

.wa-widget.is-open .wa-widget__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wa-widget__header {
    background: var(--primary);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-widget__header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex: none;
}

.wa-widget__header-name { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.wa-widget__header-status { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.wa-widget__header-status::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: #34d399; display: inline-block;
}

.wa-widget__header-close {
    margin-left: auto;
    background: none; border: none; color: #fff; opacity: 0.85;
    cursor: pointer; font-size: 20px; line-height: 1; padding: 4px;
}
.wa-widget__header-close:hover { opacity: 1; }

.wa-widget__body {
    padding: 16px;
    background: #ECE5DD;
    min-height: 90px;
}
[data-theme="dark"] .wa-widget__body { background: #111b21; }

.wa-widget__bubble {
    background: #fff;
    color: #111;
    padding: 10px 13px;
    border-radius: 4px 14px 14px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 88%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
[data-theme="dark"] .wa-widget__bubble { background: #202c33; color: #e9edef; }

.wa-widget__form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-light, #fff);
    border-top: 1px solid var(--border, #e0e0e0);
}

.wa-widget__input {
    flex: 1;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 999px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    background: transparent;
    color: var(--text-dark, #000);
    outline: none;
}
.wa-widget__input:focus { border-color: var(--primary); }

.wa-widget__send {
    width: 38px; height: 38px; flex: none;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.wa-widget__send svg { width: 17px; height: 17px; fill: #fff; margin-left: 2px; }
.wa-widget__send:hover { background: var(--primary-dark, #c30a6a); }

@media (prefers-reduced-motion: reduce) {
    .wa-widget__panel, .wa-widget__button { transition: none; }
}
