@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&display=swap");

:root {
  --Red: hsl(14, 86%, 42%);
  --Green: hsl(159, 69%, 38%);
  --Rose50: hsl(20, 50%, 98%);
  --Rose100: hsl(13, 31%, 94%);
  --Rose300: hsl(14, 25%, 72%);
  --Rose400: hsl(7, 20%, 60%);
  --Rose500: hsl(12, 20%, 44%);
  --Rose900: hsl(14, 65%, 9%);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

body {
  font-size: 1.6rem;
  font-family: "Red Hat Text", serif;
}

a {
  text-decoration: none;
}

main {
  background: var(--Rose50);
  padding: 10.2rem 12.8rem;
  display: flex;
  align-items: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4rem;
}

.product-side {
  flex-grow: 14;
}

.cart-side {
  flex-grow: 2;
}

h2.product-side__heading {
  font-size: 4.4rem;
}

.product-side__content {
  margin-top: 2.4rem;
  display: grid;
  gap: 2.4rem;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

.product__image {
  max-width: 100%;
  border-radius: 1.8rem;
  display: block;
}

.product__cart {
  width: 16.2rem;
  /* padding-block: 1rem; */
  height: 4.6rem;
  border-radius: 10rem;
  position: relative;
  overflow: hidden;
  background-color: #fff;
  transition: all 0.2s ease-in-out;
  margin: auto;
  transform: translateY(-50%);
}

a.product__cart--front,
a.product__cart--back {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4.6rem;
  width: 100%;
  position: absolute;
  transition: all 0.2s ease-in-out;
}

a.product__cart--front span {
  color: var(--Rose900);
  font-weight: 500;
  margin-left: 6px;
}

a.product__cart--back {
  transform: translateY(100%);
  padding-inline: 1.6rem;
  justify-content: space-between;
}

.quantity-control {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid #fff;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product__cart--quantity {
  color: #fff;
  font-size: 1.8rem;
}

/* Cart button hover effect */

.product__cart:hover {
  background-color: var(--Red);
}

.product__cart:hover a.product__cart--front {
  transform: translateY(-100%);
}

.product__cart:hover a.product__cart--back {
  transform: translateY(0);
}

.product__texts {
  margin-top: -2rem;
}

.product__category {
  color: var(--Rose400);
  font-weight: 400;
}

.product__name {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--Rose900);
  margin-block: 4px;
}

.product__price {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--Red);
}

/* cart side */
.cart-side {
  background-color: #fff;
  border-radius: 1.6rem;
  padding: 2.8rem;
}

.cart-side__heading {
  font-size: 2.8rem;
  color: var(--Red);
  margin-bottom: 2rem;
}

.cart-side__content-true .cart__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-side__content-true .cart__item .cart__item--Left .cart__item__name {
  color: var(--Rose900);
  margin-bottom: 1rem;
}
.cart-side__content-true .cart__item {
  border-bottom: 1px solid var(--Rose100);
  padding-bottom: 1.6rem;
}

.cart__item__left--bottom {
  display: flex;
  gap: 2rem;
}

.cart__item__left--bottom .item-quantiy {
  color: var(--Red);
}

.item-price,
.item-price--total {
  color: var(--Rose500);
}

btn-close.quantity-control {
  display: inline-block;
  border: 2px solid #909090;
}

.cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.6rem;
}

.cart__total--left {
  color: var(--Rose900);
}

.cart__total--price h3 {
  font-size: 2.4rem;
  color: var(--Rose900);
}

.cart__carbon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--Rose100);
  padding: 1.6rem;
  border-radius: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  gap: 1rem;
  color: var(--Rose900);
}

.cart__confirm {
  text-align: center;
}

a.cart__confirm--btn {
  width: 100%;
  display: inline-block;
  padding: 1.2rem;
  background: var(--Red);
  color: #fff;
  border-radius: 10rem;
  font-weight: 500;
  font-size: 1.8rem;
}

.cart-side__content-false {
  text-align: center;
}

.cart-side__content-false .cart__empty-para {
  margin-top: 2rem;
}

.hidden {
  display: none;
}

.confirmation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  /* display: none; */
  animation-name: fadeEffect;
  animation-duration: 0.6s;
  animation-timing-function: ease;
  /* animation-delay: 1s; */
  animation-direction: normal;
  animation-fill-mode: forwards;
}

.confirmation-box {
  background: #fff;
  width: 60rem;
  min-width: 35rem;
  border-radius: 1.2rem;
  padding: 4rem;
  transform: translateY(0);
  transition: all 0.6s ease;
  opacity: 1;
  /* transition: transform 0.6s ease; */
}

.confirmation-icon {
  width: 4rem;
}

.confirmation-icon img {
  width: 100%;
}

h2.confirmation-heading {
  font-size: 4.2rem;
  padding-block: 1.6rem 0.6rem;
  color: var(--Rose900);
}

p.confirmation-para {
  color: var(--Rose400);
}

.confirmation-content {
  margin-top: 3.2rem;
  background: var(--Rose100);
  padding: 2rem;
  border-radius: 1rem;
}

.confirmation-items {
  margin-bottom: 4rem;
}

.confirmation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.confirmation-item + .confirmation-item {
  margin-top: 1.6rem;
}

.confirmation-item img {
  width: 6rem;
  border-radius: 6px;
}

.c-item-texts {
  margin-right: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.c-item-name {
  font-weight: 600;
  color: var(--Rose900);
}

.c-item-price {
  color: var(--Rose500);
}

.c-item-net-price {
  color: var(--Rose900);
  font-weight: 600;
  font-size: 1.8rem;
}

.confirmation-total {
  display: flex;
  justify-content: space-between;
}

p.c-total-para {
  color: var(--Rose500);
}

h3.c-total {
  font-size: 2.4rem;
  color: var(--Rose900);
}

a.confirmation-btn {
  width: 100%;
  margin-top: 4rem;
  display: inline-block;
  text-align: center;
  color: #fff;
  background-color: var(--Red);
  padding: 1.4rem;
  border-radius: 10rem;
  font-weight: 500;
}

.confirmation.hidden {
  opacity: 0;
  display: none;
}

.confirmation.hidden .confirmation-box {
  opacity: 0;
  transform: translateY(10rem);
}

@keyframes fadeEffect {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@media only screen and (min-width: 670px) {
  .cart-side {
    min-width: 40.4rem;
  }
}

@media only screen and (max-width: 669px) {
  main {
    padding: 2.4rem 2.8rem;
  }

  .cart-side {
    padding: 1.8rem;
  }
}
