html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.mv {
  box-sizing: border-box;
  width: min(300px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.mv * {
  box-sizing: border-box;
}

.mv__group + .mv__group {
  margin-top: 8px;
}

.mv__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.mv__label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.mv__n {
  position: relative;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.1);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.mv__alt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.mv__list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mv__row {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mv__row.is-out {
  grid-template-rows: 0fr;
}

.mv__box {
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.12);
}

.mv__in {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}

.mv__row--saved .mv__box {
  background: #17141a;
  box-shadow: none;
}

.mv__row--saved .mv__in {
  color: #fff7e6;
}

.mv__name {
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv__price {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
}

.mv__b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #17141a;
  color: #fff7e6;
  cursor: pointer;
}
.mv__b:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.mv__b--back {
  background: #fff7e6;
  color: #17141a;
}

@keyframes mv-leave {
  0% {
    grid-template-rows: 1fr;
    animation-timing-function: steps(1, end);
  }
  24% {
    grid-template-rows: 1fr;
    animation-timing-function: steps(1, end);
  }
  25% {
    grid-template-rows: 0fr;
    animation-timing-function: steps(1, end);
  }
  70% {
    grid-template-rows: 0fr;
    animation-timing-function: ease-out;
  }
  86% {
    grid-template-rows: 1fr;
  }
  100% {
    grid-template-rows: 1fr;
  }
}
@keyframes mv-arrive {
  0% {
    grid-template-rows: 0fr;
    animation-timing-function: steps(1, end);
  }
  24% {
    grid-template-rows: 0fr;
    animation-timing-function: steps(1, end);
  }
  25% {
    grid-template-rows: 1fr;
    animation-timing-function: steps(1, end);
  }
  70% {
    grid-template-rows: 1fr;
    animation-timing-function: ease-out;
  }
  86% {
    grid-template-rows: 0fr;
  }
  100% {
    grid-template-rows: 0fr;
  }
}
@keyframes mv-drop {
  0%, 24% {
    transform: translateY(-10px);
  }
  45%, 100% {
    transform: translateY(0);
  }
}
@keyframes mv-press {
  0%, 21% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.78);
  }
  37%, 100% {
    transform: scale(1);
  }
}
@keyframes mv-a {
  0%, 24% {
    opacity: 1;
  }
  25%, 85% {
    opacity: 0;
  }
  86%, 100% {
    opacity: 1;
  }
}
@keyframes mv-b {
  0%, 24% {
    opacity: 0;
  }
  25%, 85% {
    opacity: 1;
  }
  86%, 100% {
    opacity: 0;
  }
}
.mv.is-demo #mv-cart .mv__row:nth-child(2) {
  animation-name: mv-leave;
}
.mv.is-demo #mv-saved .mv__row:nth-child(2) {
  animation-name: mv-arrive;
}
.mv.is-demo #mv-cart .mv__row:nth-child(2),
.mv.is-demo #mv-saved .mv__row:nth-child(2) {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.mv.is-demo #mv-saved .mv__row:nth-child(2) .mv__in {
  animation-name: mv-drop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.mv.is-demo #mv-cart .mv__row:nth-child(2) .mv__b {
  animation-name: mv-press;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.mv.is-demo .mv__swap .mv__v {
  animation-name: mv-a;
}
.mv.is-demo .mv__swap .mv__alt {
  animation-name: mv-b;
}
.mv.is-demo .mv__swap .mv__v,
.mv.is-demo .mv__swap .mv__alt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .mv {
    padding: 8px;
  }
  .mv__in {
    padding: 4px;
  }
  .mv__b {
    width: 20px;
    height: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mv.is-demo .mv__row,
  .mv.is-demo .mv__in,
  .mv.is-demo .mv__b,
  .mv.is-demo .mv__v {
    animation: none !important;
    transform: none !important;
  }
  .mv.is-demo .mv__v {
    opacity: 1 !important;
  }
  .mv.is-demo .mv__alt {
    animation: none !important;
    opacity: 0 !important;
  }
  .mv__row {
    transition: none !important;
  }
}
