/* WhatsApp Flotante - Estilos v1.1 */

.whatsapp-flotante-container {
    position: fixed;
    bottom: 20px;
    z-index: 999;
    animation: slideIn 0.5s ease-in-out;
}

.whatsapp-flotante-container[data-posicion="derecha"] {
    right: 20px;
}

.whatsapp-flotante-container[data-posicion="izquierda"] {
    left: 20px;
}

.whatsapp-flotante-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp-flotante-color, #25D366);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    border: none;
    cursor: pointer;
}

.whatsapp-flotante-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.whatsapp-flotante-btn:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: white;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

/* Tooltip Mejorado v1.3 - Compacto y Estilizado */
.whatsapp-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    bottom: 85px;
    right: 50%;
    transform: translateX(50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 1001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    word-wrap: break-word;
    white-space: normal;
    max-width: 140px;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Flecha del tooltip - más pequeña y elegante */
.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a1a1a;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.whatsapp-flotante-btn:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 80px;
}

/* Animación de entrada del tooltip */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(50%) translateY(0);
    }
}

/* Animación de entrada del botón */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - Tablets */
@media (max-width: 768px) {
    .whatsapp-flotante-btn {
        width: 56px;
        height: 56px;
    }

    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }

    .whatsapp-tooltip {
        font-size: 12px;
        padding: 7px 11px;
        max-width: 130px;
        bottom: 78px;
    }

    .whatsapp-tooltip::after {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid #1a1a1a;
        bottom: -5px;
    }

    .whatsapp-flotante-container {
        bottom: 15px;
    }

    .whatsapp-flotante-container[data-posicion="derecha"] {
        right: 15px;
    }

    .whatsapp-flotante-container[data-posicion="izquierda"] {
        left: 15px;
    }
}

/* Responsive - Móviles */
@media (max-width: 480px) {
    .whatsapp-flotante-btn {
        width: 52px;
        height: 52px;
    }

    .whatsapp-icon {
        width: 26px;
        height: 26px;
    }

    /* Ocultar tooltip en móviles para mejor UX */
    .whatsapp-tooltip {
        display: none;
    }

    .whatsapp-flotante-container {
        bottom: 12px;
    }

    .whatsapp-flotante-container[data-posicion="derecha"] {
        right: 12px;
    }

    .whatsapp-flotante-container[data-posicion="izquierda"] {
        left: 12px;
    }
}

/* Accesibilidad */
.whatsapp-flotante-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.whatsapp-flotante-btn:focus:not(:focus-visible) {
    outline: none;
}

.whatsapp-flotante-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Soporte para modo oscuro */
@media (prefers-color-scheme: dark) {
    .whatsapp-tooltip {
        background-color: #1a1a1a;
        border: 1px solid #333;
    }

    .whatsapp-tooltip::after {
        border-top-color: #1a1a1a;
    }
}
