@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

:root {
  --gray-1: #fff;
  --gray-2: #e5e5e5;
  --gray-3: #cfcfcf;
  --gray-4: #555;
}

.active {
  display: flex;
}

.inactive {
  display: none;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background-color: var(--gray-3);
  margin: 0;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  font-style: normal;
}

header {
  left: 50%;
  transform: translateX(-50%);
  position: fixed;
  width: 100%;
  max-width: 1024px;
  height: fit-content;
  margin: auto;
  background-color: var(--gray-1);
  box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
    rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;

  #main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;

    #main-logo {
      font-size: 2rem;
      font-weight: 700;
      color: black;
      text-decoration: none;
      margin: 1rem 2rem;

      &:hover {
        color: var(--gray-3);
      }
    }

    button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      height: fit-content;
      padding: 0.5rem 1rem;
      margin: 1rem 2rem;
      border: none;
      border-radius: 2rem;
      font-weight: 700;
      background-color: var(--gray-1);
      color: var(black);
      cursor: pointer;

      #count_product {
        background-color: var(--gray-3);
        padding: 0.2rem 0.5rem;
        border-radius: 1rem;
        font-size: 1rem;
        color: black;
      }

      &:hover {
        background-color: black;
        color: var(--gray-1);

        #count_product {
          background-color: var(--gray-1);
        }
      }
    }
  }

  #navbar > ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 1rem 0;

    li {
      list-style: none;
    }

    a {
      text-decoration: none;
      color: black;
      font-weight: 700;
      font-size: 1.2rem;
      height: fit-content;
      padding: 0.5rem 1rem;
      border: none;
      border-radius: 2rem;
    }

    a:hover {
      cursor: pointer;
      background-color: var(--gray-3);
    }
  }
}

main {
  max-width: 1024px;
  margin: auto;
  padding-bottom: 4rem;
  background-color: var(--gray-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  #discount-banner {
    background-color: black;
    color: var(--gray-1);
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
      rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
  }

  #hero-contrainer {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 4rem;

    #hero {
      display: flex;
      flex-direction: column;
      padding: 2rem 4rem;
      gap: 1rem;
      width: 60%;

      h1 {
        margin: 0;
        padding-top: 6rem;
        font-size: 4rem;
        font-weight: 700;
        color: black;
      }

      p {
        margin: 0;
        font-size: 1.2rem;
        color: var(--gray-3);
      }
    }
  }

  .product-section {
    display: flex;
    flex-direction: column;
    width: 100%;

    .product-section-title {
      padding: 2rem 4rem;
      margin: 0;
    }

    .products-listed {
      display: grid;
      padding: 0 4rem;

      @media only screen and (min-width: 720px) {
        grid-template-columns: repeat(3, 1fr);
      }

      article {
        display: flex;
        flex-direction: column;
        padding: 0.4rem;
        gap: 0.4rem;

        img {
          width: 100%;
          background-color: var(--gray-1);
          border-radius: 0.1rem;
          box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
            rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
        }

        .product-text {
          display: grid;
          margin-top: 0.6rem;
          grid-template-columns: 3fr 2fr;
        }

        .product-text-elements {
          display: flex;
          flex-direction: column;
          justify-content: center;
          gap: 0.4rem;
          height: 100%;

          h3,
          p {
            margin: 0;
            font-size: 14px;
          }
        }

        button {
          width: fit-content;
          height: fit-content;
          padding: 1rem;
          background-color: var(--gray-1);
          border: none;
          border-radius: 2rem;
          font-weight: 700;
          color: var(black);
          cursor: pointer;
          margin: auto;

          &:hover {
            background-color: var(--gray-3);
          }
        }
      }
    }
  }
}

footer {
  background-color: black;
  color: var(--gray-1);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  max-width: 1024px;
  margin: auto;
}

#cartModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

#modal-content {
  background-color: var(--gray-1);
  padding: 2rem;
  border-radius: 0.5rem;
  display: flex;
  width: 80%;
  height: 80%;
  max-width: 1024px;
  flex-direction: column;
  box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
    rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;

  #modal-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    h3 {
      font-size: 1.5rem;
      font-weight: 700;
      color: black;
      margin: 0;
    }

    button {
      background-color: transparent;
      border: none;
      font-size: 1.5rem;
      color: black;
      cursor: pointer;

      &:hover {
        color: var(--gray-3);
      }
    }
  }

  #modal-body {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: space-between;
    width: 100%;
    height: 90%;
    flex-wrap: wrap;
    overflow-y: auto;

    @media only screen and (min-width: 1024px) {
      flex-wrap: nowrap;
    }

    #modal-products-list {
      display: flex;
      flex-direction: column;
      width: 100%;
      overflow-y: auto;
    }

    #clean-cart-button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      width: fit-content;
      height: fit-content;
      padding: 1rem 2rem;
      background-color: black;
      border: none;
      border-radius: 2rem;
      font-weight: 700;
      color: var(--gray-1);
      cursor: pointer;

      i {
        font-size: 1.2rem;
      }

      &:hover {
        background-color: var(--gray-3);
        color: black;
      }
    }
  }

  .cart-product-card {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
    border-top: 1px solid var(--gray-3);
    padding-top: 1rem;

    img {
      width: 8rem;
      height: 8rem;
      object-fit: cover;
      box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
        rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
    }
  }

  .cart-product-card-text {
    display: flex;
    flex-direction: column;
    color: black;

    h3 {
      margin: 0;
      font-size: 1.2rem;
      font-weight: 700;
    }

    span {
      font-size: 1rem;
    }

    .cart-product-price {
      margin-top: auto;
      font-size: 1.5rem;
      color: var(--gray-4);
      font-weight: 700;
    }
    .cart-discounted-price {
      font-size: 0.8rem;
      margin-top: auto;
      margin-bottom: 0;
      text-decoration: line-through;
      color: var(--gray-3);
    }

    .ammount-container {
      display: flex;
      flex-direction: row;
      align-items: center;
      width: 100%;
      gap: 0.6rem;

      .bin-button {
        display: flex;
        justify-content: center;
        align-items: center;
        height: fit-content;
        border: none;
        padding: 0.25rem;
        background: none;

        &:hover {
          cursor: pointer;
        }
      }
    }

    .cart-product-amount {
      display: flex;
      width: fit-content;
      border: 2px solid var(--gray-4);
      margin: 0.2rem 0;
      border-radius: 0.6rem;
      overflow: hidden;

      span {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.2rem 0.8rem;
      }

      button {
        border: none;
        color: black;
        cursor: pointer;
        padding: 0.2rem 0.8rem;
        background-color: transparent;
        font-size: large;
        font-weight: 700;

        &:hover {
          background-color: var(--gray-3);
          color: black;
        }
      }

      .subtrack-button-amount {
        border-right: 2px solid var(--gray-4);
      }

      .add-button-amount {
        border-left: 2px solid var(--gray-4);
      }
    }

    .total-product-price {
      font-size: 1.2rem;
      font-weight: 700;
      color: black;
      margin-top: auto;
    }
  }

  #checkout-summary {
    background-color: var(--gray-2);
    padding: 2rem;
    display: flex;
    gap: 2rem;
    width: 100%;
    height: fit-content;
    flex-direction: column;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
      rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;

    h4 {
      margin: 0;
      display: flex;
      justify-content: space-between;
      gap: 4rem;
      font-size: 1.2rem;
      font-weight: 700;
    }

    #total-amount {
      display: flex;
      justify-content: space-between;
      font-size: 1.2rem;
      font-weight: 700;
    }

    #checkout-button {
      display: flex;
      justify-content: right;
      align-items: center;
    }

    a {
      width: fit-content;
      height: fit-content;
      padding: 1rem 2rem;
      background-color: black;
      text-decoration: none;
      border: none;
      border-radius: 2rem;
      font-weight: 700;
      color: var(--gray-1);
      cursor: pointer;
      text-align: center;

      &:hover {
        background-color: var(--gray-3);
        color: black;
      }
    }
  }
}
