:root {
    /* Extra bottom offset (JS will increase it on checkout to avoid cc-mobile-cta) */
    --cc-whatsapp-bottom: 16px;
}

.cc-whatsapp-fab {
    position: fixed;
    right: calc(env(safe-area-inset-right) + 16px);
    bottom: calc(env(safe-area-inset-bottom) + var(--cc-whatsapp-bottom, 16px));
    z-index: 90; /* floating layer: above page content, but below header/menu overlays */
    overflow: visible;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 12px 14px;
    border-radius: 9999px;
    background: #25D366;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
    line-height: 1;
    font-weight: 700;
    transition: transform 160ms ease, opacity 160ms ease;
}

.cc-whatsapp-fab:hover {
    transform: translateY(-1px);
}

.cc-whatsapp-fab:focus {
    outline: 3px solid rgba(37, 211, 102, 0.35);
    outline-offset: 2px;
}

.cc-whatsapp-fab__icon {
    display: inline-flex;
}

.cc-whatsapp-fab__text {
    font-size: 14px;
    white-space: nowrap;
}

.cc-whatsapp-fab__tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    max-width: 220px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #111111;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}

.cc-whatsapp-fab__tooltip:after {
    content: "";
    position: absolute;
    right: 14px;
    top: 100%;
    border: 8px solid transparent;
    border-top-color: #ffffff;
}

.cc-whatsapp-fab__tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: keep it less intrusive (icon-first) */
@media (max-width: 767px) {
    .cc-whatsapp-fab {
        padding: 12px;
        gap: 0;
    }

    .cc-whatsapp-fab__text {
        display: none;
    }
}

/* Sidecart open: hide to prevent overlap with the drawer */
html.sidecart-open .cc-whatsapp-fab {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Tooltip bubble (shown briefly via JS) */
.cc-whatsapp-fab__tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    max-width: 170px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #111111;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}

.cc-whatsapp-fab__tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cc-whatsapp-fab__tooltip:after {
    content: "";
    position: absolute;
    right: 14px;
    top: 100%;
    border: 8px solid transparent;
    border-top-color: #ffffff;
}
