@property --num {
  syntax: "<integer>";
  initial-value: 0;
  inherits: false;
}

counters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  width: 100%;

  @media (min-width: 993px) {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
  }

  .counter-avatar {
    display: block;
    flex-shrink: 0;
    width: 10.25rem;

    @media (min-width: 993px) {
      width: 11.3rem;
    }
    @media (min-width: 1441px) {
      width: 13rem;
    }

    img {
      display: block;
      width: 100%;
      height: auto;
    }
  }

  .content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;

    @media (min-width: 993px) {
      gap: 2rem;
    }
  }

  > .content-wrapper > .h2-lg {
    align-self: center;
    font-size: 1rem;
    margin: 0;
    color: var(--pricefox-primary-color);

    @media (min-width: 993px) {
      align-self: stretch;
      font-size: 1.25rem;
    }
    @media (min-width: 1441px) {
      font-size: 1.5rem;
    }
  }

  .counter-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem 0.5625rem;

    @media (min-width: 993px) {
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: stretch;
    }
  }

  .counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 calc(50% - 0.28125rem);

    @media (min-width: 993px) {
      align-items: stretch;
      flex: 1;
    }
  }

  .counter::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    background: var(--warm-orange-500);
  }

  .value {
    --target: 0;
    --suffix: "";
    position: relative;
    color: transparent;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    counter-reset: num var(--num);
    transition: --num 1.5s linear;

    @media (min-width: 993px) {
      font-size: 2.25rem;
    }
    @media (min-width: 1441px) {
      font-size: 3rem;
    }
  }

  .value::before {
    content: counter(num) var(--suffix);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--pricefox-primary-color);
  }

  &.in-view .value {
    --num: var(--target);
  }

  @media (prefers-reduced-motion: reduce) {
    .value {
      transition: none;
    }
  }

  .text {
    margin: 0;
    color: var(--pricefox-primary-color);
    line-height: 1.5;
  }
}
