We perform a comprehensive study of the Higgs sector in the framework of the next-to-minimal supersymmetric standard model with CP-violating parameters in the superpotential and in the soft-supersymmetry-breaking sector. Since the CP is no longer a good symmetry, the two CP-odd and the three CP-even Higgs bosons of the next-to-minimal supersymmetric standard model in the CP-conserving limit will mix. We show explicitly how the mass spectrum and couplings to gauge bosons of the various Higgs bosons change when the CP-violating phases take on nonzero values. We include full one-loop and the logarithmically enhanced two-loop effects employing the renormalization-group (RG) improved approach. In addition, the LEP limits, the global minimum condition, and the positivity of the square of the Higgs-boson mass have been imposed. We demonstrate the effects on the Higgs-mass spectrum and the couplings to gauge bosons with and without the RG-improved corrections. Substantial modifications to the allowed parameter space happen because of the changes to the Higgs-boson spectrum and their couplings with the RG-improved corrections. Finally, we calculate the mass spectrum and couplings of the few selected scenarios and compare to the previous results in literature where possible; in particular, we illustrate a scenario motivated by electroweak baryogenesis.