  We revisit the quark-mass density-dependent model -- a phenomenological
equation of state for deconfined quark matter in the high-density
low-temperature regime -- and show that thermodynamic inconsistencies that have
plagued the model for decades, can be solved if the model is formulated in the
canonical ensemble instead of the grand canonical one. Within the new
formulation, the minimum of the energy per baryon occurs at zero pressure, and
the Euler's relation is verified. Adopting a typical mass-formula, we first
analyze in detail a simple model with one particle species. We show that a
``bag'' term that produces quark confinement naturally appears in the pressure
(and not in the energy density) due to density dependence of the quark masses.
Additionally, the chemical potential gains a new term as in other models with
quark repulsive interactions. Then, we extend the formalism to the
astrophysically realistic case of charge-neutral three-flavor quark matter in
equilibrium under weak interactions, focusing on two different mass formulae: a
flavor dependent and a flavor blind one. For these two models, we derive the
equation of state and analyze its behavior for several parameter choices. We
systematically analyze the parameter space and identify the regions
corresponding to self-bound 2-flavor and 3-flavor quark matter, hybrid matter
and causal behavior.
