.pc-floating-whatsapp {
    position: fixed;
    z-index: 850;
    inset-inline-end: max(12px, env(safe-area-inset-right, 0px), env(safe-area-inset-left, 0px));
    inset-block-end: calc(12px + var(--pc-whatsapp-floor, env(safe-area-inset-bottom, 0px)));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-block-size: 44px;
    max-inline-size: calc(100% - 32px);
    padding: 9px 14px;
    border-radius: 999px;
    background: #176647;
    box-shadow: 0 3px 12px #183a2633;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.pc-floating-whatsapp:hover {
    background: #105438;
    color: #fff;
}

.pc-floating-whatsapp:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px #183a26;
}

.pc-floating-whatsapp > svg {
    flex: none;
    width: 20px;
    height: 20px;
}

body:has(.purchase-dock:not([hidden])) .pc-floating-whatsapp {
    --pc-whatsapp-floor: var(--pc-product-dock-offset, calc(115px + env(safe-area-inset-bottom, 0px)));
}

body:has(.wc-block-cart__submit-container--sticky) .pc-floating-whatsapp {
    --pc-whatsapp-floor: calc(88px + env(safe-area-inset-bottom, 0px));
}

body:has(.pc-floating-whatsapp) :is(.pc-v3-footer__bottom, .site-footer__bottom) {
    padding-block-end: calc(64px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 960px) {
    .pc-floating-whatsapp {
        inset-inline-end: max(20px, env(safe-area-inset-right, 0px), env(safe-area-inset-left, 0px));
    }

    body:has([data-blueprint-product-page] .purchase-dock:not([hidden])) .pc-floating-whatsapp {
        --pc-whatsapp-floor: calc(12px + var(--pc-product-dock-offset, 76px));
    }
}

@media (max-width: 959px) {
    body:has(.pc-v3-mobile-nav):not(:has(.purchase-dock:not([hidden]))) .pc-floating-whatsapp {
        --pc-whatsapp-floor: calc(var(--pc-v3-mobile-nav-height, 68px) + env(safe-area-inset-bottom, 0px));
    }
}

/* Keep the viewport clear while on-screen keyboards are in use. */
@media (max-width: 959px) and (pointer: coarse) {
    body:has(:is(input:not([type="checkbox"], [type="radio"], [type="button"], [type="submit"], [type="reset"], [readonly]), textarea:not([readonly]), [contenteditable="true"]):focus) .pc-floating-whatsapp {
        visibility: hidden;
    }
}
