.kara-search-motion {
  position: fixed;
  inset: 0;
  z-index: 245;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

.kara-search-motion.is-running {
  visibility: visible;
}

.kara-search-motion__thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.kara-search-motion__thread path {
  fill: none;
  stroke: var(--coral, #d64e37);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 2px 0 rgba(255, 253, 246, .9));
}

.kara-search-motion.is-running .kara-search-motion__thread path {
  animation: kara-search-thread 650ms cubic-bezier(.65, 0, .35, 1) forwards;
}

.kara-search-motion__kara {
  position: fixed;
  left: 0;
  top: 0;
  width: 124px;
  transform: translate(var(--kara-search-x, 20px), calc(var(--kara-search-y, 20px) + 115%)) rotate(-8deg);
  transform-origin: 50% 100%;
  opacity: 0;
  filter: drop-shadow(0 12px 10px rgba(48, 35, 51, .2));
}

.kara-search-motion__kara img {
  display: block;
  width: 100%;
  height: auto;
}

.kara-search-motion__happy {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.kara-search-motion.is-running .kara-search-motion__kara {
  animation: kara-search-arrive 620ms 90ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.kara-search-motion.is-running .kara-search-motion__calm {
  animation: kara-search-calm 1ms 820ms linear forwards;
}

.kara-search-motion.is-running .kara-search-motion__happy {
  animation: kara-search-happy 180ms 820ms ease-out forwards;
}

.kara-search-motion__label {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--kara-search-label-width, 270px);
  max-width: calc(100vw - 24px);
  transform: translate(var(--kara-search-label-x, 12px), calc(var(--kara-search-label-y, 12px) + 12px)) rotate(-1.5deg);
  opacity: 0;
  background: var(--coral, #d64e37);
  color: #fffdf6;
  padding: 10px 13px;
  font: 700 13px/1.3 Arial, Helvetica, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 5px 6px 0 rgba(48, 35, 51, .14);
}

.kara-search-motion.is-running .kara-search-motion__label {
  animation: kara-search-label 360ms 760ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.product.kara-search-hit .photo {
  outline: 3px solid var(--coral, #d64e37);
  outline-offset: 5px;
  animation: kara-search-hit 1.25s 520ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes kara-search-thread {
  to { stroke-dashoffset: 0; }
}

@keyframes kara-search-arrive {
  0% {
    opacity: 0;
    transform: translate(var(--kara-search-x), calc(var(--kara-search-y) + 115%)) rotate(-8deg);
  }
  72% {
    opacity: 1;
    transform: translate(var(--kara-search-x), calc(var(--kara-search-y) - 5px)) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--kara-search-x), var(--kara-search-y)) rotate(0);
  }
}

@keyframes kara-search-calm {
  to { opacity: 0; }
}

@keyframes kara-search-happy {
  to { opacity: 1; }
}

@keyframes kara-search-label {
  to {
    opacity: 1;
    transform: translate(var(--kara-search-label-x), var(--kara-search-label-y)) rotate(-1.5deg);
  }
}

@keyframes kara-search-hit {
  0%, 100% { outline-color: transparent; }
  35%, 78% { outline-color: var(--coral, #d64e37); }
}

@media (max-width: 600px) {
  .kara-search-motion__thread path {
    stroke-width: 2.5;
  }

  .kara-search-motion__kara {
    width: 92px;
  }

  .kara-search-motion__label {
    padding: 9px 11px;
    font-size: 11px;
    box-shadow: 3px 4px 0 rgba(48, 35, 51, .14);
  }

  .product.kara-search-hit .photo {
    outline-width: 2px;
    outline-offset: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kara-search-motion__thread path,
  .kara-search-motion__kara,
  .kara-search-motion__calm,
  .kara-search-motion__happy,
  .kara-search-motion__label,
  .product.kara-search-hit .photo {
    animation: none !important;
  }

  .kara-search-motion__thread path { stroke-dashoffset: 0; }
  .kara-search-motion__kara {
    opacity: 1;
    transform: translate(var(--kara-search-x), var(--kara-search-y));
  }
  .kara-search-motion__calm { opacity: 0; }
  .kara-search-motion__happy { opacity: 1; }
  .kara-search-motion__label {
    opacity: 1;
    transform: translate(var(--kara-search-label-x), var(--kara-search-label-y)) rotate(-1.5deg);
  }
  .product.kara-search-hit .photo { outline-color: var(--coral, #d64e37); }
}

.reduced .kara-search-motion__thread path,
.reduced .kara-search-motion__kara,
.reduced .kara-search-motion__calm,
.reduced .kara-search-motion__happy,
.reduced .kara-search-motion__label,
.reduced .product.kara-search-hit .photo {
  animation: none !important;
}

.reduced .kara-search-motion__thread path { stroke-dashoffset: 0; }
.reduced .kara-search-motion__kara {
  opacity: 1;
  transform: translate(var(--kara-search-x), var(--kara-search-y));
}
.reduced .kara-search-motion__calm { opacity: 0; }
.reduced .kara-search-motion__happy { opacity: 1; }
.reduced .kara-search-motion__label {
  opacity: 1;
  transform: translate(var(--kara-search-label-x), var(--kara-search-label-y)) rotate(-1.5deg);
}
.reduced .product.kara-search-hit .photo { outline-color: var(--coral, #d64e37); }
