One does not have to be on a beach to see a girl’s shape. It’s apparent when she’s fully dressed anywhere, unless she’s in a loose fitting nun’s habit. What real difference is there between a bikini and a blouse and jeans outfit? Not much. There’s the girl and a boy can’t help seeing her.
Modesty then becomes wearing what is appropriate for the location and situation, but not covering up. .
Can one look lustfully even a modestly dressed person? Yes.
(The words of Jesus regarding looking lustfully where first directed in general)
There is though yes a big difference in someone being immodestly dressed and someone being modestly dressed.
Catechism
2521 Purity requires modesty, an integral part of temperance. Modesty protects the intimate center of the person. It means refusing to unveil what should remain hidden. It is ordered to chastity to whose sensitivity it bears witness. It guides how one looks at others and behaves toward them in conformity with the dignity of persons and their solidarity.
2522 Modesty protects the mystery of persons and their love. It encourages patience and moderation in loving relationships; it requires that the conditions for the definitive giving and commitment of man and woman to one another be fulfilled. Modesty is decency. It inspires one’s choice of clothing. It keeps silence or reserve where there is evident risk of unhealthy curiosity. It is discreet.
2523 There is a modesty of the feelings as well as of the body. It protests, for example, against the voyeuristic explorations of the human body in certain advertisements, or against the solicitations of certain media that go too far in the exhibition of intimate things. Modesty inspires a way of life which makes it possible to resist the allurements of fashion and the pressures of prevailing ideologies.
2524 The forms taken by modesty vary from one culture to another. Everywhere, however, modesty exists as an intuition of the spiritual dignity proper to man. It is born with the awakening consciousness of being a subject. Teaching modesty to children and adolescents means awakening in them respect for the human person.
2525 Christian purity requires a purification of the social climate. It requires of the communications media that their presentations show concern for respect and restraint. Purity of heart brings freedom from widespread eroticism and avoids entertainment inclined to voyeurism and illusion.
2526 So called moral permissiveness rests on an erroneous conception of human freedom; the necessary precondition for the development of true freedom is to let oneself be educated in the moral law. Those in charge of education can reasonably be expected to give young people instruction respectful of the truth, the qualities of the heart, and the moral and spiritual dignity of man.
2527 "The Good News of Christ continually renews the life and culture of fallen man; it combats and removes the error and evil which flow from the ever-present attraction of sin. It never ceases to purify and elevate the morality of peoples. It takes the spiritual qualities and endowments of every age and nation, and with supernatural riches it causes them to blossom, as it were, from within; it fortifies, completes, and restores them in Christ."316
scborromeo.org/ccc/p3s2c2a9.htm#I