/* Cover
--------------------------------------------- */

.single-product .cover {
  position: relative;

  & img {
    display: block;
    object-fit: cover;
    width: 100%;
    height: 50vh;
    filter: grayscale(0.5);
  }

  & .content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-image: linear-gradient(0, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    height: 100%;

    & > .wrapper {
      max-width: var(--max-w-lg);
      margin: 0 auto;
      padding: 1.5rem 20px;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    & .title {
      font-weight: var(--font-black);
      font-size: var(--font-4xl);
      line-height: var(--leading-tight);
      color: rgb(var(--primary-50));
      animation: spotlight 400ms;
      animation-delay: 600ms;
      animation-fill-mode: backwards;

      margin-bottom: 1.5rem;
    }

    & .excerpt {
      font-weight: var(--font-bold);
      color: rgb(var(--primary-50));
      animation: spotlight 400ms;
      animation-delay: 900ms;
      animation-fill-mode: backwards;
    }
  }
}

@keyframes spotlight {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Summary
--------------------------------------------- */

.single-product .summary {
  max-width: var(--max-w-md);
  margin: 0 auto;
  padding: 3rem 24px;

  & h2 {
    font-weight: var(--font-black);
    font-size: var(--font-lg);
    line-height: var(--leading-snug);
    margin-bottom: 1.5rem;
  }

  & ul {
    list-style: disc;
    margin: 1.5rem 0 1.5rem 1rem;

    & li:not(:last-child) {
      margin-bottom: 1.5rem;
    }
  }

  & p:not(:last-of-type) {
    margin-bottom: 1.5rem;
  }
}

/* Gallery
--------------------------------------------- */

.single-product .gallery {
  & > .wrapper {
    max-width: var(--max-w-lg);
    margin: 0 auto;
    padding: 1.5rem 20px 4.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  & img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    height: 100%;
    max-width: 75px;
    border-radius: 50%;
    cursor: pointer;

    @media (min-width: 720px) {
      max-width: 95px;
    }

    @media (min-width: 960px) {
      max-width: 110px;
    }
  }
}

/* Related Products
--------------------------------------------- */

.single-product .related-products {
  background-color: rgb(var(--base-50));

  & > .wrapper {
    max-width: var(--max-w-xxl);
    margin: 0 auto;
    padding: 4.5rem 20px;
  }

  & .section-title {
    font-weight: var(--font-black);
    font-size: var(--font-2xl);
    margin-bottom: 1.5rem;
    line-height: var(--leading-tight);
  }

  & .products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;

    @media (min-width: 960px) {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 1.5rem;
    }

    & .product {
      & a {
        display: block;
        position: relative;

        & > .wrapper {
          position: absolute;
          z-index: 1;
          width: 100%;
          height: 100%;
          display: flex;
          align-items: end;
          padding: 24px;

          .title {
            flex-grow: 1;
            font-weight: var(--font-black);
            color: rgb(var(--primary-50));
            text-align: center;
            line-height: var(--leading-tight);
            font-size: var(--font-lg);

            @media (min-width: 960px) {
              font-size: var(--font-xl);
            }
          }
        }

        &::after {
          display: block;
          content: '';
          position: absolute;
          bottom: 0;
          left: 0;
          width: 100%;
          height: 50%;
          background: linear-gradient(
            0,
            rgba(var(--base-1000), 1),
            rgba(var(--base-1000), 0)
          );
          opacity: 1;
          transition: opacity 0.3s;
        }

        &:hover::after {
          opacity: 0.75;
        }
      }

      & img {
        object-fit: cover;
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        filter: grayscale(0.5);
      }
    }
  }
}
