@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

body {
  background-color: hsl(30, 38%, 92%);
  color: hsl(228, 12%, 48%);
  min-height: 100vh;

  display: flex;
  align-items: center;
}

main {
  margin: 2rem auto;
}

.card {
  background-color: hsl(0, 0%, 100%);
  max-width: 600px;
  border-radius: 1rem;
  overflow: hidden;
  margin: 0 2em;

  display: grid;
  grid-template-columns: 1fr 1fr;
}

.img img {
  /* border-radius: 1rem 0 0 1rem; */
  max-width: 100%;
  height: auto;
  display: inherit;
}

.content {
  padding: 2em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.9em;
}

.name {
  color: hsl(212, 21%, 14%);
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 2.3em;
  line-height: 1.1em;
}

.description {
  line-height: 1.5em;
}

.price {
  font-family: "Fraunces", serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 1.2em;
}

.price .discount {
  color: hsl(158, 36%, 37%);
  font-size: 2em;
}

.price .mrp {
  text-decoration: line-through;
  font-size: 1em;
}

button {
  font: inherit;
}

button.cart {
  background-color: hsl(158, 36%, 37%);
  color: hsl(0, 0%, 100%);
  border: none;
  padding: 1em;
  border-radius: 1em;
  font-weight: 700;
  width: 100%;

  display: flex;
  justify-content: center;
  gap: 0.5rem;

  transition: background-color 0.2s ease-in-out;
}

button.cart:hover {
  background-color: hsl(158, 42%, 18%);
  cursor: pointer;
}

.img .img-mobile {
  display: none;
}

@media screen and (max-width: 620px) {
  .card {
    grid-template-columns: 1fr;
  }
  .img .img-mobile {
    display: block;
    object-fit: cover;
  }
  .img .img-desktop {
    display: none;
  }

  .content {
    display: block;
  }

  .category,
  .name,
  .description,
  .price {
    padding-bottom: 0.8em;
  }
}

@media screen and (max-width: 390px) {
  html {
    font-size: 12px;
  }

  main {
    margin: 1rem auto;
  }

  .card {
    margin: 0 1em;
  }

  .content {
    padding: 1.5em;
  }

  .name {
    font-size: 2.1rem;
    line-height: 1em;
  }

  .category,
  .name,
  .description,
  .price {
    padding-bottom: 0.6em;
  }

  .price .discount {
    color: hsl(158, 36%, 37%);
    font-size: 1.7em;
  }

  button.cart {
    padding: 0.9em;
  }
}
