We consider the production of a pair of heavy quarks ( QQ¯ ) in hadronic collisions. When the transverse momentum qT of the heavy-quark pair is much smaller than its invariant mass, the QCD perturbative expansion is affected by large logarithmic terms that must be resummed to all orders. This behavior is well known from the simpler case of hadroproduction of colorless high-mass systems, such as vector or Higgs boson(s). In the case of QQ¯ production, the final-state heavy quarks carry color charge and are responsible for additional soft radiation (through direct emission and interferences with initial-state radiation) that complicates the evaluation of the logarithmically-enhanced terms in the small- qT region. We present the all-order resummation structure of the logarithmic contributions, which includes color flow evolution factors due to soft wide-angle radiation. Resummation is performed at the completely differential level with respect to the kinematical variables of the produced heavy quarks. Soft-parton radiation produces azimuthal correlations that are fully taken into account by the resummation formalism. These azimuthal correlations are entangled with those that are produced by initial-state collinear radiation. We present explicit analytical results up to next-to-leading order and next-to-next-to-leading logarithmic accuracy.