/* =========================================================
   SAIRAM HERBALS
   PREMIUM WHATSAPP SUPPORT WIDGET
========================================================= */

#whatsappWidget {
    position: fixed;
    right: 24px;
    bottom: 24px;

    z-index: 99999;

    width: max-content;
    height: max-content;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;

    margin: 0;
    padding: 0;

    pointer-events: none;

    isolation: isolate;
}


/* =========================================================
   POPUP / NEED HELP BUBBLE
========================================================= */

.whatsapp-bubble {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    width: max-content;
    max-width: 280px;

    padding: 13px 16px;

    background: rgba(255, 255, 255, 0.98);

    border: 1px solid rgba(22, 163, 74, 0.14);

    border-radius: 16px;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.14),
        0 5px 18px rgba(22, 163, 74, 0.08);

    opacity: 0;
    visibility: hidden;

    transform:
        translate3d(0, 12px, 0)
        scale(0.96);

    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.28s ease,
        visibility 0.28s ease,
        transform 0.28s ease;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


/* Little arrow */

.whatsapp-bubble::after {
    content: "";

    position: absolute;

    right: 22px;
    bottom: -7px;

    width: 14px;
    height: 14px;

    background: rgba(255, 255, 255, 0.98);

    border-right: 1px solid rgba(22, 163, 74, 0.14);
    border-bottom: 1px solid rgba(22, 163, 74, 0.14);

    transform: rotate(45deg);

    pointer-events: none;
}


/* Show */

.whatsapp-bubble.show {
    opacity: 1;
    visibility: visible;

    transform:
        translate3d(0, 0, 0)
        scale(1);
}


/* =========================================================
   ONLINE INDICATOR
========================================================= */

.bubble-dot {
    flex: 0 0 auto;

    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 5px rgba(34, 197, 94, 0.10);

    animation:
        whatsappOnlinePulse 1.8s ease-in-out infinite;
}


/* =========================================================
   BUBBLE CONTENT
========================================================= */

.bubble-content {
    min-width: 0;
}

.bubble-content h5 {
    margin: 0;

    color: #111827;

    font-size: 14px;
    font-weight: 800;

    line-height: 1.2;
}

.bubble-content p {
    margin: 4px 0 0;

    color: #6b7280;

    font-size: 12px;
    font-weight: 500;

    line-height: 1.35;
}


/* =========================================================
   WHATSAPP BUTTON
========================================================= */

.whatsapp-button {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    width: 62px;
    height: 62px;

    padding: 0 18px;

    overflow: hidden;

    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            #25d366 0%,
            #20c85a 45%,
            #128c7e 100%
        );

    color: #ffffff;
    text-decoration: none;

    box-shadow:
        0 14px 34px rgba(18, 140, 126, 0.24),
        0 8px 18px rgba(37, 211, 102, 0.20);

    pointer-events: auto;

    isolation: isolate;

    transition:
        width 0.32s cubic-bezier(.22,1,.36,1),
        transform 0.25s ease,
        box-shadow 0.25s ease;

    will-change:
        width,
        transform;
}


/* subtle inner highlight */

.whatsapp-button::before {
    content: "";

    position: absolute;
    inset: 1px;

    border-radius: inherit;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.12),
            rgba(255,255,255,0)
        );

    pointer-events: none;

    z-index: -1;
}


/* Hover */

.whatsapp-button:hover {
    width: 238px;

    transform:
        translateY(-4px);

    color: #ffffff;

    box-shadow:
        0 22px 48px rgba(18, 140, 126, 0.30),
        0 12px 24px rgba(37, 211, 102, 0.22);
}


/* =========================================================
   WHATSAPP ICON
========================================================= */

.whatsapp-icon {
    flex: 0 0 auto;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 29px;

    color: #ffffff;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12);
}


/* =========================================================
   TEXT
========================================================= */

.whatsapp-text {
    display: flex;
    flex-direction: column;

    min-width: 0;

    margin-left: 2px;

    white-space: nowrap;

    opacity: 0;
    transform: translateX(7px);

    transition:
        opacity 0.2s ease 0.05s,
        transform 0.2s ease 0.05s;
}

.whatsapp-button:hover .whatsapp-text {
    opacity: 1;

    transform:
        translateX(0);
}

.whatsapp-text span {
    font-size: 14px;
    font-weight: 800;

    line-height: 1.2;

    color: #ffffff;
}

.whatsapp-text small {
    margin-top: 3px;

    font-size: 11px;
    font-weight: 500;

    line-height: 1.2;

    color: rgba(255,255,255,0.88);
}


/* =========================================================
   ONLINE DOT
========================================================= */

.online-dot {
    position: absolute;

    top: 7px;
    right: 7px;

    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #22c55e;

    border: 2px solid #ffffff;

    box-shadow:
        0 0 0 3px rgba(34,197,94,0.12);

    animation:
        whatsappOnlinePulse 2s ease-in-out infinite;
}


/* =========================================================
   FLOAT
========================================================= */

@keyframes whatsappFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}


#whatsappWidget {
    animation:
        whatsappFloat 4.5s ease-in-out infinite;
}


/* =========================================================
   ONLINE PULSE
========================================================= */

@keyframes whatsappOnlinePulse {

    0% {
        box-shadow:
            0 0 0 0 rgba(34,197,94,0.32);
    }

    70% {
        box-shadow:
            0 0 0 8px rgba(34,197,94,0);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(34,197,94,0);
    }
}


/* =========================================================
   BUTTON PULSE
========================================================= */

.whatsapp-button.pulse {
    animation:
        whatsappButtonPulse 0.9s ease;
}


@keyframes whatsappButtonPulse {

    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.06);
    }

    50% {
        transform: scale(0.98);
    }

    75% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}


/* =========================================================
   DESKTOP HOVER BEHAVIOUR
========================================================= */

@media (hover: hover) and (pointer: fine) {

    .whatsapp-button:hover .online-dot {
        animation: none;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    #whatsappWidget {
        right: 18px;
        bottom: 18px;
    }

    .whatsapp-bubble {
        max-width: 250px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    #whatsappWidget {
        right: 16px;
        bottom: 16px;

        gap: 9px;
    }


    .whatsapp-button {
        width: 58px;
        height: 58px;

        padding: 0;

        align-items: center;
        justify-content: center;

        box-shadow:
            0 12px 28px rgba(18, 140, 126, 0.24),
            0 7px 16px rgba(37, 211, 102, 0.16);
    }


    .whatsapp-button:hover {
        width: 58px;

        transform:
            translateY(-2px);
    }


    .whatsapp-icon {
        width: 58px;
        height: 58px;

        font-size: 27px;

        background: transparent;
    }


    .whatsapp-text {
        display: none;
    }


    .online-dot {
        top: 6px;
        right: 6px;

        width: 10px;
        height: 10px;
    }


    .whatsapp-bubble {
        max-width: 225px;

        padding: 11px 13px;

        border-radius: 14px;
    }


    .bubble-content h5 {
        font-size: 13px;
    }


    .bubble-content p {
        font-size: 11px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    #whatsappWidget {
        right: 13px;
        bottom: 13px;
    }


    .whatsapp-button {
        width: 54px;
        height: 54px;
    }


    .whatsapp-button:hover {
        width: 54px;
    }


    .whatsapp-icon {
        width: 54px;
        height: 54px;

        font-size: 25px;
    }


    .online-dot {
        width: 9px;
        height: 9px;

        top: 5px;
        right: 5px;
    }


    .whatsapp-bubble {
        max-width: 205px;
    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    #whatsappWidget,
    .whatsapp-button,
    .whatsapp-bubble,
    .bubble-dot,
    .online-dot {
        animation: none !important;
        transition: none !important;
    }

}