/* ==========================================================================
   nanhu cart theme · anim.css  动效增强层
   加载在 cart.css 之后 · 只叠加动画/过渡，不改布局与配色 · 尊重 prefers-reduced-motion
   ========================================================================== */

/* ---------- 关键帧 ---------- */
@keyframes fx-fade-up   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fx-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-fade-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fx-shine     { from { transform: translateX(-140%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
@keyframes fx-pulse-soft{ 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- 页内返回栏 ---------- */
.nav-top-page { animation: fx-fade-down .45s cubic-bezier(.22, .61, .36, 1) both; }
.nav-top-page .return { transition: color .2s ease, transform .2s ease; }
.nav-top-page .return:hover { transform: translateX(-3px); }

/* ---------- 左侧分类菜单：错峰滑入 + hover 右移 ---------- */
.sky-cart-menu-item, .sky-cart-submenu-item { animation: fx-fade-in .4s ease both; }
.sky-cart-menu-item:nth-child(1)   { animation-delay: .03s; }
.sky-cart-menu-item:nth-child(2)   { animation-delay: .07s; }
.sky-cart-menu-item:nth-child(3)   { animation-delay: .11s; }
.sky-cart-menu-item:nth-child(4)   { animation-delay: .15s; }
.sky-cart-menu-item:nth-child(5)   { animation-delay: .19s; }
.sky-cart-menu-item:nth-child(6)   { animation-delay: .23s; }
.sky-cart-menu-item:nth-child(7)   { animation-delay: .27s; }
.sky-cart-menu-item:nth-child(8)   { animation-delay: .31s; }
.sky-cart-submenu-item { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.sky-cart-submenu-item:hover { padding-left: 6px; }

/* ---------- 搜索框：聚焦光环 ---------- */
.sky-cart-search-box { transition: box-shadow .25s ease, border-color .25s ease; }
.sky-cart-search-box:focus-within { box-shadow: 0 0 0 3px rgba(255, 107, 26, .14); }

/* ---------- 产品卡：错峰上浮 + 悬浮抬升 ---------- */
.sky-productList .product-card { animation: fx-fade-up .5s cubic-bezier(.22, .61, .36, 1) both; }
.sky-productList .product-card:nth-child(1)  { animation-delay: .02s; }
.sky-productList .product-card:nth-child(2)  { animation-delay: .06s; }
.sky-productList .product-card:nth-child(3)  { animation-delay: .10s; }
.sky-productList .product-card:nth-child(4)  { animation-delay: .14s; }
.sky-productList .product-card:nth-child(5)  { animation-delay: .18s; }
.sky-productList .product-card:nth-child(6)  { animation-delay: .22s; }
.sky-productList .product-card:nth-child(7)  { animation-delay: .26s; }
.sky-productList .product-card:nth-child(8)  { animation-delay: .30s; }
.sky-productList .product-card:nth-child(9)  { animation-delay: .34s; }

.product-card { transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(18, 79, 104, .12); border-color: var(--teal-3); }

/* 参数/价格行：hover 轻微提亮 */
.pricing-info { transition: color .2s ease; }

/* ---------- 立即购买按钮：光泽 + 抬升 ---------- */
.buy-now-button { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.buy-now-button:not(.disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(255, 107, 26, .28); }
.buy-now-button::after {
  content: ""; position: absolute; top: 0; left: 0; width: 42%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-140%) skewX(-18deg); pointer-events: none;
}
.buy-now-button:not(.disabled):hover::after { animation: fx-shine .75s ease; }

/* ---------- 提示卡 / 协议卡：滑入 ---------- */
.cart-page-announcement, .cart-page-announce, .cart-agreement {
  animation: fx-fade-up .5s cubic-bezier(.22, .61, .36, 1) both;
}

/* ---------- 空状态：图标脉冲 ---------- */
.cart-empty-state i, .cart-no-result i { display: inline-block; animation: fx-pulse-soft 2.4s ease-in-out infinite; }

/* ---------- 分页：hover 抬升 ---------- */
.cart-pagination li a, .pagination li a, .page-link {
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.cart-pagination li a:hover, .pagination li a:hover, .page-link:hover { transform: translateY(-2px); }

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
