/* Floating WhatsApp contact widget (ChatArmin-style) */
.mp-whatsapp-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mp-whatsapp-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: min(18.5rem, calc(100vw - 2.5rem));
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1.25rem 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.mp-whatsapp-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mp-whatsapp-panel-header {
    position: relative;
    padding-right: 2rem;
    margin-bottom: 0.25rem;
}

.mp-whatsapp-panel-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.mp-whatsapp-panel-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #6b7280;
}

.mp-whatsapp-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.mp-whatsapp-qr-wrap {
    margin: 1rem auto 0.75rem;
    width: fit-content;
    padding: 0.5rem;
    border: 4px solid #25d366;
    border-radius: 0.75rem;
    background: #fff;
}

.mp-whatsapp-qr-wrap img {
    display: block;
    width: 10.5rem;
    height: 10.5rem;
}

.mp-whatsapp-qr-hint {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.mp-whatsapp-chat-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 9999px;
    background: #25d366;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.mp-whatsapp-chat-link:hover {
    background: #1ebe57;
    color: #fff;
}

.mp-whatsapp-chat-link:focus-visible {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

.mp-whatsapp-fab {
    width: 3.75rem;
    height: 3.75rem;
    border: none;
    border-radius: 9999px;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.mp-whatsapp-fab:hover {
    background: #1ebe57;
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.mp-whatsapp-fab:focus-visible {
    outline: 2px solid #25d366;
    outline-offset: 3px;
}

.mp-whatsapp-fab.is-open {
    background: #128c7e;
}

.mp-whatsapp-fab svg {
    width: 1.75rem;
    height: 1.75rem;
    fill: currentColor;
}

@media (max-width: 640px) {
    .mp-whatsapp-widget {
        right: max(1rem, env(safe-area-inset-right, 0px));
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }

    .mp-whatsapp-fab {
        width: 3.5rem;
        height: 3.5rem;
    }

    .mp-whatsapp-fab svg {
        width: 1.625rem;
        height: 1.625rem;
    }

    /* Panel am Viewport verankern, nicht über Hero-Inhalt schweben */
    .mp-whatsapp-panel {
        position: fixed;
        right: max(1rem, env(safe-area-inset-right, 0px));
        bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 3.5rem + 0.625rem);
        left: auto;
        width: min(16.25rem, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
        padding: 0.875rem 0.875rem 0.75rem;
        border-radius: 0.875rem;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    }

    .mp-whatsapp-panel-header {
        padding-right: 0;
        margin-bottom: 0.625rem;
    }

    .mp-whatsapp-panel-title {
        font-size: 0.9375rem;
        padding-right: 0;
    }

    .mp-whatsapp-panel-subtitle {
        font-size: 0.8125rem;
        margin-top: 0.125rem;
    }

    .mp-whatsapp-badge {
        display: none;
    }

    .mp-whatsapp-qr-wrap,
    .mp-whatsapp-qr-hint {
        display: none;
    }

    .mp-whatsapp-chat-link--desktop-only {
        display: none;
    }

    .mp-whatsapp-chat-link--mobile-only {
        margin-top: 0;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 641px) {
    .mp-whatsapp-chat-link--mobile-only {
        display: none;
    }
}
