/* ZD WhatsApp Flotante */

.zdwa-wrap {
    box-sizing: border-box;
}
.zdwa-wrap *,
.zdwa-wrap *::before,
.zdwa-wrap *::after {
    box-sizing: border-box;
}

/* ---- Contenedor flotante ---- */
.zdwa-wrap-float {
    position: fixed;
    bottom: var(--zdwa-offy, 20px);
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}
.zdwa-wrap-float.zdwa-pos-right {
    right: var(--zdwa-offx, 20px);
    align-items: flex-end;
}
.zdwa-wrap-float.zdwa-pos-left {
    left: var(--zdwa-offx, 20px);
    align-items: flex-start;
}

/* ---- Botón ---- */
.zdwa-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--zdwa-bg, #25D366);
    color: var(--zdwa-icon, #fff);
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    line-height: 1;
    font-family: inherit;
}
.zdwa-btn:hover,
.zdwa-btn:focus {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
    color: var(--zdwa-icon, #fff);
}
.zdwa-float {
    width: 60px;
    height: 60px;
    padding: 0;
}
.zdwa-float.zdwa-has-text {
    width: auto;
    height: 60px;
    padding: 0 22px 0 18px;
}
.zdwa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.zdwa-icon svg {
    width: 30px;
    height: 30px;
}
.zdwa-text {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

/* Botón inline (shortcode dentro del contenido) */
.zdwa-wrap-inline {
    display: inline-block;
}
.zdwa-inline {
    height: 48px;
    padding: 0 22px;
}
.zdwa-inline .zdwa-icon svg {
    width: 24px;
    height: 24px;
}

/* ---- Burbuja de mensaje ---- */
.zdwa-bubble {
    pointer-events: auto;
    position: relative;
    max-width: 260px;
    background: var(--zdwa-bubble-bg, #fff);
    color: var(--zdwa-bubble-color, #333);
    padding: 12px 34px 12px 14px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    line-height: 1.4;
    animation: zdwa-fade-in 0.4s ease both;
}
.zdwa-bubble-text {
    display: block;
}
.zdwa-pos-right .zdwa-bubble::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: -7px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--zdwa-bubble-bg, #fff) transparent transparent transparent;
}
.zdwa-pos-left .zdwa-bubble::after {
    content: "";
    position: absolute;
    left: 20px;
    bottom: -7px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--zdwa-bubble-bg, #fff) transparent transparent transparent;
}
.zdwa-bubble-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: var(--zdwa-bubble-color, #333);
    opacity: 0.55;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.zdwa-bubble-close:hover {
    opacity: 1;
}
.zdwa-wrap.zdwa-bubble-hidden .zdwa-bubble {
    display: none;
}

/* ---- Efectos de atención ---- */
.zdwa-fx-pulse {
    animation: zdwa-pulse 2s infinite;
}
.zdwa-fx-bounce {
    animation: zdwa-bounce 2.4s ease infinite;
}
.zdwa-fx-shake {
    animation: zdwa-shake 3s ease infinite;
}
.zdwa-fx-wobble {
    animation: zdwa-wobble 3s ease infinite;
}
/* Al hacer hover se pausa el efecto para no interferir con el clic. */
.zdwa-btn:hover {
    animation-play-state: paused;
}

@keyframes zdwa-pulse {
    0%   { box-shadow: 0 6px 18px rgba(0,0,0,0.28), 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70%  { box-shadow: 0 6px 18px rgba(0,0,0,0.28), 0 0 0 18px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 6px 18px rgba(0,0,0,0.28), 0 0 0 0 rgba(37, 211, 102, 0); }
}
@keyframes zdwa-bounce {
    0%, 55%, 75%, 100% { transform: translateY(0); }
    65% { transform: translateY(-10px); }
    70% { transform: translateY(-4px); }
}
@keyframes zdwa-shake {
    0%, 88%, 100% { transform: rotate(0); }
    90% { transform: rotate(-9deg); }
    92% { transform: rotate(9deg); }
    94% { transform: rotate(-7deg); }
    96% { transform: rotate(7deg); }
    98% { transform: rotate(-3deg); }
}
@keyframes zdwa-wobble {
    0%, 80%, 100% { transform: translateX(0); }
    85% { transform: translateX(-6px) rotate(-4deg); }
    90% { transform: translateX(6px) rotate(4deg); }
    95% { transform: translateX(-3px) rotate(-2deg); }
}
@keyframes zdwa-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Respeta la preferencia de movimiento reducido. */
@media (prefers-reduced-motion: reduce) {
    .zdwa-fx-pulse,
    .zdwa-fx-bounce,
    .zdwa-fx-shake,
    .zdwa-fx-wobble,
    .zdwa-bubble {
        animation: none !important;
    }
}

/* Responsive: botón un poco más compacto en móvil. */
@media (max-width: 480px) {
    .zdwa-float {
        width: 54px;
        height: 54px;
    }
    .zdwa-float.zdwa-has-text {
        height: 54px;
    }
    .zdwa-bubble {
        max-width: 210px;
        font-size: 13px;
    }
}
