/**
 * MercaGuate WhatsApp Flotante
 * Diseño responsive optimizado para PC y móvil.
 */

.mg-whatsapp-widget {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    pointer-events: none;
}

.mg-whatsapp-button {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    pointer-events: auto;
    animation: mg-whatsapp-pop 0.55s ease-out both;
}

.mg-whatsapp-button::before {
    content: "";
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.28);
    animation: mg-whatsapp-pulse 2.4s infinite;
    z-index: -1;
}

.mg-whatsapp-button:hover,
.mg-whatsapp-button:focus {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.30);
    filter: saturate(1.08);
    outline: none;
}

.mg-whatsapp-button img {
    width: 36px;
    height: 36px;
    display: block;
}

.mg-whatsapp-tooltip {
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    padding: 11px 13px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    white-space: nowrap;
    pointer-events: none;
}

.mg-whatsapp-widget:hover .mg-whatsapp-tooltip,
.mg-whatsapp-widget:focus-within .mg-whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

@keyframes mg-whatsapp-pop {
    0% {
        transform: scale(0.72);
        opacity: 0;
    }
    70% {
        transform: scale(1.08);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes mg-whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.65;
    }
    70% {
        transform: scale(1.45);
        opacity: 0;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .mg-whatsapp-widget {
        right: 16px;
        bottom: 18px;
    }

    .mg-whatsapp-button {
        width: 58px;
        height: 58px;
    }

    .mg-whatsapp-button::before {
        width: 58px;
        height: 58px;
    }

    .mg-whatsapp-button img {
        width: 33px;
        height: 33px;
    }

    .mg-whatsapp-tooltip {
        display: none;
    }
}

@media (max-width: 380px) {
    .mg-whatsapp-widget {
        right: 13px;
        bottom: 15px;
    }

    .mg-whatsapp-button {
        width: 54px;
        height: 54px;
    }

    .mg-whatsapp-button::before {
        width: 54px;
        height: 54px;
    }

    .mg-whatsapp-button img {
        width: 31px;
        height: 31px;
    }
}
