
#whatsapp-button {
    z-index: 99999999;
}

.btn-whatsapp-pulse {
    background: #25d366;
    color: #ffffff;
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 9999999;
    font-size: 16px;
    display: none;
    justify-content: center;
    align-items: center;
    width: 0;
    height: 0;
    padding: 18px;
    text-decoration: none;
    border-radius: 50%;
    animation: pulse 1.5s ease-out infinite;
}

.btn-whatsapp-pulse:hover {
    background: #25d366;
    color: #ffffff;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    80% {
        box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
    }
}

.btn-whatsapp-pulse-border::before {
    content: "";
    position: absolute;
    border-radius: 50%;
    padding: 10px;
    border: 3px solid #25d366;
    opacity: 0.75;
    animation: pulse-border 1.8s ease-out infinite;
}

@keyframes pulse-border {
    0% {
        padding: 15px;
        opacity: 0.75;
    }

    75% {
        padding: 30px;
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* WhatsApp lead chat widget */

#lead-chat-widget {
    font-family: inherit;
}

#lead-chat-widget [hidden] {
    display: none !important;
}

/* Toast notification */

.lead-chat-toast {
    position: fixed;
    z-index: 99999998;
    bottom: 85px;
    left: 20px;
    width: min(330px, calc(100vw - 40px));
    padding: 16px;
    color: #222;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
    animation: lead-toast-in .3s ease;
}

.lead-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 12px;
}

.lead-toast-icon {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: #25d366;
    border-radius: 50%;
    font-size: 22px;
}

.lead-toast-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.lead-toast-content p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

#lead-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 0;
    color: #777;
    background: transparent;
    border: 0;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

/* Chat window */

.lead-chat-window {
    position: fixed;
    z-index: 99999998;
    bottom: 85px;
    left: 20px;
    display: flex;
    flex-direction: column;
    width: 360px;
    max-width: calc(100vw - 28px);
    height: 510px;
    max-height: min(620px, calc(100dvh - 110px));
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
    animation: lead-chat-in .25s ease;
}

/* Header */

.lead-chat-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 11px;
    padding: 15px;
    color: #fff;
    background: #075e54;
}

.lead-chat-avatar {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: #25d366;
    border-radius: 50%;
    font-size: 23px;
}

.lead-chat-heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.lead-chat-heading strong {
    font-size: 15px;
    font-weight: 600;
}

.lead-chat-heading span {
    color: #d5f5e7;
    font-size: 12px;
}

.lead-chat-close {
    display: flex;
    flex: 0 0 32px;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.lead-chat-close:hover {
    background: rgba(255, 255, 255, .12);
}

/* Message area */

.lead-chat-messages {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 18px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: #efeae2;
    background-image: url("../images/whatsapp-doodle.jpg");
    background-repeat: repeat;
    background-size: 340px auto;
}

.lead-chat-message {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.lead-chat-message.bot {
    align-self: flex-start;
    color: #252525;
    background: #fff;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.lead-chat-message.user {
    align-self: flex-end;
    color: #222;
    background: #d9fdd3;
    border-top-right-radius: 4px;
}

/* Quick-reply options: transparent container */

.lead-chat-options {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    align-self: flex-start;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
/* WhatsApp and Email submit buttons inline */

.lead-chat-options:has(.lead-chat-submit) {
    flex-direction: row;
    align-items: stretch;
    align-self: stretch;
    gap: 8px;
    width: 100%;
}

.lead-chat-options:has(.lead-chat-submit) .lead-chat-submit {
    flex: 1;
    width: 0;
    min-width: 0;
    padding: 10px 6px;
    font-size: 12px;
}
/* Individual option buttons only */

.lead-chat-option {
    display: block;
    width: fit-content;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 14px;
    color: #087443;
    background: #fff;
    border: 1px solid #cfe5d7;
    border-radius: 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.lead-chat-option:hover,
.lead-chat-option:focus-visible {
    background: #e8f8ef;
    border-color: #25a765;
}

.lead-chat-option:disabled {
    cursor: default;
    opacity: 1;
}

/* Chat footer: retained for inputs and submit buttons */

.lead-chat-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 9px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eee;
}

/* Hide the footer only when it has no content */

.lead-chat-footer:empty {
    display: none;
}

/* Input forms */

.lead-chat-input-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Submit and restart buttons */

.lead-chat-submit,
.lead-chat-restart {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #128c4a;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.lead-chat-submit {
    color: #fff;
    background: #128c4a;
}

.lead-chat-submit:hover {
    background: #0c733c;
}

.lead-chat-restart {
    color: #555;
    background: #fff;
    border-color: #ddd;
}

.lead-chat-restart:hover {
    background: #f5f5f5;
}

/* Text inputs */

.lead-chat-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    color: #222;
    background: #fff;
    border: 1px solid #d9dfdc;
    border-radius: 9px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.lead-chat-input:focus {
    border-color: #128c4a;
    box-shadow: 0 0 0 2px rgba(18, 140, 74, .1);
}

.lead-chat-input-error {
    color: #c62828;
    font-size: 12px;
}

/* Keyboard accessibility */

.lead-chat-footer button:focus-visible,
.lead-chat-close:focus-visible,
#lead-toast-close:focus-visible {
    outline: 2px solid #128c4a;
    outline-offset: 3px;
}

/* Animations */

@keyframes lead-toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lead-chat-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile layout */

@media (max-width: 480px) {
    .lead-chat-toast {
        bottom: 78px;
        left: 12px;
        width: min(330px, calc(100vw - 24px));
    }

    .lead-chat-window {
        bottom: 76px;
        left: 10px;
        width: calc(100vw - 20px);
        max-width: none;
        height: min(540px, calc(100dvh - 95px));
        max-height: calc(100dvh - 95px);
        border-radius: 14px;
    }

    .lead-chat-header {
        padding: 12px;
    }

    .lead-chat-messages {
        padding: 14px 11px;
    }

    .lead-chat-footer {
        gap: 8px;
        padding: 10px;
    }

    .lead-chat-options {
        gap: 6px;
    }

    .lead-chat-option {
        min-height: 35px;
        padding: 8px 12px;
    }
}

/* Reduced motion preference */

@media (prefers-reduced-motion: reduce) {
    .lead-chat-toast,
    .lead-chat-window {
        animation: none;
    }

    .lead-chat-option,
    .lead-chat-submit,
    .lead-chat-restart {
        transition: none;
    }
}



/* Emoji button inside textarea */

.lead-chat-input-form {
    position: relative;
}

.lead-chat-input-form:has(.lead-chat-emoji-wrapper) .lead-chat-input {
    padding-right: 46px;
    padding-bottom: 42px;
}

.lead-chat-input-toolbar {
    position: relative;
    height: 0;
}

.lead-chat-emoji-wrapper {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 5;
}

.lead-chat-emoji-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #687782;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.lead-chat-emoji-button:hover,
.lead-chat-emoji-button[aria-expanded="true"] {
    color: #128c4a;
    background: transparent;
}

.lead-chat-emoji-button:focus-visible,
.lead-chat-emoji-item:focus-visible {
    outline: 2px solid #128c4a;
    outline-offset: 2px;
}

.lead-chat-emoji-picker {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(6, 36px);
    gap: 3px;
    width: max-content;
    max-width: calc(100vw - 48px);
    max-height: 190px;
    padding: 8px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e4e9e6;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}

.lead-chat-emoji-picker[hidden] {
    display: none !important;
}

.lead-chat-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 21px;
    cursor: pointer;
}

.lead-chat-emoji-item:hover {
    background: #f0f5f2;
}



/* Bot message row */
.lead-chat-bot-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 12px 0;
    animation: leadBotMessageIn 0.2s ease-out;
}


/* Typing bubble */
.lead-chat-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 40px);
    padding: 11px 14px;
    border: 1px solid #e9ecef;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    color: #495057;
    box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}

/* Typing label */
.lead-chat-typing-label {
    font-size: 12px;
    line-height: 1.4;
    color: #6c757d;
    white-space: nowrap;
}

/* Animated dots */
.lead-chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.lead-chat-typing-dots span {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6c757d;
    animation: leadTypingDot 1.2s infinite ease-in-out;
}

.lead-chat-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.lead-chat-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Bot message animation */
@keyframes leadBotMessageIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing dots animation */
@keyframes leadTypingDot {
    0%, 60%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .lead-chat-bot-row,
    .lead-chat-typing-dots span {
        animation: none;
    }
}



.lead-chat-bot-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: #e8f5e9;
    color: #198754;
}

.lead-chat-bot-avatar svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}




/* Mobile layout */
@media (max-width: 480px) {
    .lead-chat-toast {
        bottom: 5px;
        left: 70px;
        right: auto;
        width: min(230px, calc(100vw - 100px));
        padding: 12px 12px;
        border-radius: 12px;
        transform-origin: left center;
    }


/* Centered triangle pointer */
    .lead-chat-toast::before {
        content: "";
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid #fff;
    }


    .lead-toast-content {
        gap: 9px;
        padding-right: 10px;
    }

    .lead-toast-icon {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    .lead-toast-content strong {
        font-size: 14px;
    }

    .lead-toast-content p {
        font-size: 12px;
        line-height: 1.45;
    }

    #lead-toast-close {
        top: 5px;
        right: 6px;
        font-size: 19px;
    }

    .lead-chat-window {
        bottom: 76px;
        left: 10px;
        width: calc(100vw - 20px);
        max-width: none;
        height: min(540px, calc(100dvh - 95px));
        max-height: calc(100dvh - 95px);
        border-radius: 14px;
    }

    .lead-chat-header {
        padding: 12px;
    }

    .lead-chat-messages {
        padding: 14px 11px;
    }

    .lead-chat-footer {
        gap: 8px;
        padding: 10px;
    }

    .lead-chat-options {
        gap: 6px;
    }

    .lead-chat-option {
        min-height: 35px;
        padding: 8px 12px;
    }
}

