@import url(reset.css);
@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");

:root {
  --green-normal: hsl(158, 36%, 37%);
  --green-bold: hsl(158, 42%, 18%);
  --black: hsl(212, 21%, 14%);
  --grey: hsl(228, 12%, 48%);
  --cream: hsl(30, 38%, 92%);
  --white: hsl(0, 0%, 100%);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--cream);
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.attribution {
  font-size: 11px;
  text-align: center;
}
.attribution a {
  color: hsl(228, 45%, 44%);
}

.product-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 2fr;
  min-height: 200px;
  max-height: 90vh;
  height: fit-content;
  width: 90%;
  border-radius: 0.5em;
  overflow: hidden;
}

#img-container {
  grid-area: 1 / 1 / 2 / 2;
}

#info-container {
  grid-area: 2 / 1 / 3 / 2;
  background-color: var(--white);
  padding: 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

#btn-container button {
  display: flex;
  background-color: var(--green-normal);
  color: var(--white);
  width: 100%;
  height: 3rem;
  border-radius: 0.5rem;
  border: none;
  justify-content: center;
  align-items: center;
  gap: 1em;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
}

#btn-container button:hover {
  background-color: var(--green-bold);
}

#price-container {
  display: flex;
  flex-direction: row;
  gap: 1em;
  align-items: center;
}

#product-type {
  font-family: "Montserrat", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--grey);
  letter-spacing: 0.3rem;
  font-weight: 500;
}

#product-name {
  font-family: "Fraunces", serif;
  line-height: 1;
  font-size: 2rem;
  color: var(--black);
}

#product-description {
  font-family: "Montserrat", sans-serif;
  color: var(--grey);
  font-size: 1em;
  font-weight: 500;
}

#sale-price {
  color: var(--green-normal);
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 2rem;
}

#normal-price {
  font-family: "Montserrat", sans-serif;
  color: var(--grey);
  font-size: 1rem;
  text-decoration: line-through;
}

@media (min-width: 30em) {
  .product-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    width: 45%;
    min-width: 480px;
  }

  #img-container {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    height: 100%;
  }

  #img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  #info-container {
    grid-area: 1 / 2 / 2 / 3;
    width: 100%;
    height: 100%;
  }
}
