/* Estilos fijos del widget frontend */
.wcfm-whatsapp-buffer {
    position: fixed;
    z-index: 999999;
    display: flex;
    align-items: center;
    /* Side by side alignment */
    direction: ltr;
}

/* Wrapper to cast shadows properly out of clipped elements */
.wcfm-wa-tooltip-wrapper {
    display: flex;
    align-items: center;
    -webkit-filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transform: translateZ(0);
    /* Forzar aceleración 3D para renderizar el shadow en Safari/iPhone */
    -webkit-transform: translateZ(0);
    margin: 0 !important;
}

/* Call to Action Bubble (formerly Tooltip) */
.wcfm-wa-tooltip {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 1;
    /* Always visible */
    pointer-events: auto;
    white-space: nowrap;
    position: relative;
    max-width: 250px;
    line-height: 1.4;
    margin: 0 !important;
}

/* Arrow Base Style (Rotated Square) */
.wcfm-wa-tooltip::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: rotate(45deg);
    top: 50%;
    margin-top: -6px;
    z-index: -1;
}

/* Arrow Pointing Right (Text on Left) */
.wcfm-wa-tooltip[data-side="left"] {
    margin-right: 18px !important;
}

.wcfm-wa-tooltip[data-side="left"]::after {
    right: -6px;
}

/* Arrow Pointing Left (Text on Right) */
.wcfm-wa-tooltip[data-side="right"] {
    margin-left: 18px !important;
}

.wcfm-wa-tooltip[data-side="right"]::after {
    left: -6px;
}

/* ==========================================================
   SHAPE MODIFIER: FULL ARROW
   ========================================================== */
.wcfm-wa-tooltip.wcfm-cta-shape-arrow {
    border-radius: 4px;
    /* Slightly sharper corners for the flat side */
}

/* Hide the old little arrow triangle */
.wcfm-wa-tooltip.wcfm-cta-shape-arrow::after {
    display: none !important;
}

/* Arrow Shape logic when pointing Right (Icon on the Right, Widget on Bottom Right / Top Right) */
.wcfm-wa-tooltip.wcfm-cta-shape-arrow[data-side="left"] {
    -webkit-clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%);
    clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%);
    padding-right: 24px !important;
    margin-right: 8px !important;
}

/* Arrow Shape logic when pointing Left (Icon on the Left, Widget on Bottom Left / Top Left) */
.wcfm-wa-tooltip.wcfm-cta-shape-arrow[data-side="right"] {
    -webkit-clip-path: polygon(14px 0%, 100% 0%, 100% 100%, 14px 100%, 0% 50%);
    clip-path: polygon(14px 0%, 100% 0%, 100% 100%, 14px 100%, 0% 50%);
    padding-left: 24px !important;
    margin-left: 8px !important;
}

/* Icono Container */
.wcfm-wa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none !important;
    flex-shrink: 0;
    /* Prevent shrinking */
    margin: 0 !important;
}

.wcfm-wa-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.wcfm-wa-icon svg {
    fill: currentColor;
    width: 60%;
    height: 60%;
}



/* Animation Keyframes */
@keyframes wcfm-chat-shockwave {
    0% {
        transform: scale(1);
        box-shadow: 0 0 2px rgba(0, 0, 0, .3), inset 0 0 1px rgba(0, 0, 0, .3);
    }

    95% {
        box-shadow: 0 0 50px transparent, inset 0 0 30px transparent;
    }

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

@keyframes wcfm-chat-blink {

    0%,
    100% {
        opacity: 1;
    }

    20% {
        opacity: 0.5;
    }
}

@keyframes wcfm-chat-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 2px rgba(0, 0, 0, .2);
        border-radius: 50%;
    }

    100% {
        transform: scale(1.1);
        box-shadow: 0 2px 2px rgba(0, 0, 0, .2);
        border-radius: 45%;
    }
}

@keyframes wcfm-chat-sheen {

    100%,
    20% {
        transform: rotateZ(60deg) translate(0, -80px);
    }
}

@keyframes wcfm-chat-fade {

    15%,
    5% {
        opacity: 0.25;
    }

    10%,
    100%,
    20% {
        opacity: 1;
    }
}

@keyframes wcfm-chat-spin {
    10% {
        transform: rotateZ(-20deg);
        animation-timing-function: ease;
    }

    100%,
    20% {
        transform: rotateZ(360deg);
    }
}

@keyframes wcfm-chat-bounce {

    0%,
    100%,
    20% {
        transform: none;
    }

    10% {
        transform: translateY(-1em);
    }
}

@keyframes wcfm-chat-waggle {
    0% {
        transform: none;
    }

    10% {
        transform: rotateZ(-20deg) scale(1.2);
    }

    13% {
        transform: rotateZ(25deg) scale(1.2);
    }

    15% {
        transform: rotateZ(-15deg) scale(1.2);
    }

    17% {
        transform: rotateZ(15deg) scale(1.2);
    }

    20% {
        transform: rotateZ(-12deg) scale(1.2);
    }

    22% {
        transform: rotateZ(0) scale(1.2);
    }

    100%,
    24% {
        transform: rotateZ(0) scale(1);
    }
}

@keyframes wcfm-chat-floating {
    0% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -10px, 0);
    }

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

/* CTA Animation Keyframes: Horizontal Move */
@keyframes wcfm-cta-horizontal {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-5px);
    }

    30% {
        transform: translateX(4px);
    }

    45% {
        transform: translateX(-4px);
    }

    60% {
        transform: translateX(2px);
    }

    75% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(0);
    }
}

/* Animation Classes */
.wcfm-chat-animation-shockwave::after,
.wcfm-chat-animation-shockwave::before {
    content: "";
    border-radius: 50%;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
}

.wcfm-chat-animation-shockwave::after {
    animation: 2s ease-out 1.3s infinite wcfm-chat-shockwave;
}

.wcfm-chat-animation-shockwave::before {
    animation: 2s ease-out 0.8s infinite wcfm-chat-shockwave;
}

.wcfm-chat-animation-blink {
    animation: 1.33s ease-out infinite wcfm-chat-blink;
}

.wcfm-chat-animation-pulse {
    animation: 0.4s infinite alternate wcfm-chat-pulse;
}

.wcfm-chat-animation-sheen {
    position: relative;
    overflow: hidden;
}

.wcfm-chat-animation-sheen::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.5) 50%, transparent);
    transform: rotateZ(60deg) translate(0, 5em);
    animation: 5s infinite wcfm-chat-sheen;
}

.wcfm-chat-animation-fade {
    animation: 5s infinite wcfm-chat-fade;
}

.wcfm-chat-animation-spin {
    animation: 5s cubic-bezier(0.56, -0.35, 0.22, 1.5) infinite wcfm-chat-spin;
}

.wcfm-chat-animation-bounce {
    animation: 5s cubic-bezier(0.84, -0.54, 0.31, 1.19) infinite wcfm-chat-bounce;
}

.wcfm-chat-animation-waggle {
    animation: 5s infinite wcfm-chat-waggle;
}

.wcfm-chat-animation-floating {
    animation: 3s ease infinite wcfm-chat-floating;
}

.wcfm-cta-anim-horizontal {
    animation: wcfm-cta-horizontal 2.5s ease-in-out infinite;
    transform-origin: center;
}

/* Additional Field Content */
.wcfm-additional-field-content {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #25D366;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.wcfm-additional-field-content p {
    margin: 0 0 10px 0;
}

.wcfm-additional-field-content p:last-child {
    margin-bottom: 0;
}

.wcfm-additional-field-content strong {
    font-weight: 600;
}

.wcfm-additional-field-content em {
    font-style: italic;
}

.wcfm-additional-field-content u {
    text-decoration: underline;
}
/* Inline WhatsApp Button (shortcode / before/after price) */
.wcfm-whatsapp-inline-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 10px 0;
    direction: ltr;
}

/* En modo inline, el icono no necesita position fixed */
.wcfm-whatsapp-inline-wrapper .wcfm-wa-icon {
    flex-shrink: 0;
}

/* En modo inline, el texto puede envolver si es largo */
.wcfm-whatsapp-inline-wrapper .wcfm-wa-tooltip {
    white-space: normal;
}

