@font-face {
  font-family: 'Impact';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('./assets/fonts/Impact.woff') format('woff');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url('./assets/fonts/Montserrat-900.woff2') format('woff2');
}

html {
  background-color: #fff;
}

body {
  background-image: url('./assets/images/background.webp');
  background-repeat: repeat;
  background-size: contain;
}

#main.juices,
#main.single-juice {
  --c: #089739;
  --c-alt: #ff5a00;
  --container-space: 7rem;

  min-height: 100vh;
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;

  .products {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6rem 1rem;

    .product {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      width: calc(20% - 1rem);
      flex-direction: column;
      border-radius: 50px;
      border: 1px solid var(--c-alt);
      position: relative;
      padding: 1rem;
      color: var(--c);
      gap: 0.5rem;
      align-self: stretch;

      &:has(>.vitamins) {
        padding-bottom: 80px;
      }

      .image {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;

        >img {
          max-height: 320px;
          width: 100%;
          object-fit: contain;
          object-position: center;
          position: relative;
          z-index: 3;
          transform: scale(1) rotate(0deg);
          transition: transform .3s ease-in-out;
          animation-duration: 1.5s;
          animation-iteration-count: 1;
          animation-timing-function: ease;
          animation-fill-mode: forwards;
        }

        &::after {
          position: absolute;
          z-index: 1;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          content: '';
          width: 100%;
          aspect-ratio: 1;
          background-color: var(--c);
          border-radius: 50%;
          transition: background-color 1s ease-in-out;
          max-width: 300px;
        }
      }

      .name {
        padding: .5rem 0;
        font-size: 1.5rem;
        text-align: center;
        text-transform: uppercase;
        transition: transform .3s ease-in-out;
      }

      .text {
        font-family: 'Montserrat';
        font-weight: 900;
        font-size: 1.25rem;
        color: var(--c-alt);
        text-align: center;
        transition: transform .3s ease-in-out;
      }

      .vitamins {
        position: absolute;
        bottom: -60px;
        height: 120px;
        left: 50%;
        transform: translateX(-50%);
        width: fit-content;
        padding: .5rem 1rem;
        max-width: 90%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        border: 1px solid var(--c-alt);
        border-radius: 25px;
        background: #FFF;
        transition: transform .8s ease-in-out;

        .vitamins__text {
          margin-left: 0.5rem;
          margin-right: 0.5rem;
          font-size: 2rem;
          text-transform: uppercase;
          text-align: center;
          line-height: 1.1;
          text-wrap: nowrap;
        }

        .vitamins__list {
          display: flex;
          align-items: center;
          justify-content: center;
          flex-wrap: nowrap;
          gap: 0.25rem;

          .vitamin {
            text-transform: uppercase;
            font-size: 1.5rem;
            text-wrap: nowrap;
          }
        }
      }

      &:hover {
        .image::after {
          background-color: var(--c-alt);
        }
      }

      &.animation,
      &.active {
        .image>img {
          animation-name: hover-img;
        }

        .image::after {
          background-color: var(--c-alt);
        }

        .vitamins {
          transform: translateX(-50%) scale(1.1);
        }
      }
    }
  }


  .vitamin {
    color: #e52d15;

    &.a {
      color: #17983b;
    }

    &.b {
      color: #7eba27;
    }

    &.b1 {
      color: #7bb926;
    }

    &.b2 {
      color: #ccae10;
    }

    &.b6 {
      color: #cc7f13;
    }

    &.c {
      color: #ec650b;
    }

    &.pp {
      color: #e52d13;
    }

    &.e {
      color: #d60d2d;
    }

    &.k {
      color: #ae196b;
    }
  }

  @media(max-width: 1600px) {
    --container-space: 4rem;

    .products {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 6rem 1rem;

      .product {
        width: calc(33% - 1rem);
        align-self: stretch;
      }
    }
  }

  @media(max-width: 1200px) {
    --container-space: 2rem;
  }

  @media(max-width: 981px) {
    --container-space: 1rem;

    .products {
      .product {
        width: calc(50% - 1rem);
      }
    }
  }

  @media(max-width: 550px) {
    --container-space: .5rem;

    .products {
      .product {
        width: 100%;
      }
    }
  }
}

@keyframes hover-img {
  0% {
    transform: scale(1.00) rotate(0);
  }

  7% {
    transform: scale(1.01) rotate(40deg);
  }

  14% {
    transform: scale(1.02) rotate(-40deg);
  }

  21% {
    transform: scale(1.03) rotate(30deg);
  }

  28% {
    transform: scale(1.04) rotate(-30deg);
  }

  35% {
    transform: scale(1.05) rotate(20deg);
  }

  42% {
    transform: scale(1.06) rotate(-20deg);
  }

  49% {
    transform: scale(1.07) rotate(10deg);
  }

  56% {
    transform: scale(1.08) rotate(-10deg);
  }

  63% {
    transform: scale(1.09) rotate(5deg);
  }

  70% {
    transform: scale(1.1) rotate(0);
  }

  100% {
    transform: scale(1.0) rotate(0);
  }
}
