* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
body {
  background-color: #f5f5f5;
}
.search-container {
  display: flex;
  padding: 20px 0px 15px 0px;
  margin: 20px;
  justify-content: center;
  align-items: center;
}

.search-box {
  position: relative;
  width: 300px;
}
.search-box input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 2px solid rgb(5, 240, 240);
  border-radius: 10px;
  outline: none;
  font-size: 16px;
  transition: 0.3s ease-in-out;
}
.search-box input:focus {
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4);
}
.search-button {
  margin-left: 10px;
  padding: 10px 15px;
  border: none;
  background-color: rgb(5, 240, 240);
  color: black;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s ease-in-out;
}
.search-button:hover {
  transform: scale(1.02);
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4);
}

.container {
  display: flex;
  flex-direction: row;
}

.card-container {
  width: 75%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 2%;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: 200px;
}

.card img {
  width: 100%;
  border-radius: 10px;
}
.card h2 {
  margin: 6px 0;
  font-size: 110%;
  letter-spacing: 1px;
}
.card p {
  color: #000;
  margin: 3px 0;
  font-size: 85%;
  letter-spacing: 0.7px;
}
.btn-group {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  gap: 0.5rem;
}
.btn {
  font-size: 85%;
  padding: 8px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn.add {
  background-color: red;
  color: white;
  width: 60%;
}

.btn.added {
  background-color: rgba(255, 0, 0, 0.4);
}
.btn.details {
  background-color: rgb(5, 240, 240);
  color: black;
}

.cart-manage {
  width: 25%;
  padding: 2% 4% 2% 0%;
  margin-bottom: 20px;
}

.cart-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  background: white;
}
.cart-heading {
  width: 100%;
  color: red;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 120%;
  font-weight: bold;
  margin-bottom: 5px;
  padding: 10px 5px 5px 5px;
}

.cart-elements {
  display: flex;
  flex-direction: row;
  width: 100%;
  padding: 4px;
}

.cart-elements > .sl {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20%;
}

.cart-elements > .name {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40%;
}

.cart-elements > .cart-img {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40%;
}

.cart-img img {
  width: 50px;
  border-radius: 25%;
  padding: 3px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 24px;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.modal.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}
.modal-content {
  font-size: medium;
  background: white;
  padding: 10px;
  border-radius: 10px;
  width: 20%;
  text-align: center;
  transform: translateY(-20px);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.5s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-size: 120%;
  padding: 4px;
}

.modal-content p {
  font-size: 90%;
  line-height: 1.2;
}
.modal.show .modal-content {
  transform: translateY(0);
}
.modal img {
  width: 100%;
  border-radius: 10px;
}
.close {
  cursor: pointer;
  float: right;
  font-size: 20px;
}

@media screen and (max-width: 950px) {
  .card {
    width: 30%;
  }
  .container {
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
  }
  .card-container {
    width: 85%;
  }
  .cart-manage {
    width: 50%;
    padding: 2%;
  }
}

@media screen and (max-width: 670px) {
  .card {
    width: 40%;
  }
  .cart-manage {
    width: 60%;
  }
  .modal-content {
    width: 35%;
  }
  .modal-content h2 {
    font-size: 95%;
  }

  .modal-content p {
    font-size: 80%;
  }
}

@media screen and (max-width: 450px) {
  .card {
    width: 80%;
  }
  .cart-manage {
    width: 68%;
  }
  .modal-content {
    width: 50%;
  }
  .modal-content h2 {
    font-size: 90%;
  }

  .modal-content p {
    font-size: 75%;
  }
}
