:root {
  --very-dark-blue: hsl(220, 13%, 13%);
  --dark-grayish-blue: hsl(219, 9%, 45%);
  --primary-orange: hsl(26, 100%, 55%);
  --lighter-orange: hsl(24, 100%, 64%);
  --light-grayish-blue: hsl(223, 64%, 98%);
}

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

li {
  list-style-type: none;
}

a {
  text-decoration: none;
}

.shadow {
  display: none;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  z-index: 2;
}

.shadow.active {
  display: block;
}

.navbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 20px;

  > * {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
  }

  .avatar {
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;

    &:hover {
      border-color: var(--primary-orange);
    }
  }
}

.mobile-nav {
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 20px;
  background-color: white;
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  z-index: 99;

  .close-icon {
    margin-bottom: 40px;
  }

  li {
    a {
      color: var(--very-dark-blue);
      font-weight: bold;
      font-size: 20px;
    }
  }
}

.mobile-nav.active {
  display: flex;
}

.desktop-nav {
  display: none;
}

.product-img-container {
  position: relative;

  .product-img {
    display: none;
    width: 100%;
    height: 100%;
  }

  .product-img.selected {
    display: block;
  }

  .prev-icon,
  .next-icon {
    position: absolute;
    top: 50%;
    background-color: white;
    border-radius: 50%;
    padding: 15px;
  }

  .prev-icon {
    left: 15px;
  }

  .next-icon {
    right: 15px;
  }

  .product-thumbnails {
    display: none;
  }
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;

  .subtitle {
    color: var(--very-dark-blue);
    font-weight: bold;
    font-size: 14px;
  }

  h2 {
    color: var(--very-dark-blue);
    font-weight: bold;
    font-size: 30px;
  }

  p {
    color: var(--dark-grayish-blue);
  }

  .price {
    display: flex;
    flex-direction: row;
    gap: 20px;

    > * {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    span:nth-child(1) {
      font-size: 25px;
      font-weight: bold;
    }

    span:nth-child(2) {
      background-color: var(--very-dark-blue);
      color: white;
      padding: 2px 5px;
      border-radius: 5px;
      font-weight: bold;
      font-size: 20px;
    }

    span:nth-child(3) {
      margin-left: auto;
      margin-right: 0;
      font-size: 20px;
      font-weight: bold;
      color: var(--dark-grayish-blue);
    }
  }

  .counter-and-add-to-cart-container {
    display: flex;
    flex-direction: column;
    gap: 15px;

    .add-to-cart-btn,
    .counter-container {
      height: 50px;
    }

    .add-to-cart-btn {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      gap: 15px;
      background-color: var(--primary-orange);
      font-weight: bold;
      padding: 15px;
      border-radius: 10px;
      border: none;
      cursor: pointer;

      span {
        font-size: 16px;
        color: var(--very-dark-blue);
      }

      &:hover {
        background-color: var(--lighter-orange);
      }
    }

    .counter-container {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 10px;
      background-color: var(--light-grayish-blue);
      border-radius: 10px;

      .counter-state {
        font-size: 20px;
        font-weight: bold;
      }

      .minus-icon,
      .plus-icon {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px;
        cursor: pointer;
      }
    }
  }
}

.cart-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 5px;
  cursor: pointer;

  .cart-icon-count {
    position: absolute;
    right: 0;
    top: 0;
    background-color: var(--primary-orange);
    color: white;
    font-weight: bold;
    border-radius: 50%;
    padding: 0 5px;
  }
}

.cart-modal {
  display: none;
  position: absolute;
  z-index: 98;
  background-color: white;
  border-radius: 10px;
  width: 94%;
  margin-left: 3%;
  margin-right: 3%;
  margin-top: 3%;
  border: 3px solid var(--primary-orange);

  h3 {
    color: var(--very-dark-blue);
    font-weight: bold;
    padding: 20px;
    border-bottom: 1px solid lightgray;
  }

  .cart-empty {
    display: block;
    color: var(--dark-grayish-blue);
    padding: 100px;
  }

  .cart-empty.hidden {
    display: none;
  }

  .cart-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;

    .content {
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      > * {
        height: 50px;
      }

      .thumbnail {
        width: 50px;
        border-radius: 5px;
      }

      .content-info {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        color: var(--dark-grayish-blue);
        font-size: 16px;

        div:nth-child(1) {
          text-align: center;
        }

        div:nth-child(2) {
          display: flex;
          flex-direction: row;
          gap: 10px;

          span:nth-child(2) {
            color: var(--very-dark-blue);
            font-weight: bold;
          }
        }
      }

      .trash-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
      }
    }

    .checkout-btn {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      gap: 15px;
      background-color: var(--primary-orange);
      font-weight: bold;
      padding: 15px;
      border-radius: 10px;
      border: none;
      width: 100%;
      cursor: pointer;
      font-size: 16px;
    }
  }

  .cart-content.hidden {
    display: none;
  }
}

.cart-modal.active {
  display: block;
}

@media screen and (min-width: 1440px) {
  body {
    padding: 0 150px;
  }

  main {
    display: flex;
    flex-direction: row;
    gap: 50px;
    margin-top: 80px;
    padding: 0 50px 50px 50px;

    .product-img-container {
      display: flex;
      flex-direction: column;
      gap: 20px;

      .prev-icon,
      .next-icon {
        display: none;
      }

      .product-img {
        border-radius: 10px;
        width: 400px;
        height: 425px;
      }

      .product-thumbnails {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;

        .thumbnail-container {
          width: calc(25% - 15px);
          cursor: pointer;
          position: relative;
          border: 3px solid transparent;
          border-radius: 10px;

          .thumbnail-img,
          .thumbnail-shadow {
            width: 100%;
            height: 100%;
            border-radius: 7px;
          }

          .thumbnail-shadow {
            display: none;
            position: absolute;
            z-index: 2;
            top: 0;
            background-color: rgba(200, 200, 200, 0.5);
          }

          &:hover {
            .thumbnail-shadow {
              display: block;
            }
          }
        }

        .thumbnail-container.selected {
          border-color: var(--primary-orange);
        }
      }
    }

    .product-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      padding: 60px;

      h2 {
        font-size: 40px;
        margin-bottom: 20px;
      }

      .counter-and-add-to-cart-container {
        flex-direction: row;
        gap: 20px;
        width: 100%;
        margin-top: 20px;

        .counter-container {
          width: 40%;
        }

        .add-to-cart-btn {
          width: 60%;
        }
      }
    }
  }

  .hamburger-icon,
  .mobile-nav,
  .mobile-nav.active,
  .shadow,
  .shadow.active {
    display: none;
  }

  .navbar {
    padding: 0;
    border-bottom: 1px solid lightgray;

    > * {
      gap: 40px;
    }

    .desktop-nav,
    .desktop-nav a {
      padding: 45px 0;
    }

    .desktop-nav {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      gap: 30px;

      a {
        color: var(--dark-grayish-blue);
        border-bottom: 5px solid transparent;
        height: 100%;

        &:hover {
          border-color: var(--primary-orange);
          color: var(--very-dark-blue);
        }
      }
    }

    .avatar {
      height: 50px;
    }
  }

  .cart-modal {
    position: absolute;
    width: 350px;
    right: 100px;
    top: 50px;
  }
}
