/**
 * 动效系统 — CSS 层（按压、shimmer、降级）
 * 复杂转场由 motion-v 处理；此处负责全局 fallback
 */

@media (prefers-reduced-motion: reduce) {
  *:not(.app-splash):not(.app-splash *),
  *:not(.app-splash):not(.app-splash *)::before,
  *:not(.app-splash):not(.app-splash *)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .page-skeleton__avatar,
  .page-skeleton__line,
  .page-skeleton__hero,
  .page-skeleton__grid-img {
    animation: none !important;
    opacity: 0.55;
  }
}

.motion-fade-enter-active,
.motion-fade-leave-active {
  transition: opacity 0.15s ease;
}

.motion-fade-enter-from,
.motion-fade-leave-to {
  opacity: 0;
}

.product-grid-card .img-wrap img,
.product-grid-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-list-card__thumb img,
.product-list-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── M1 收藏按钮 ── */
.favorite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.favorite-btn__icon-wrap {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.favorite-btn__heart {
  font-size: 1.375rem;
  line-height: 1;
  transition: color 0.15s ease;
}
.favorite-btn__heart.filled,
.favorite-btn--active .favorite-btn__heart {
  color: var(--price-red);
}
.favorite-btn__check {
  position: absolute;
  right: -0.15rem;
  bottom: -0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
  pointer-events: none;
}
.favorite-btn--sm .favorite-btn__icon-wrap { width: 1.5rem; height: 1.5rem; }
.favorite-btn--sm .favorite-btn__heart { font-size: 1.25rem; }
.favorite-btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
}
.product-hero__actions .favorite-btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.favorite-btn--bar {
  flex-direction: column;
  min-width: 3rem;
  padding: 0.15rem 0.35rem;
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 600;
}
.favorite-btn--bar .favorite-btn__label { line-height: 1.1; }
.favorite-btn--bar.favorite-btn--active { color: var(--price-red); }

.count-up {
  font-variant-numeric: tabular-nums;
}

.stagger-item {
  min-width: 0;
}

/* ── M2 图片 lazy fade ── */
.lazy-fade-img {
  opacity: 0;
  transition: opacity 0.32s ease;
}
.lazy-fade-img--loaded {
  opacity: 1;
}

.product-hero__img {
  will-change: transform;
}

/* ── M3 加购飞入 + 成交粒子 ── */
.cart-fly-thumb {
  pointer-events: none;
  will-change: transform;
}
.cart-fly-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deal-particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
}

.nav-item--cart-bump .nav-item__icon {
  animation: cart-fly-bump 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cart-fly-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item--cart-bump .nav-item__icon {
    animation: none;
  }
  .lazy-fade-img {
    opacity: 1;
    transition: none;
  }
  .toast--motion {
    will-change: auto;
  }
  .product-hero__img {
    will-change: auto;
  }
}
