/**
 * WhatsApp Flotante - Frontend CSS
 * Version 2.0.0
 * Author: Gabriel Viza
 */

/* Botón flotante principal */
#wft-whatsapp-button {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estilo Bubble (solo icono) */
#wft-whatsapp-button.wft-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
}

#wft-whatsapp-button.wft-bubble.wft-size-small {
    width: 48px;
    height: 48px;
}

#wft-whatsapp-button.wft-bubble.wft-size-medium {
    width: 60px;
    height: 60px;
}

#wft-whatsapp-button.wft-bubble.wft-size-large {
    width: 72px;
    height: 72px;
}

#wft-whatsapp-button.wft-bubble .wft-button-text {
    display: none;
}

#wft-whatsapp-button.wft-bubble svg {
    width: 60%;
    height: 60%;
}

/* Estilo con texto */
#wft-whatsapp-button.wft-with-text {
    padding: 12px 20px;
    border-radius: 50px;
    gap: 8px;
}

#wft-whatsapp-button.wft-with-text.wft-size-small {
    padding: 8px 16px;
    font-size: 14px;
}

#wft-whatsapp-button.wft-with-text.wft-size-medium {
    padding: 12px 20px;
    font-size: 16px;
}

#wft-whatsapp-button.wft-with-text.wft-size-large {
    padding: 16px 24px;
    font-size: 18px;
}

/* Posiciones del botón */
#wft-whatsapp-button.wft-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#wft-whatsapp-button.wft-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

#wft-whatsapp-button.wft-position-middle-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

#wft-whatsapp-button.wft-position-middle-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

/* Efectos hover */
#wft-whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#wft-whatsapp-button.wft-position-middle-right:hover,
#wft-whatsapp-button.wft-position-middle-left:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Animación de pulso */
@keyframes wft-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

#wft-whatsapp-button.wft-pulse {
    animation: wft-pulse 2s infinite;
}

/* Animación de entrada */
@keyframes wft-slide-in-right {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wft-slide-in-left {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#wft-whatsapp-button.wft-position-bottom-right,
#wft-whatsapp-button.wft-position-middle-right {
    animation: wft-slide-in-right 0.5s ease-out;
}

#wft-whatsapp-button.wft-position-bottom-left,
#wft-whatsapp-button.wft-position-middle-left {
    animation: wft-slide-in-left 0.5s ease-out;
}

/* Estilos para el shortcode */
.wft-dynamic-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wft-dynamic-link:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Estilo button para shortcode */
.wft-dynamic-link.wft-button-style {
    background-color: #25d366;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wft-dynamic-link.wft-button-style:hover {
    background-color: #20ba5a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: white;
}

/* Estilo bubble para shortcode */
.wft-dynamic-link.wft-bubble-style {
    background-color: #25d366;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.wft-dynamic-link.wft-bubble-style .wft-text {
    display: none;
}

.wft-dynamic-link.wft-bubble-style .wft-icon {
    width: 28px;
    height: 28px;
}

.wft-dynamic-link.wft-bubble-style:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Icono SVG */
#wft-whatsapp-button svg,
.wft-dynamic-link svg {
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}

/* Texto del botón */
.wft-button-text {
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

/* Responsivo móvil */
@media (max-width: 768px) {
    #wft-whatsapp-button.wft-position-bottom-right,
    #wft-whatsapp-button.wft-position-bottom-left {
        bottom: 15px;
    }
    
    #wft-whatsapp-button.wft-position-bottom-right,
    #wft-whatsapp-button.wft-position-middle-right {
        right: 15px;
    }
    
    #wft-whatsapp-button.wft-position-bottom-left,
    #wft-whatsapp-button.wft-position-middle-left {
        left: 15px;
    }
    
    /* En móvil, el bubble puede ser un poco más pequeño */
    #wft-whatsapp-button.wft-bubble.wft-size-large {
        width: 64px;
        height: 64px;
    }
}

/* Ocultar en impresión */
@media print {
    #wft-whatsapp-button,
    .wft-dynamic-link {
        display: none !important;
    }
}

/* Tooltip opcional para mostrar "WhatsApp" al hover */
#wft-whatsapp-button.wft-bubble::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

#wft-whatsapp-button.wft-bubble:hover::after {
    opacity: 1;
}

/* Compatibilidad con Elementor */
.elementor-widget .wft-dynamic-link {
    width: auto;
    display: inline-flex;
}

/* Z-index para asegurar que esté sobre otros elementos */
#wft-whatsapp-button {
    z-index: 99999;
}
