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

:root {
  --category-list-width: 320px;
  --heading-font-size: 1.2rem;
}

#product-detail-page,
#product-page {
  * {
    font-family: Montserrat;
    font-weight: 500;
    font-size: 14px;
  }
  strong {
    font-weight: 800;
  }
}

#product-page {
  h2, h3, h4 {
    margin-top: 1em;
    font-size: var(--heading-font-size);
    color: rgba(133, 135, 138, 1);
    font-weight: bold;
  }

  .product-wrapper {
    display: grid;
    gap: 1rem 10vw;
    align-items: start;

    @media (min-width: 992px) {
      grid-template-columns: var(--category-list-width) 1fr;

      .product-title {
        position: sticky;
        top: var(--nav-height);
      }
      .product-category {
        position: sticky;
        top: calc(var(--nav-height) + var(--heading-font-size) + 3rem);
      }
    }

    .product-title {
      h2 {
        margin: 0;
        padding: 1em 0;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    }
    .search-container {
      .input-container {
        position: relative;
    
        input {
          padding: 1rem;
          appearance: none;
          font-size: 0.8rem;
          border: 1px solid rgba(240, 240, 240, 1);
          border-radius: 8px;
          
          &::placeholder {
            color: rgba(169, 160, 160, 1);
          }
        }
    
        img {
          display: block;
          position: absolute;
          right: 0;
          top: 0;
          height: 100%;
          aspect-ratio: 1;
          padding: 1rem;
          cursor: pointer;
        }
      }
      p {
        margin-top: 3rem;
      }
    }
    .product-category {
      background-color: white;
      ul {
        padding: 0;
        list-style-type: none;
    
        li {
          a {
            display: block;
          }
        }
    
        &.product-category-list {
          min-width: var(--category-list-width);
    
          .product-category-item {
            &:not(:first-child) {
              margin-top: 1rem;
            }
    
            & > a {
              position: relative;
              display: flex;
              align-items: center;
              height: 3rem;
              padding: 0 1rem;
              line-height: 3rem;
              color: black;
              font-weight: 600;
              box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.05);
              border-radius: 8px;

              img.category-image-main, img.category-image-side {
                display: none;
                height: 50%;
                max-width: 100%;
                overflow: hidden;
                object-fit: contain;
              }

              img.expand-button, img.collapse-button {
                position: absolute;
                right: 0;
                top: 0;
                display: none;
                height: 100%;
                padding: 1rem;
                aspect-ratio: 1;
                transition: 200ms;
              }

              img.expand-button {
                transform: rotate(-180deg);
                &.collapsed {
                  transform: rotate(0deg);
                }
              }

              img.collapse-button {
                transform: rotate(0deg);
                &.collapsed {
                  transform: rotate(180deg);
                }
              }
            }
    
            &:not(.active1) {
              & > a {
                img.category-image-side,
                img.expand-button {
                  display: block;
                }
              }
            }

            &.active1 {
              & > a {
                color: white;
                background-color: rgba(54, 162, 100, 1);

                img.category-image-main,
                img.collapse-button {
                  display: block;
                }
              }
            }
          }
        }
    
        &.product-subcategory-list {
          .product-subcategory-item {
            &:first-child {
              margin-top: 0.5rem;
            }
            & > a {
              display: flex;
              gap: 0.5rem;
              align-items: center;
              height: 3rem;
              overflow: hidden;
              padding: 0.5rem;
              color: rgba(175, 176, 178, 1);

              img {
                display: block;
                height: 100%;
                aspect-ratio: 1;
                object-fit: contain;
              }
            }
            &.active1 > a {
              color: rgba(41, 42, 117, 1);
            }
          }
        }
      }
    }

    .product-list {
      h3 {
        margin: 0;
        margin-top: 1rem;
        padding: 1rem 0;
        border-bottom: solid 1px rgba(236, 131, 36, 1);
      }
      ul {
        padding: 0;
        list-style-type: none;
        li {
          a {
            position: relative;
            display: block;
            h4 {
              text-align: center;
            }
            .product-image-container {
              display: flex;
              align-items: center;
              justify-content: center;
              width: 100%;
              aspect-ratio: 3/2;
              padding: 0;
              img {
                display: block;
                max-width: 100%;
                max-height: 100%;
                object-fit: contain;
                border-radius: 8px;
                transition: 200ms;
              }
            }
            .button-container {
              position: absolute;
              bottom: 0;
              width: 100%;
              padding: 0.5rem;
              opacity: 0;
              transition: 200ms;

              button {
                display: block;
                width: 100%;
                padding: 0.5rem;
                color: white;
                font-weight: bold;
                background-color: rgba(133, 135, 138, 1);
                border: none;
                border-radius: 8px;
                transition: 200ms;
              }
            }
            &:hover {
              .product-image-container {
                img {
                  transform: translateY(-0.2rem) scale(1.1);
                  transform-origin: bottom;
                }
              }
              .button-container {
                opacity: 1;

                button:hover {
                  background-color: rgba(41, 42, 117, 1);
                }
              }
            }
          }
        }
      }
    }
  }
}

#product-detail-page {
  h2 {
    font-size: 2rem;
    font-weight: bold;
    color: rgba(137, 139, 141, 1);
  }
  .product-wrapper {
    .product-description {
      ul.nav {
        border-top: 1px solid rgba(137, 139, 141, 1);

        li {
          margin-top: -1px;

          a {
            display: block;
            padding: 1rem;
            font-size: 1rem;
            color: rgba(137, 139, 141, 1);
            border: none;
            border-top: 3px solid transparent;

            &.active {
              font-weight: bold;
              color: black;
              border-color: rgba(235, 127, 31, 1);
            }
          }
        }
      }
      .tab-content {
        padding: 1rem;
        color: rgba(137, 139, 141, 1);
        line-height: 2;

        h1, h2, h3 {
          font-size: 1rem;
          font-weight: bold;
          color: black;
        }
      }
    }
    .product-image {
      @media (min-width: 992px) {
        position: sticky;
        top: var(--nav-height);
      }

      img {
        width: 100%;
      }
    }
    .button-container {
      a {
        display: block;
        text-align: center;
        margin-bottom: 0.5rem;
        padding: 0.5rem 1rem;
        font-weight: bold;
        border-radius: 8px;
        
        &.btn-download {
          color: rgba(41, 42, 117, 1);
          background-color: rgba(41, 42, 117, 0.1);
          border: 1px solid transparent;
          transition: 200ms;

          &:hover, &:active {
            border-color: rgba(41, 42, 117, 1);
          }

          &:active {
            background-color: rgba(41, 42, 117, 0.2);
          }
        }
        &.btn-contact {
          color: white;
          background-color: rgba(41, 42, 117, 1);

          &:hover {
            background-color: rgba(55, 56, 147, 1);
          }

          &:active {
            background-color: rgba(27, 28, 100, 1);
          }
        }
      }
    }
  }
  .back-button-container {
    text-align: left;

    button {
      width: 100%;
      padding: 0.5rem 1rem;
      font-size: 12px;
      color: white;
      background-color: rgba(128, 130, 133, 1);
      border: none;
      border-radius: 8px;
    }
  }
}