We study the in-medium effects in strangeness production in heavy-ion collisions at (sub)threshold energies of (1-2)A GeV based on the microscopic Parton-Hadron-String Dynamics (PHSD) transport approach. The in-medium modifications of the antikaon ( K = K − , K0 ) properties are described via the self-consistent coupledchannel unitarized scheme based on a SU(3) chiral Lagrangian which incorporates explicitly the s and p waves of the kaon-nucleon interaction. This scheme provides the antikaon potential, spectral functions, and reaction cross sections as well as their dependence on baryon density, temperature, and antikaon momentum in the nuclear medium, which are incorporated in the off-shell dynamics of the PHSD. The in-medium modification of kaons (K = K + , K 0 ) are accounted via the kaon-nuclear potential, which is assumed to be proportional to the local baryon density. The manifestation of the medium effects in observables is investigated for the K and K rapidity distributions, p T spectra, the polar and azimuthal angular distributions, and directed (v 1 ) and elliptic (v 2 ) flows in C+C, Ni+Ni, and Au+Au collisions. We find-by comparison to experimental data from the KaoS, FOPI, and HADES Collaborations-that the modifications of (anti)kaon properties in nuclear matter are necessary to explain the data in a consistent manner. Moreover, we demonstrate the sensitivity of kaon observables to the equation of state of nuclear matter.