.heart-container {
  --heart-color: rgb(255, 91, 137);
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  transition: transform 0.3s;
}

.heart-container .checkbox {
  position: absolute;
  z-index: 20;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.heart-container .svg-container {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.heart-container .svg-outline,
.heart-container .svg-filled {
  position: absolute;
  width: 22px;
  height: 22px;
  fill: var(--heart-color);
}

.heart-container .svg-filled {
  display: none;
  animation: keyframes-svg-filled 1s;
}

.heart-container .svg-celebrate {
  position: absolute;
  display: none;
  width: 56px;
  height: 56px;
  fill: var(--heart-color);
  stroke: var(--heart-color);
  stroke-width: 2px;
  animation: keyframes-svg-celebrate 0.5s;
  animation-fill-mode: forwards;
  pointer-events: none;
}

.heart-container .checkbox:checked ~ .svg-container .svg-outline {
  display: none;
}

.heart-container .checkbox:checked ~ .svg-container .svg-filled,
.heart-container .checkbox:checked ~ .svg-container .svg-celebrate {
  display: block;
}

.heart-container:focus-within {
  border-radius: 999px;
  outline: 3px solid rgba(255, 91, 137, 0.22);
  outline-offset: 2px;
}

@keyframes keyframes-svg-filled {
  0% {
    transform: scale(0);
  }

  25% {
    transform: scale(1.2);
  }

  50% {
    filter: brightness(1.5);
    transform: scale(1);
  }
}

@keyframes keyframes-svg-celebrate {
  0% {
    transform: scale(0);
  }

  50% {
    filter: brightness(1.5);
    opacity: 1;
  }

  100% {
    display: none;
    opacity: 0;
    transform: scale(1.4);
  }
}

.catalog-product-meta .product-heart {
  margin: -4px -3px -4px 0;
}

.catalog-product-meta .product-heart .checkbox {
  appearance: none;
}

@media (max-width: 700px) {
  .heart-container {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .heart-container .svg-outline,
  .heart-container .svg-filled {
    width: 20px;
    height: 20px;
  }

  .heart-container .svg-celebrate {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .heart-container,
  .heart-container .svg-filled,
  .heart-container .svg-celebrate {
    animation: none;
    transition: none;
  }
}
