/*main grid*/

main {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
}

/* section from grid areas*/

.section1 {
  grid-area: 1 / 1 / span 1 / span 1;
  background-color: var(--bg-white-color);
}

.section2 {
  grid-area: 1 / 2 / span 1 / span 1;
}

.section3 {
  grid-area: 2 / 1 / span 1 / span 2;
  text-align: center;
}

/* item 1 from section grid area*/

.item1 {
  display: flex;
  padding: 24px;
  justify-content: center;
}
.item1 img {
  width: 50%;
}

img {
  max-width: 100%;
  max-height: 100%;
}

/* item 2 from section grid area*/

.item2 {
  display: flex;
  flex-basis: 80%;
  background-color: var(--bg-beige-color);
  height: 100%;
}

#details {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  row-gap: 16px;
  align-items: center;
  padding: 24px;
  font-size: x-large;
}

#title {
  grid-area: 1 / 1 / span 1 / span 5;
  align-items: start;
}

h1 {
  margin-top: 0px;
}

#size {
  grid-area: 2 / 1 / span 1 / span 1;
}

#measure {
  grid-area: 2 / 2 / span 1 / span 1;
}
#qty {
  grid-area: 2 / 4 / span 1 / span 1;
}

#number {
  grid-area: 2 / 5 / span 1 / span 1;
}

#delivery {
  grid-area: 3 / 1 / span 1 / span 1;
}

#free {
  grid-area: 3 / 2 / span 1 / span 1;
}

#price {
  grid-area: 4 / 1 / span 1 / span 1;
  color: var(--primary-color);
}

/* item 3 from section grid area*/

.item3 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#tot-payment {
  display: flex;
  gap: 8px;
  text-transform: capitalize;
  font-size: x-large;
  align-items: center;
}

#tot-payment #total,
#tot-payment #final-price {
  flex-basis: 50%;
  background-color: var(--bg-beige-color);
  padding: 24px 0 24px 0;
}

@media (max-width: 800px) {
  main {
    display: flex;
    flex-direction: column;
  }

  .item1 img {
    /* the object-fit property will fit image without changing the proportionally.
    Ref: https: //www.geeksforgeeks.org/resize-image-proportionally-with-css/ */
    object-fit: contain;
    max-height: 30vh;
  }
}
