/* =========================================================
   FLOATING WHATSAPP WIDGET
   LOCAL FEMALE GUIDES UGANDA
   COMPLETE REPLACEMENT
========================================================= */


/* =========================================================
   MAIN WIDGET CONTAINER
========================================================= */

.whatsapp-widget {
    position: fixed;
    right: 28px;
    bottom: 28px;

    z-index: 9999;

    font-family: "Inter", sans-serif;
}


/* =========================================================
   MAIN WHATSAPP BUTTON
========================================================= */

.whatsapp-toggle {
    width: 62px;
    height: 62px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: #1F4D3A;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;

    position: relative;

    -webkit-appearance: none;
    appearance: none;
}


.whatsapp-toggle:hover {
    transform: translateY(-4px);

    background: #183D2F;

    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.25);
}


.whatsapp-toggle:active {
    transform: translateY(-1px);
}


.whatsapp-toggle:focus-visible {
    outline: 2px solid #C8A24C;
    outline-offset: 4px;
}


/* =========================================================
   WHATSAPP ICON
========================================================= */

.whatsapp-toggle svg {
    width: 31px;
    height: 31px;

    display: block;

    fill: currentColor;

    pointer-events: none;
}


/* =========================================================
   PULSE EFFECT
========================================================= */

.whatsapp-toggle::before {
    content: "";

    position: absolute;

    inset: -6px;

    border: 1px solid rgba(31, 77, 58, 0.35);

    border-radius: 50%;

    animation: whatsappPulse 2.5s infinite;

    pointer-events: none;
}


@keyframes whatsappPulse {

    0% {
        transform: scale(0.92);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.18);
        opacity: 0;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }

}


/* =========================================================
   NOTIFICATION DOT
========================================================= */

.whatsapp-notification {
    position: absolute;

    top: -2px;
    right: -2px;

    width: 15px;
    height: 15px;

    border-radius: 50%;

    background: #C8A24C;

    border: 2px solid #ffffff;

    box-sizing: border-box;

    pointer-events: none;
}


/* =========================================================
   CONTACT PANEL
========================================================= */

.whatsapp-panel {
    position: absolute;

    right: 0;
    bottom: 78px;

    width: 330px;

    background: #ffffff;

    border-radius: 16px;

    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.18);

    overflow: hidden;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(12px)
        scale(0.97);

    transform-origin: bottom right;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;

    pointer-events: none;
}


/* =========================================================
   OPEN PANEL
   IMPORTANT:
   JavaScript adds .open to .whatsapp-widget
========================================================= */

.whatsapp-widget.open .whatsapp-panel {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* =========================================================
   PANEL HEADER
========================================================= */

.whatsapp-panel-header {
    background: #1F4D3A;

    padding: 22px 22px 20px;

    color: #ffffff;
}


.whatsapp-panel-header-inner {
    display: flex;

    align-items: center;

    gap: 13px;
}


.whatsapp-panel-icon {
    width: 43px;
    height: 43px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;
}


.whatsapp-panel-icon svg {
    width: 24px;
    height: 24px;

    display: block;

    fill: #ffffff;
}


.whatsapp-panel-header h3 {
    margin: 0 0 3px;

    font-family:
        "Playfair Display",
        serif;

    font-size: 20px;

    font-weight: 600;

    line-height: 1.2;
}


.whatsapp-panel-header p {
    margin: 0;

    color:
        rgba(255, 255, 255, 0.78);

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   PANEL BODY
========================================================= */

.whatsapp-panel-body {
    padding: 18px;

    background: #ffffff;
}


/* =========================================================
   CONTACT OPTION
========================================================= */

.whatsapp-contact {
    display: flex;

    align-items: center;

    gap: 13px;

    width: 100%;

    padding: 14px;

    margin-bottom: 10px;

    background: #F8F5EF;

    border:
        1px solid
        rgba(31, 77, 58, 0.08);

    border-radius: 10px;

    text-decoration: none;

    color: #2B2B2B;

    box-sizing: border-box;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}


.whatsapp-contact:last-child {
    margin-bottom: 0;
}


.whatsapp-contact:hover {
    background: #F2EEE5;

    border-color:
        rgba(200, 162, 76, 0.35);

    transform: translateX(-2px);

    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.05);
}


.whatsapp-contact:focus-visible {
    outline: 2px solid #C8A24C;

    outline-offset: 2px;
}


/* =========================================================
   CONTACT ICON
========================================================= */

.whatsapp-contact-icon {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #1F4D3A;

    color: #ffffff;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;
}


.whatsapp-contact-icon svg {
    width: 21px;
    height: 21px;

    display: block;

    fill: currentColor;
}


/* =========================================================
   CONTACT TEXT
========================================================= */

.whatsapp-contact-content {
    flex: 1;

    min-width: 0;
}


.whatsapp-contact-title {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;

    font-weight: 700;

    color: #1F4D3A;

    line-height: 1.3;
}


.whatsapp-contact-number {
    display: block;

    font-size: 12px;

    color: #777777;

    letter-spacing: 0.2px;

    line-height: 1.4;
}


/* =========================================================
   ARROW
========================================================= */

.whatsapp-contact-arrow {
    color: #C8A24C;

    font-size: 20px;

    line-height: 1;

    flex-shrink: 0;

    transition:
        transform 0.25s ease;
}


.whatsapp-contact:hover
.whatsapp-contact-arrow {
    transform: translateX(3px);
}


/* =========================================================
   PANEL FOOTER
========================================================= */

.whatsapp-panel-footer {
    padding: 0 18px 18px;

    text-align: center;

    background: #ffffff;
}


.whatsapp-panel-footer span {
    font-size: 10px;

    color: #999999;

    letter-spacing: 0.3px;

    line-height: 1.5;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .whatsapp-widget {
        right: 18px;

        bottom: 18px;
    }


    .whatsapp-toggle {
        width: 58px;

        height: 58px;
    }


    .whatsapp-toggle svg {
        width: 29px;

        height: 29px;
    }


    .whatsapp-panel {
        right: 0;

        bottom: 72px;

        width:
            min(
                330px,
                calc(100vw - 36px)
            );
    }

}


/* =========================================================
   VERY SMALL SCREENS
========================================================= */

@media (max-width: 380px) {

    .whatsapp-widget {
        right: 14px;

        bottom: 14px;
    }


    .whatsapp-panel {
        width:
            calc(100vw - 28px);
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .whatsapp-toggle,
    .whatsapp-panel,
    .whatsapp-contact,
    .whatsapp-contact-arrow {
        transition: none;
    }


    .whatsapp-toggle::before {
        animation: none;
    }

}
