* { box-sizing: border-box; } body { margin: 0; height: 100vh; background-color: pink; display: flex; align-items: center; justify-content: center; background: url("bg.svg") center center/auto repeat, linear-gradient(to bottom, transparent, pink); } .search-grid { width: 100%; margin-left: 10em; margin-right: 10em; display: grid; gap: 5em; grid-template-rows: 10em 4em 17em; } .search { width: 100%; grid-row: 2; grid-column: 1 / span 2; } .search-logo { grid-row: 1; height: 100%; width: 100%; display: flex; flex-direction: row; align-items: center; justify-content: space-between; color: black; } .cards { height: 100%; width: 100%; display: flex; flex-direction: row; justify-content: space-around; flex-wrap: wrap; gap: 1em; overflow: auto; } @media (max-height: 500px) { .search-grid { grid-template-rows: 4em; } .search-logo { display: none; } .cards { display: none; } } .card { background-color: rgba(255, 255, 255, 0.5); width: 10em; display: flex; flex-direction: column; align-items: center; justify-content: space-around; color: black; gap: 1em; padding: 1em; height: 15em; border-radius: 1em; } #listings .card { background-color: rgba(255, 0, 0, 0.5); } #listings .in-stock { background-color: rgba(125, 255, 125, 0.5); } .card h3 { margin: 0; } .card-image { height: 100%; aspect-ratio: 1/1; } .search-logo img { height: 100%; } .grid-item { background-color: lightblue; padding: 1em; border-radius: 0.5em; }