/* ═══════════════════════════════════════════════
   Sticky WhatsApp Chat Widget v2.2
   Original WhatsApp Farben – !important Override
   Hohe Spezifität gegen Elementor/Theme Overrides
   ═══════════════════════════════════════════════ */

/* Full Reset innerhalb des Widgets */
#swc,
#swc *,
#swc *::before,
#swc *::after {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    text-decoration: none !important;
    list-style: none !important;
    float: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    filter: none !important;
}

#swc {
    position: fixed !important;
    bottom: 24px !important;
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased !important;
    direction: ltr !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    background: transparent !important;
    display: block !important;
}

#swc.swc--right { right: 24px !important; left: auto !important; }
#swc.swc--left  { left: 24px !important; right: auto !important; }

/* ═══════════════════
   FAB
   ═══════════════════ */
#swc .swc__fab {
    position: relative !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    background: #25D366 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.14), 0 6px 20px rgba(0,0,0,.10) !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    z-index: 2 !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #fff !important;
}

#swc .swc__fab:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.16), 0 8px 28px rgba(0,0,0,.13) !important;
    background: #25D366 !important;
}

#swc .swc__fab:active {
    transform: scale(.97) !important;
}

#swc .swc__fab:focus {
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.14), 0 6px 20px rgba(0,0,0,.10) !important;
}

/* Icons */
#swc .swc__fab-ico {
    position: absolute !important;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease !important;
    display: block !important;
    fill: #fff !important;
}

#swc .swc__fab-ico--wa {
    opacity: 1 !important;
    transform: scale(1) rotate(0deg) !important;
}

#swc .swc__fab-ico--x {
    opacity: 0 !important;
    transform: scale(.6) rotate(-90deg) !important;
}

#swc.is-open .swc__fab-ico--wa {
    opacity: 0 !important;
    transform: scale(.6) rotate(90deg) !important;
}

#swc.is-open .swc__fab-ico--x {
    opacity: 1 !important;
    transform: scale(1) rotate(0deg) !important;
}

/* ═══════════════════
   Badge
   ═══════════════════ */
#swc .swc__badge {
    position: absolute !important;
    top: -3px !important;
    z-index: 3 !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 6px !important;
    border-radius: 10px !important;
    background: #ff3b30 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    text-align: center !important;
    box-shadow: 0 1px 4px rgba(255,59,48,.35) !important;
    pointer-events: none !important;
    display: block !important;
}

#swc.swc--right .swc__badge { right: -2px !important; }
#swc.swc--left  .swc__badge { left: -2px !important; }
#swc.is-open .swc__badge { display: none !important; }

/* ═══════════════════
   Tooltip
   ═══════════════════ */
#swc .swc__tooltip {
    position: absolute !important;
    bottom: 16px !important;
    white-space: nowrap !important;
    background: #fff !important;
    color: #111b21 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.10) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transform: translateY(4px) !important;
    transition: opacity .25s ease, transform .25s ease !important;
    z-index: 1 !important;
}

#swc.swc--right .swc__tooltip { right: 74px !important; }
#swc.swc--left  .swc__tooltip { left: 74px !important; }

#swc .swc__tooltip::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: 6px solid transparent !important;
    background: transparent !important;
}

#swc.swc--right .swc__tooltip::after { right: -12px !important; border-left-color: #fff !important; }
#swc.swc--left  .swc__tooltip::after { left: -12px !important; border-right-color: #fff !important; }

#swc.show-tooltip .swc__tooltip { opacity: 1 !important; transform: translateY(0) !important; }
#swc.is-open .swc__tooltip { opacity: 0 !important; }

/* ═══════════════════
   Popup
   ═══════════════════ */
#swc .swc__popup {
    position: absolute !important;
    bottom: 76px !important;
    width: 370px !important;
    max-width: calc(100vw - 48px) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,.03), 0 4px 12px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.14) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(12px) scale(.96) !important;
    transition: opacity .25s ease, transform .25s cubic-bezier(.4,0,.2,1), visibility .25s !important;
}

#swc.swc--right .swc__popup { right: 0 !important; transform-origin: bottom right !important; }
#swc.swc--left  .swc__popup { left: 0 !important; transform-origin: bottom left !important; }

#swc.is-open .swc__popup {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* ── Header – #075e54 WhatsApp Teal ── */
#swc .swc__header {
    background: #075e54 !important;
    padding: 16px 14px 16px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    border-radius: 0 !important;
}

#swc .swc__header-left {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
}

#swc .swc__avatar {
    position: relative !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

#swc .swc__avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

#swc .swc__dot {
    position: absolute !important;
    bottom: 1px !important;
    right: 1px !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: #25D366 !important;
    border: 2px solid #075e54 !important;
    z-index: 1 !important;
}

#swc .swc__meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    min-width: 0 !important;
}

#swc .swc__name {
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
}

#swc .swc__sub {
    color: rgba(255,255,255,.65) !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
}

#swc .swc__close {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: rgba(255,255,255,.7) !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color .15s !important;
    padding: 0 !important;
}

#swc .swc__close:hover {
    color: #fff !important;
    background: none !important;
}

/* ── Body – #efeae2 WhatsApp Chat BG ── */
#swc .swc__body {
    background-color: #efeae2 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cdefs%3E%3Cpattern id='a' width='30' height='30' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Ccircle cx='15' cy='15' r='.8' fill='%23d6cebf' opacity='.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='300' height='300' fill='%23efeae2'/%3E%3Crect width='300' height='300' fill='url(%23a)'/%3E%3C/svg%3E") !important;
    padding: 18px 14px !important;
    min-height: 90px !important;
}

/* Message */
#swc .swc__msg {
    display: flex !important;
    align-items: flex-end !important;
    gap: 6px !important;
    animation: swcFadeIn .3s ease both !important;
}

#swc.is-open .swc__msg {
    animation-delay: .1s !important;
}

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

#swc .swc__msg-avatar {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-radius: 50% !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.08) !important;
}

#swc .swc__msg-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Bubble */
#swc .swc__bubble {
    position: relative !important;
    background: #fff !important;
    padding: 6px 10px 4px !important;
    border-radius: 0 8px 8px 8px !important;
    max-width: 82% !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.06) !important;
    display: flex !important;
    flex-direction: column !important;
}

#swc .swc__bubble::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -6px !important;
    border-style: solid !important;
    border-width: 0 7px 7px 0 !important;
    border-color: transparent #fff transparent transparent !important;
    background: transparent !important;
}

#swc .swc__bubble-name {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #075e54 !important;
    margin-bottom: 1px !important;
    background: transparent !important;
}

#swc .swc__bubble-text {
    color: #111b21 !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
    background: transparent !important;
}

#swc .swc__bubble-time {
    align-self: flex-end !important;
    font-size: 10.5px !important;
    color: #667781 !important;
    margin-top: 3px !important;
    background: transparent !important;
}

/* ── Footer – #f0f2f5 ── */
#swc .swc__footer {
    background: #f0f2f5 !important;
    padding: 8px 10px 10px !important;
}

#swc .swc__input-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#swc .swc__input {
    flex: 1 !important;
    height: 40px !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    background: #fff !important;
    color: #111b21 !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
    transition: box-shadow .15s !important;
    width: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#swc .swc__input::placeholder {
    color: #667781 !important;
}

#swc .swc__input:focus {
    box-shadow: 0 0 0 1.5px #128c7e, 0 1px 2px rgba(0,0,0,.05) !important;
    background: #fff !important;
    border: none !important;
    outline: none !important;
}

#swc .swc__send {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    background: #075e54 !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform .15s, background .15s !important;
    padding: 0 !important;
}

#swc .swc__send:hover {
    background: #128c7e !important;
    transform: scale(1.05) !important;
    color: #fff !important;
}

#swc .swc__send:active {
    transform: scale(.95) !important;
}

#swc .swc__send:focus {
    outline: none !important;
    background: #075e54 !important;
}

/* ═══════════════════
   Responsive
   ═══════════════════ */
@media (max-width: 480px) {
    #swc { bottom: 16px !important; }
    #swc.swc--right { right: 16px !important; }
    #swc.swc--left  { left: 16px !important; }

    #swc .swc__fab { width: 56px !important; height: 56px !important; min-width: 56px !important; min-height: 56px !important; }
    #swc .swc__fab-ico--wa { width: 26px !important; height: 26px !important; }

    #swc .swc__popup {
        width: calc(100vw - 32px) !important;
        bottom: 70px !important;
        border-radius: 10px !important;
    }

    #swc.swc--right .swc__popup { right: -8px !important; }
    #swc.swc--left  .swc__popup { left: -8px !important; }

    #swc .swc__header { padding: 14px 12px 14px 14px !important; }
    #swc .swc__body   { padding: 14px 10px !important; }
}

@media (max-width: 768px) {
    #swc.swc--no-mobile { display: none !important; }
}

@media print {
    #swc { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    #swc .swc__popup { transition-duration: .01s !important; }
    #swc .swc__fab-ico { transition-duration: .01s !important; }
    #swc .swc__msg { animation: none !important; }
}
