@media only screen and (max-width: 510px) {
  .item-head {
    width: 370px !important;
  }
}

@media only screen and (max-width: 440px) {
  .item-head {
    width: 280px !important;
  }
}

body {
  background-color: #333332;
  padding: 52px 35px;
}
#items {
  height: 100vh;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 70px;
}
.item {
  position: relative;
  height: 360px;
  margin: 30px 10px 30px 10px;
}
.item-head {
  width: 400px;
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fefefe;
  border-radius: 4px;
  position: relative;
  bottom: 2px;
  transition: all 0.6s ease;
  box-shadow: 0 9px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.img-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.fade {
  opacity: 0.8;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #333333;
  transition: all 0.6s ease;

}

.img {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.item-footer {
  width: 100%;
  height: 224px;
  font-size: 18px;
  margin-top: 10px;
  background-color: #fefefe;
  position: absolute;
  top: 0px;
  box-sizing: border-box;
  padding: 24px;
  transition: all 0.6s ease;
  z-index: -1;
}
.head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.price {
  font-size: 26px;
  margin-right: 10px;
  color: grey;
  font-weight: 800;
}

.name {
  font-size: 20px;
  font-weight: 800;
}

.btn {
  margin-top: 26px;
  width: 100%;
  height: 40px;
  font-size: medium;
  font-weight: 600;
  color: white;
  background-color: turquoise;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.btn:hover {
  background-color: #42bbb0;
}

.container:hover > .item-head {
  bottom: 110px;
  box-shadow: 0 0px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.container:hover > .item-footer {
  top: 110px;
  box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.container:hover {
  height: 350px;
}

.container:hover > .item-head > .img-container > .fade {
  opacity: 0;
}
