/* =========================================================
   SPIRE DIMENSIONS - WHATSAPP POPUP
   Loaded only on Home, About and Services pages.
========================================================= */

.sd-wa-widget,
.sd-wa-widget * {
    box-sizing: border-box;
}

.sd-wa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    font-family: "DM Sans", "Inter", Arial, sans-serif;
}

.sd-wa-fab {
    position: relative;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
    -webkit-tap-highlight-color: transparent;
}

.sd-wa-fab:hover,
.sd-wa-fab:focus-visible {
    background: #20c65a;
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .32);
}

.sd-wa-fab:focus-visible,
.sd-wa-close:focus-visible,
.sd-wa-start:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .35);
    outline-offset: 4px;
}

.sd-wa-fab svg {
    width: 31px;
    height: 31px;
    fill: currentColor;
    pointer-events: none;
}

.sd-wa-pulse {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: #25d366;
    animation: sdWaPulse 2s infinite;
}

@keyframes sdWaPulse {
    0% { transform: scale(1); opacity: .45; }
    70%, 100% { transform: scale(1.5); opacity: 0; }
}

.sd-wa-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(340px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.97);
    transform-origin: right bottom;
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

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

.sd-wa-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 17px 48px 17px 17px;
    background: linear-gradient(135deg, #075e54, #0a7669);
    color: #fff;
}

.sd-wa-avatar {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #25d366;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}

.sd-wa-avatar svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.sd-wa-title {
    margin: 0 0 3px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.sd-wa-status {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    line-height: 1.35;
}

.sd-wa-status::before {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .16);
}

.sd-wa-close {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.sd-wa-body {
    padding: 22px 18px 18px;
    background:
        radial-gradient(circle at 8px 8px, rgba(0, 0, 0, .025) 1px, transparent 1.5px) 0 0 / 18px 18px,
        #efeae2;
}

.sd-wa-bubble {
    position: relative;
    max-width: 94%;
    padding: 14px 15px;
    border-radius: 5px 15px 15px 15px;
    background: #fff;
    color: #2b2b2b;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
    font-size: 13px;
    line-height: 1.55;
}

.sd-wa-bubble strong {
    display: block;
    margin-bottom: 5px;
    color: #111;
    font-size: 13px;
    font-weight: 700;
}

.sd-wa-foot {
    padding: 15px;
    background: #fff;
}

.sd-wa-start {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #25d366;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: transform .2s ease, background .2s ease;
}

.sd-wa-start:hover {
    background: #20c65a;
    transform: translateY(-1px);
}

.sd-wa-start svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Keep the widget below an opened site mobile menu so it never covers menu options. */
html.menu-open .sd-wa-widget,
body.menu-open .sd-wa-widget,
body.nav-open .sd-wa-widget,
body.menu-active .sd-wa-widget {
    z-index: 1000;
}

@media (max-width: 767px) {
    .sd-wa-widget {
        right: max(15px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    .sd-wa-fab {
        width: 56px;
        height: 56px;
    }

    .sd-wa-fab svg {
        width: 28px;
        height: 28px;
    }

    .sd-wa-panel {
        position: fixed;
        right: 14px;
        left: 14px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: auto;
        max-height: min(520px, calc(100dvh - 110px));
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px;
        transform-origin: center bottom;
    }
}

@media (max-width: 380px) {
    .sd-wa-panel {
        right: 10px;
        left: 10px;
        bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .sd-wa-head {
        padding: 14px 44px 14px 14px;
        min-height: 76px;
    }

    .sd-wa-avatar {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .sd-wa-title {
        font-size: 15px;
    }

    .sd-wa-body {
        padding: 18px 14px 14px;
    }

    .sd-wa-foot {
        padding: 13px;
    }

    .sd-wa-fab {
        width: 52px;
        height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sd-wa-pulse {
        animation: none;
    }

    .sd-wa-panel,
    .sd-wa-fab,
    .sd-wa-start {
        transition: none;
    }
}
