The "simplification" causes overflow when the screen width is smaller than card-container. Putting the inner min() inside minmax() ensures that card-container will never be larger than the screen width.
.card-container {
display: grid;
- grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
grid-gap: 1rem;
margin-inline: auto;
margin-block-end: 1rem;