/* Custom WhatsApp Floating Chat */
.cwf-float-stack {
    position: fixed;
    z-index: 99999;
    bottom: var(--cwf-bottom, 24px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--cwf-gap, 12px);
}

.cwf-float-stack.cwf-left {
    align-items: flex-start;
}

.cwf-button-row {
    position: relative;
    display: flex;
    align-items: center;
}

.cwf-float-stack.cwf-right .cwf-button-row {
    flex-direction: row;
}

.cwf-float-stack.cwf-left .cwf-button-row {
    flex-direction: row-reverse;
}

.cwf-float-button {
    width: var(--cwf-button-size, 64px);
    height: var(--cwf-button-size, 64px);
    border-radius: 999px;
    color: var(--cwf-icon, #ffffff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(0,0,0,.22);
    transform: translateY(0);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.cwf-whatsapp-button { background: var(--cwf-bg, #25D366); }
.cwf-call-button { background: var(--cwf-call-bg, #0F766E); }

.cwf-icon,
.cwf-icon svg {
    display: inline-flex;
    width: var(--cwf-icon-size, 34px);
    height: var(--cwf-icon-size, 34px);
    color: var(--cwf-icon, #ffffff);
}

.cwf-float-button:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 18px 38px rgba(0,0,0,.25);
    filter: saturate(1.07);
}

.cwf-float-button:focus-visible {
    outline: 3px solid rgba(37,211,102,.28);
    outline-offset: 4px;
}

.cwf-whatsapp-button::before,
.cwf-whatsapp-button::after,
.cwf-call-button::before,
.cwf-call-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(37,211,102,.34);
    animation: cwfPulse 2.2s infinite;
    pointer-events: none;
}

.cwf-call-button::before,
.cwf-call-button::after {
    border-color: rgba(15,118,110,.34);
}

.cwf-whatsapp-button::after,
.cwf-call-button::after {
    animation-delay: 1.1s;
}

@keyframes cwfPulse {
    0% { transform: scale(1); opacity: .75; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

.cwf-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--cwf-tooltip-bg, #111827);
    color: var(--cwf-tooltip-text, #ffffff);
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    width: 260px;
    max-width: 260px;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    transition: opacity .55s ease, transform .55s ease, visibility 0s linear .55s;
}

.cwf-float-stack.cwf-right .cwf-tooltip {
    right: calc(100% + var(--cwf-tooltip-gap, 14px));
    transform: translateY(-50%) translateX(10px);
}

.cwf-float-stack.cwf-left .cwf-tooltip {
    left: calc(100% + var(--cwf-tooltip-gap, 14px));
    transform: translateY(-50%) translateX(-10px);
}

.cwf-tooltip.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .55s ease, transform .55s ease, visibility 0s linear 0s;
}

.cwf-float-stack.cwf-right .cwf-tooltip.is-active {
    transform: translateY(-50%) translateX(0);
}

.cwf-float-stack.cwf-left .cwf-tooltip.is-active {
    transform: translateY(-50%) translateX(0);
}

.cwf-tooltip.is-fading {
    opacity: 0;
    pointer-events: none;
}

.cwf-float-stack.cwf-right .cwf-tooltip.is-fading {
    transform: translateY(-50%) translateX(8px);
}

.cwf-float-stack.cwf-left .cwf-tooltip.is-fading {
    transform: translateY(-50%) translateX(-8px);
}

.cwf-tooltip.is-hidden {
    display: none !important;
}

.cwf-tooltip-content p { margin: 0 0 8px; }
.cwf-tooltip-content p:last-child { margin-bottom: 0; }
.cwf-tooltip-content strong,
.cwf-tooltip-content b { font-weight: 700; }

.cwf-tooltip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    padding: 0;
    transition: background .2s ease, transform .2s ease;
}

.cwf-tooltip-close:hover {
    background: rgba(255,255,255,.22);
    transform: scale(1.06);
}

.cwf-tooltip-close:focus-visible {
    outline: 2px solid rgba(255,255,255,.45);
    outline-offset: 2px;
}

.cwf-tooltip.has-close {
    padding-top: 18px;
    padding-right: 40px;
}

.cwf-float-stack.cwf-right .cwf-tooltip::after,
.cwf-float-stack.cwf-left .cwf-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--cwf-tooltip-bg, #111827);
    transform: translateY(-50%) rotate(45deg);
}

.cwf-float-stack.cwf-right .cwf-tooltip::after { right: -6px; }
.cwf-float-stack.cwf-left .cwf-tooltip::after { left: -6px; }

@media (max-width: 767px) {
    .cwf-tooltip {
        width: 210px;
        max-width: 210px;
        font-size: 13px;
        padding: 12px 14px;
    }

    .cwf-tooltip.has-close {
        padding-top: 16px;
        padding-right: 38px;
    }

    .cwf-tooltip-close {
        width: 26px;
        height: 26px;
        font-size: 19px;
    }
}

/* --- Fine position tweaks --- */
.cwf-button-row-call {
    margin-bottom: 10px; /* moves call button slightly up */
}

/* Move WhatsApp tooltip slightly up */
.cwf-tooltip-whatsapp {
    transform: translateY(calc(-50% - 5px));
}

.cwf-float-stack.cwf-right .cwf-tooltip-whatsapp {
    transform: translateY(calc(-50% - 5px)) translateX(10px);
}

.cwf-float-stack.cwf-right .cwf-tooltip-whatsapp.is-active {
    transform: translateY(calc(-50% - 5px)) translateX(0);
}

.cwf-float-stack.cwf-left .cwf-tooltip-whatsapp {
    transform: translateY(calc(-50% - 5px)) translateX(-10px);
}

.cwf-float-stack.cwf-left .cwf-tooltip-whatsapp.is-active {
    transform: translateY(calc(-50% - 5px)) translateX(0);
}

/* v1.4.4 close button tweaks */
.cwf-tooltip-close {
    width: 36px !important;
    height: 36px !important;
    font-size: 28px !important;
    color: #ffffff !important;
    background: rgba(255,255,255,.16);
}
@media (max-width: 767px) {
    .cwf-tooltip-close {
        width: 34px !important;
        height: 34px !important;
        font-size: 26px !important;
        color: #ffffff !important;
    }
}
