.wrapper { display: flex; justify-content: center; margin: 0px auto; max-width: 600px; width: 100%; } .searchBar, .directionsContainer { display: flex; align-items: end; /* Ensure all items remain aligned in the center */ width: 100%; background-color: white; padding: 10px; border: 1px solid #ddd; border-radius: 30px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); flex-wrap: nowrap; /* Prevent items from wrapping to the next line */ } .inputField { flex-grow: 1; padding: 10px 15px; font-size: 16px; border: 1px solid #ddd; border-radius: 30px; outline: none; margin-right: 10px; min-width: 0; /* Ensure the input field remains flexible */ } .buttons { display: flex; justify-content: flex-end; gap: 10px; } .iconButton { display: flex; align-items: center; justify-content: center; background-color: transparent; border: none; padding: 12px 20px; border-radius: 10px; background-color: #f0f0f0; color: black; cursor: pointer; font-size: 16px; transition: background-color 0.3s ease; width: auto; } .iconButton:hover { background-color: #e0e0e0; } .iconButton img { width: 20px; height: 20px; } /* Expanded view for the direction inputs */ .directionsContainer { flex-direction: column; gap: 10px; } .directionsInputs { display: flex; width: 100%; gap: 10px; } .directionsInputs .inputField { flex: 1; } /* Media query for responsive design */ @media (max-width: 768px) { .wrapper { max-width: 100%; padding: 10px; } /* Keep buttons and input fields inline */ .searchBar, .directionsContainer { flex-direction: row; /* Keep items in a row */ align-items: center; /* Keep buttons and inputs on the same line */ flex-wrap: nowrap; /* Prevent items from wrapping */ padding: 8px; } .inputField { width: 100%; flex-grow: 1; margin-right: 10px; } .buttons { width: auto; gap: 5px; } .iconButton { width: auto; padding: 10px; } }