/* ============================================
   锋尚汽配 - 全局样式 v2
   Design: Industrial minimalism
   ============================================ */

:root {
  /* Core palette */
  --ink: #0c0c0e;
  --on-ink: #ffffff;
  --canvas: #ffffff;
  --surface: #f7f7f8;
  --border: #e8e8ea;
  --border-light: #f0f0f2;

  /* Text */
  --text-1: #0c0c0e;
  --text-2: #44464a;
  --text-3: #71737a;
  --text-4: #a0a2a8;

  /* Accent - Steel Blue */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-ring: rgba(37,99,235,0.15);

  /* Semantic */
  --red: #dc2626;
  --red-soft: #fef2f2;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --amber: #d97706;
  --amber-soft: #fffbeb;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --nav-h: 60px;
  --max-w: 1280px;

  /* Transition */
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ========== Reset ========== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--text-1); background: var(--canvas); line-height: 1.5; opacity: 0; animation: pageFadeIn .3s ease forwards; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ========== Utility ========== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s6); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: var(--r-md);
  transition: all .2s var(--ease); white-space: nowrap; border: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2a2e; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-1); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-block { display: flex; width: 100%; }

/* ========== Navigation ========== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h); background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light);
  transition: height .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.navbar-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s6);
  display: flex; align-items: center; height: 100%; gap: var(--s8);
}
.nav-logo {
  display: flex; align-items: center; gap: var(--s3);
  font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--ink);
  flex-shrink: 0;
}
.nav-logo svg { flex-shrink: 0; }
.nav-links { display: flex; gap: var(--s2); margin-left: var(--s6); }
.nav-links a {
  padding: 6px 14px; font-size: 14px; font-weight: 500; color: var(--text-3);
  border-radius: var(--r-pill); transition: all .15s var(--ease);
}
.nav-links a:hover { color: var(--text-1); background: var(--surface); }
.nav-links a.active { color: var(--ink); background: var(--surface); font-weight: 600; }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: var(--s3); }
.nav-user { font-size: 13px; color: var(--text-2); font-weight: 500; }
.nav-cart {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md); color: var(--text-2);
  transition: all .15s var(--ease);
}
.nav-cart:hover { background: var(--surface); color: var(--text-1); }
.nav-cart svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ========== Hero Carousel — Premium Cinematic ========== */
.hero-carousel {
  position: relative; overflow: hidden; height: 580px;
  background: #0a0a0c; contain: layout style;
}
/* Grid overlay */
.hero-carousel::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 60px 60px;
}
/* Vignette */
.hero-carousel::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10,10,12,.6) 100%);
}

.carousel-slides {
  position: relative; height: 100%; overflow: hidden;
}

/* Single slide — absolute + fade transition */
.carousel-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s .5s;
  contain: layout style paint;
}
.carousel-slide.active {
  opacity: 1; visibility: visible;
  transition: opacity .5s var(--ease), visibility 0s 0s;
}

/* Ken Burns — slow zoom on the slide background */
.carousel-slide .kb-bg {
  position: absolute; inset: 0; z-index: 0;
  transition: transform 6s ease-out;
  transform: scale(1);
  will-change: transform;
}
.carousel-slide.active .kb-bg {
  transform: scale(1.05);
}

/* Slide image — FULL BLEED as background */
.carousel-slide .slide-img {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover;
  background-position: center center;
  transition: transform 6s ease-out;
  transform: scale(1);
  will-change: transform;
}
.carousel-slide.active .slide-img {
  transform: scale(1.05);
}

/* ── Left gradient panel (brand colors, clipped to match slash) ── */
.carousel-slide .slide-left-panel {
  position: absolute; inset: 0; z-index: 1;
  clip-path: polygon(0 0, 44% 0, 36% 100%, 0 100%);
  opacity: 0;
  transition: opacity .9s var(--ease);
}
.carousel-slide.active .slide-left-panel {
  opacity: 1;
  transition-delay: .2s;
}
/* Soft edge fade along the slash boundary */
.carousel-slide .slide-left-panel::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: -30px;
  width: 60px;
  background: linear-gradient(90deg, rgba(10,10,12,.6) 0%, transparent 100%);
  pointer-events: none;
}

/* Overlay — subtle darkening on image side for text contrast */
.carousel-slide .slide-overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgba(10,10,12,.12) 0%, transparent 30%, transparent 70%, rgba(10,10,12,.15) 100%),
    linear-gradient(90deg, transparent 0%, rgba(10,10,12,.08) 50%, rgba(10,10,12,.12) 65%, rgba(10,10,12,.06) 80%, transparent 95%);
}

/* Content container */
.carousel-slide .carousel-inner {
  position: relative; z-index: 5;
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s6);
  width: 100%;
}

/* Staggered text reveal */
.carousel-slide .hero-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 6px 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6);
  margin-bottom: var(--s5);
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.carousel-slide.active .hero-badge {
  opacity: 1; transform: translateY(0);
  transition-delay: .15s;
  animation: pulse-glow 3.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 16px 3px rgba(255,255,255,.12); }
}
.carousel-slide .hero-badge svg { width: 14px; height: 14px; }

.carousel-slide h1 {
  font-size: 52px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.08;
  margin-bottom: var(--s5); max-width: 520px; color: #fff;
  opacity: 0; transform: translateY(28px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.carousel-slide.active h1 {
  opacity: 1; transform: translateY(0);
  transition-delay: .3s;
}
.carousel-slide h1 span { color: var(--accent); }

.carousel-slide p {
  font-size: 17px; color: rgba(255,255,255,.45); max-width: 420px; margin-bottom: var(--s8); line-height: 1.7;
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.carousel-slide.active p {
  opacity: 1; transform: translateY(0);
  transition-delay: .45s;
}

.carousel-slide .hero-btns {
  display: flex; gap: var(--s3);
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.carousel-slide.active .hero-btns {
  opacity: 1; transform: translateY(0);
  transition-delay: .6s;
}

/* Buttons inside slides */
.carousel-slide .btn-white {
  background: #fff; color: var(--ink); padding: 14px 32px; font-size: 15px; font-weight: 700;
  border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: var(--s2);
  transition: all .25s var(--ease); border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.carousel-slide .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.carousel-slide .btn-ghost-w {
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.12); padding: 14px 28px; font-size: 15px; font-weight: 600;
  border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: var(--s2);
  transition: all .25s var(--ease); cursor: pointer;
}
.carousel-slide .btn-ghost-w:hover { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.1); }

/* Slide number indicator */
.carousel-slide .slide-number {
  position: absolute; bottom: 40px; right: 60px; z-index: 4;
  font-size: 120px; font-weight: 900; color: rgba(255,255,255,.03);
  line-height: 1; letter-spacing: -8px;
  opacity: 0; transform: translateX(40px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.carousel-slide.active .slide-number {
  opacity: 1; transform: translateX(0);
  transition-delay: .5s;
}

/* Floating shapes — use radial-gradient instead of filter:blur for GPU performance */
.carousel-bg-shapes { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.float-shape {
  position: absolute; border-radius: 50%;
  animation: floatShape 8s ease-in-out infinite;
}
.float-shape.s1 { width: 500px; height: 500px; top: -120px; right: 5%; animation-duration: 12s; background: radial-gradient(circle, rgba(37,99,235,.15) 0%, rgba(37,99,235,.05) 40%, transparent 70%); }
.float-shape.s2 { width: 350px; height: 350px; bottom: -80px; left: 8%; animation-duration: 9s; animation-delay: 1s; background: radial-gradient(circle, rgba(168,85,247,.12) 0%, rgba(168,85,247,.04) 40%, transparent 70%); }
.float-shape.s3 { width: 220px; height: 220px; top: 25%; right: 28%; animation-duration: 11s; animation-delay: 2.5s; background: radial-gradient(circle, rgba(34,197,94,.08) 0%, rgba(34,197,94,.03) 40%, transparent 70%); }
@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -25px) scale(1.06); }
  50% { transform: translate(-20px, 18px) scale(.96); }
  75% { transform: translate(25px, 12px) scale(1.03); }
}

/* Carousel nav arrows — semi-transparent */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10; transition: all .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.carousel-arrow:hover { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25); transform: translateY(-50%) scale(1.08); }
.carousel-prev { left: 28px; }
.carousel-next { right: 28px; }

/* Carousel dots — pill style with progress */
.carousel-dots {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.carousel-dots .dot {
  position: relative; width: 28px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.2); border: none; cursor: pointer;
  transition: all .4s var(--ease); padding: 0; overflow: hidden;
}
.carousel-dots .dot::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 0; background: #fff; border-radius: 2px;
  transition: width .1s linear;
}
.carousel-dots .dot.active { background: rgba(255,255,255,.3); width: 48px; }
.carousel-dots .dot.active::after { width: var(--dot-progress, 0%); }

/* Progress bar at top — uses scaleX for GPU compositing (no layout thrashing) */
.carousel-progress {
  position: absolute; top: 0; left: 0; height: 2px; z-index: 10;
  background: var(--accent); width: 100%;
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
}

/* ========== Brand Stats Bar ========== */
.stats-bar {
  background: var(--ink); padding: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.stats-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 28px var(--s6);
}
.stat-item {
  display: flex; align-items: center; gap: var(--s5);
  padding: 0 var(--s10);
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: var(--accent); transition: all .3s var(--ease);
}
.stat-item:hover .stat-icon {
  background: rgba(37,99,235,.15); border-color: rgba(37,99,235,.3);
  transform: scale(1.06);
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-body { display: flex; flex-direction: column; }
.stat-num {
  font-size: 32px; font-weight: 800; color: #fff; line-height: 1.1;
  letter-spacing: -1px; display: inline-block;
}
.stat-unit { font-size: 14px; font-weight: 600; color: var(--accent); margin-left: 2px; }
.stat-label { font-size: 13px; color: rgba(255,255,255,.4); font-weight: 500; margin-top: 2px; }
.stat-divider {
  width: 1px; height: 40px; flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.12), transparent);
}
/* Stats divider breathing pulse */
@keyframes breathe-opacity {
  0%, 100% { opacity: .3; }
  50% { opacity: .8; }
}
.stats-inner .stat-divider { animation: breathe-opacity 2.5s ease-in-out infinite; }
.stats-inner .stat-divider:nth-child(2) { animation-delay: 0s; }
.stats-inner .stat-divider:nth-child(4) { animation-delay: .6s; }
.stats-inner .stat-divider:nth-child(6) { animation-delay: 1.2s; }

/* ========== Scroll Animations ========== */
.scroll-animate {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1), transform 0.5s cubic-bezier(.4,0,.2,1);
  contain: layout style paint;
}
.scroll-animate.animate-in {
  opacity: 1; transform: translateY(0);
}

/* ========== Section ========== */
.section { padding: var(--s12) 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s6);
}
.section-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.3px;
  display: flex; align-items: center; gap: var(--s3);
}
.section-title svg { width: 22px; height: 22px; color: var(--accent); }
.section-link {
  font-size: 13px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: var(--s1);
}
.section-link:hover { text-decoration: underline; }

/* ========== Categories Grid ========== */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4);
}
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s3);
  padding: var(--s6) var(--s4); background: var(--surface); border-radius: var(--r-lg);
  transition: all .3s cubic-bezier(.4,0,.2,1); border: 1px solid transparent;
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,.04) 0%, transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.cat-card:hover::before { opacity: 1; }
.cat-card:hover {
  border-color: rgba(37,99,235,.15); background: #fff;
  box-shadow: 0 8px 30px rgba(37,99,235,.08); transform: translateY(-4px);
}
.cat-icon {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 14px; color: var(--accent);
  box-shadow: var(--shadow-sm); transition: all .3s var(--ease);
  position: relative; z-index: 1;
}
.cat-card:hover .cat-icon {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,.25);
  transform: scale(1.08) translateY(-2px);
}
.cat-icon svg { width: 24px; height: 24px; transition: transform .3s var(--ease); }
.cat-card:hover .cat-icon svg { transform: scale(1.1); }
.cat-name { font-size: 14px; font-weight: 600; color: var(--text-1); position: relative; z-index: 1;
  transition: color .3s var(--ease); }
.cat-card:hover .cat-name { color: var(--accent); }
/* Category card corner gradient decoration */
.cat-card::after {
  content: ''; position: absolute; right: 0; bottom: 0;
  width: 30%; height: 30%;
  background: linear-gradient(135deg, transparent 0%, rgba(37,99,235,.08) 100%);
  border-radius: 0 0 var(--r-lg) 0; pointer-events: none; z-index: 0;
}
/* Category name underline stretch */
.cat-name::after {
  content: ''; position: absolute; left: 0; bottom: -3px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .3s var(--ease);
}
.cat-card:hover .cat-name::after { width: 100%; }

/* ========== Product Grid ========== */
.product-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--s5); }
.product-card {
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border-light); transition: all .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; position: relative;
}
.product-card:hover {
  border-color: rgba(37,99,235,.2); box-shadow: 0 12px 40px rgba(0,0,0,.08);
  transform: translateY(-4px);
}
.card-img {
  position: relative; aspect-ratio: 1/1; background: var(--surface);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.product-card:hover .card-img img { transform: scale(1.08); }
/* Quick-view overlay on hover */
.card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,10,12,.4) 100%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.product-card:hover .card-img::after { opacity: 1; }
/* Quick-view button */
.card-img::before {
  content: '快速查看'; position: absolute;
  bottom: 16px; left: 50%; z-index: 3;
  padding: 8px 20px; background: rgba(255,255,255,.94);
  color: var(--ink); font-size: 13px; font-weight: 600;
  border-radius: var(--r-pill);
  opacity: 0; transform: translateX(-50%) translateY(8px);
  transition: all .3s var(--ease);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.product-card:hover .card-img::before {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.card-badge {
  position: absolute; top: var(--s3); left: var(--s3);
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  z-index: 2;
}
.card-badge.hot { background: var(--red); color: #fff; }
.card-badge.new { background: var(--accent); color: #fff; }
/* Badge bounce-in on viewport entry */
@keyframes badge-bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  80% { transform: scale(.92); }
  100% { transform: scale(1); }
}
.scroll-animate.animate-in .card-badge {
  animation: badge-bounce .5s cubic-bezier(.22,.61,.36,1) .15s both;
}
.placeholder-img {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-4);
}
.placeholder-img svg { width: 40px; height: 40px; opacity: .4; }
.card-body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.card-title {
  font-size: 14px; font-weight: 500; color: var(--text-1); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s;
}
.product-card:hover .card-title { color: var(--accent); }
.card-price { display: flex; align-items: baseline; gap: var(--s2); }
.price-now {
  font-size: 20px; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.price-old { font-size: 13px; color: var(--text-4); text-decoration: line-through; }
.card-meta { font-size: 12px; color: var(--text-4); margin-top: auto; }

/* ========== Trust Bar ========== */
.trust-bar {
  display: grid; grid-template-columns: repeat(4,1fr); gap: var(--s4);
  padding: var(--s10) 0; border-top: 1px solid var(--border-light); margin-top: var(--s10);
}
.trust-item {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s5);
  background: var(--surface); border-radius: var(--r-lg);
  transition: all .3s var(--ease); border: 1px solid transparent;
  position: relative; overflow: hidden;
}
.trust-item:hover {
  background: #fff; border-color: rgba(37,99,235,.1);
  box-shadow: 0 4px 16px rgba(37,99,235,.06); transform: translateY(-2px);
}
/* Accent vertical bar */
.trust-item::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  border-radius: 1px; opacity: 0; transition: opacity .3s var(--ease);
}
.trust-item:hover::before { opacity: 1; }
.trust-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; color: var(--accent);
  box-shadow: var(--shadow-xs); transition: all .3s var(--ease); flex-shrink: 0;
}
.trust-item:hover .trust-icon {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
  transform: rotate(5deg);
}
.trust-icon svg { width: 20px; height: 20px; }
.trust-text span { display: block; }
.trust-text .t-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.trust-text .t-desc { font-size: 12px; color: var(--text-3); }

/* ========== Category Page Layout ========== */
.cat-layout { display: flex; gap: var(--s8); }
.filter-side {
  width: 240px; flex-shrink: 0; position: sticky; top: calc(var(--nav-h) + var(--s6));
  align-self: flex-start; max-height: calc(100vh - var(--nav-h) - var(--s8));
  overflow-y: auto;
}
.filter-card {
  background: #fff; border: 1px solid var(--border-light); border-radius: var(--r-lg);
  padding: var(--s5); margin-bottom: var(--s4);
}
.filter-card h3 {
  font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: var(--s3);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all .15s var(--ease); margin: 0 var(--s1) var(--s2) 0;
}
.filter-chip svg { width: 14px; height: 14px; }
.filter-chip:hover { border-color: var(--text-3); color: var(--text-1); }
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.price-inputs { display: flex; align-items: center; gap: var(--s2); }
.price-inputs input {
  width: 80px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; text-align: center;
  transition: border-color .15s;
}
.price-inputs input:focus { border-color: var(--accent); outline: none; }
.price-inputs span { color: var(--text-4); font-size: 13px; }
.filter-btns { display: flex; gap: var(--s2); margin-top: var(--s3); }

/* List Header */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s5); padding-bottom: var(--s3); border-bottom: 1px solid var(--border-light);
}
.list-count { font-size: 14px; color: var(--text-3); }
.sort-tabs { display: flex; gap: var(--s1); }
.sort-tabs a {
  padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-3);
  border-radius: var(--r-pill); transition: all .15s var(--ease);
}
.sort-tabs a:hover { color: var(--text-1); background: var(--surface); }
.sort-tabs a.active { color: var(--ink); background: var(--surface); font-weight: 600; }
.list-main { flex: 1; min-width: 0; }

/* ========== Product Detail ========== */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s10);
  padding: var(--s8) 0;
}
.gallery-wrap { position: sticky; top: calc(var(--nav-h) + var(--s6)); align-self: flex-start; }
.gallery-main {
  aspect-ratio: 1; background: var(--surface); border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: var(--s3);
  display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: var(--s2); }
.gallery-thumbs img {
  width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm);
  border: 2px solid transparent; cursor: pointer; transition: border-color .15s;
}
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--ink); }
.detail-info { padding-top: var(--s2); }
.detail-tag {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 4px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  margin-bottom: var(--s3);
}
.detail-tag.hot { background: var(--red-soft); color: var(--red); }
.detail-tag.new { background: var(--accent-soft); color: var(--accent); }
.detail-title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; margin-bottom: var(--s5); }
.detail-price-row { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s5); }
.detail-price-now { font-size: 36px; font-weight: 800; color: var(--red); }
.detail-price-old { font-size: 18px; color: var(--text-4); text-decoration: line-through; }
.detail-price-off {
  padding: 3px 8px; background: var(--red-soft); color: var(--red);
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
}
.detail-desc { font-size: 15px; line-height: 1.7; color: var(--text-2); margin-bottom: var(--s8); }
.detail-section { margin-bottom: var(--s6); }
.detail-section h4 {
  font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .3px; margin-bottom: var(--s3);
}
.spec-pills { display: flex; flex-wrap: wrap; gap: var(--s2); }
.spec-pill {
  padding: 9px 20px; border: 1.5px solid var(--border); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--text-2); transition: all .15s var(--ease);
  background: #fff;
}
.spec-pill:hover { border-color: var(--text-1); }
.spec-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.qty-row { display: flex; align-items: center; gap: var(--s3); }
.qty-ctrl {
  display: flex; align-items: center; border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
}
.qty-ctrl button {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-2); transition: background .15s;
}
.qty-ctrl button:hover { background: var(--surface); }
.qty-ctrl input {
  width: 48px; height: 38px; text-align: center; font-size: 14px; font-weight: 600;
  border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.qty-ctrl input:focus { outline: none; }
.detail-actions { display: flex; gap: var(--s3); margin-top: var(--s6); }
.detail-actions .btn { flex: 1; }
.detail-trust {
  display: flex; gap: var(--s6); padding-top: var(--s6); margin-top: var(--s6);
  border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-3);
}
.detail-trust-item { display: flex; align-items: center; gap: var(--s1); }
.detail-trust-item svg { width: 16px; height: 16px; color: var(--green); }


/* ========== Product Detail Enhancements ========== */

/* Back button */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: var(--s4);
  transition: color .2s var(--ease);
}
.detail-back:hover { color: var(--text-1); }

/* Detail grid entrance */
.detail-grid {
  opacity: 0;
  transform: translateY(24px);
  animation: detailGridIn .6s .1s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes detailGridIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Gallery main image fade transition */
.gallery-main img {
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.gallery-main img.fade-out {
  opacity: 0;
  transform: scale(.97);
}

/* Gallery zoom mode */
.gallery-main {
  cursor: zoom-in;
}
.gallery-main.zoom-mode {
  cursor: zoom-out;
  overflow: hidden;
}
.gallery-main.zoom-mode img {
  transform: scale(2);
  transition: transform .4s var(--ease);
}

/* Thumbnail hover effects */
.gallery-thumbs img {
  transition: all .25s var(--ease);
}
.gallery-thumbs img:hover {
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.gallery-thumbs img.active {
  border-color: var(--ink);
  transform: scale(1.05);
}

/* Price gradient */
.detail-price-now {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Discount pulse */
@keyframes priceOffPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.detail-price-off {
  animation: priceOffPulse 3s ease-in-out infinite;
  transform-origin: center;
  display: inline-block;
}

/* Savings text via pseudo-element */
.detail-price-old {
  position: relative;
}
.detail-price-old::after {
  content: '省' attr(data-save) '元';
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

/* Spec pill enhancements */
.spec-pill {
  position: relative;
  overflow: hidden;
  transition: all .25s var(--ease), box-shadow .25s var(--ease);
  background: #fff;
}
.spec-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  border-color: var(--text-1);
}
.spec-pill .spec-pill-text {
  position: relative;
  z-index: 1;
}

/* Active background slide from left */
.spec-pill::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--ink);
  border-radius: var(--r-pill);
  transition: width .35s var(--ease);
  z-index: 0;
}
.spec-pill.active {
  background: transparent;
  border-color: var(--ink);
  color: #fff;
}
.spec-pill.active::before {
  width: 100%;
}

/* Ripple effect on click */
.spec-pill::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .5s var(--ease), height .5s var(--ease), opacity .5s var(--ease);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.spec-pill.ripple::after {
  width: 200%;
  padding-bottom: 200%;
  height: 0;
  opacity: 1;
}

/* Add to cart button bounce */
@keyframes btnCartBounce {
  0% { transform: scale(1); }
  30% { transform: scale(0.95); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.detail-actions .btn-primary.animating {
  animation: btnCartBounce .45s var(--ease);
}

/* Flying dot for cart */
.cart-fly-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 9999;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Related cards stagger entrance */
#related-grid .product-card {
  opacity: 0;
  transform: translateY(20px);
}
#related-grid.stagger-in .product-card {
  animation: cardStaggerIn .5s var(--ease) forwards;
  animation-delay: calc(var(--i) * 80ms);
}
@keyframes cardStaggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Cart Page ========== */
.cart-layout { padding: var(--s8) 0; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  font-size: 12px; font-weight: 600; color: var(--text-4); text-transform: uppercase;
  letter-spacing: .5px; padding: var(--s3) 0; text-align: left; border-bottom: 1px solid var(--border);
}
.cart-table td { padding: var(--s5) 0; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.cart-prod { display: flex; align-items: center; gap: var(--s4); min-width: 240px; }
.cart-prod img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-md); }
.cart-prod-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.placeholder-sm {
  width: 72px; height: 72px; background: var(--surface); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; color: var(--text-4);
}
.placeholder-sm svg { width: 24px; height: 24px; opacity: .4; }
.cart-spec { font-size: 12px; color: var(--text-3); background: var(--surface); padding: 2px 8px; border-radius: var(--r-pill); }
.cart-unit { font-size: 14px; font-weight: 600; }
.cart-sub { font-size: 15px; font-weight: 700; color: var(--red); }
.btn-rm { font-size: 13px; color: var(--text-4); font-weight: 500; transition: color .15s; }
.btn-rm:hover { color: var(--red); }
.cart-summary-box {
  max-width: 380px; margin-left: auto; margin-top: var(--s6);
  background: var(--surface); border-radius: var(--r-xl); padding: var(--s6);
}
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: var(--s2) 0; color: var(--text-2); }
.sum-row.total { font-size: 20px; font-weight: 800; color: var(--text-1); border-top: 1px solid var(--border); padding-top: var(--s3); margin-top: var(--s2); }
.sum-note { font-size: 12px; color: var(--text-4); text-align: center; margin-top: var(--s3); }

/* ========== Auth Pages ========== */
.auth-wrap { max-width: 420px; margin: var(--s16) auto; }
.auth-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--s8);
  animation: authCardIn 0.5s cubic-bezier(.4,0,.2,1);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.auth-card:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.auth-card h2 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: var(--s6); }
.auth-hint {
  margin-top: var(--s8); padding: var(--s4); background: var(--surface);
  border-radius: var(--r-md); font-size: 13px; color: var(--text-3);
}
.auth-hint strong { color: var(--text-1); }
.auth-footer { text-align: center; font-size: 14px; color: var(--text-3); margin-top: var(--s5); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ========== Forms ========== */
.form-group { margin-bottom: var(--s4); }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: var(--s1); transition: all .2s var(--ease); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: 14px; color: var(--text-1);
  transition: border-color .15s var(--ease); background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }

/* ========== Flash Messages ========== */
.flash-messages {
  position: fixed; top: calc(var(--nav-h) + var(--s4)); right: var(--s6); z-index: 9999;
  display: flex; flex-direction: column; gap: var(--s2);
}
.flash-msg {
  padding: 12px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 380px;
}
.flash-success { background: var(--green-soft); color: var(--green); }
.flash-danger  { background: var(--red-soft); color: var(--red); }
.flash-warning { background: var(--amber-soft); color: var(--amber); }
.flash-info    { background: var(--accent-soft); color: var(--accent); }

/* ========== Toast ========== */
#toast-container { position: fixed; bottom: var(--s6); right: var(--s6); z-index: 9999; }
.toast {
  padding: 12px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px);
  transition: all .3s var(--ease); margin-top: var(--s2);
  background: #fff; color: var(--text-1);
  border-left: 4px solid var(--border);
  position: relative; overflow: hidden;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: var(--s16) 0; }
.empty-state svg { width: 64px; height: 64px; color: var(--text-4); margin-bottom: var(--s4); }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-2); margin-bottom: var(--s2); }
.empty-state p { font-size: 14px; color: var(--text-4); }

/* ========== Footer ========== */
.footer { background: var(--ink); color: rgba(255,255,255,.6); padding: var(--s12) 0 var(--s8); position: relative; overflow: hidden; }
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .3;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s8);
  padding-bottom: var(--s8); border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand { max-width: 280px; }
.footer-logo { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: var(--s3); display: flex; align-items: center; gap: var(--s2); }
.footer-logo svg { color: var(--accent); }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-col h4 { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.9); margin-bottom: var(--s3); text-transform: uppercase; letter-spacing: .5px; }
.footer-col a { display: block; font-size: 13px; padding: var(--s1) 0; color: rgba(255,255,255,.35); transition: all .2s var(--ease); transform: translateX(0); }
.footer-col a:hover { color: var(--accent); transform: translateX(4px); }
.footer-bottom { padding-top: var(--s6); font-size: 11px; color: rgba(255,255,255,.18); text-align: center; letter-spacing: .3px; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .hero-carousel { height: 480px; }
  .carousel-slide h1 { font-size: 42px; }
  .carousel-slide .slide-number { font-size: 80px; right: 40px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-side { display: none; }
  .cat-layout { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .gallery-wrap { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hero-carousel { height: 400px; }
  .carousel-slide h1 { font-size: 34px; }
  .carousel-slide p { font-size: 15px; }
  .carousel-slide .slide-number { display: none; }
  .carousel-arrow { width: 40px; height: 40px; }
  .carousel-arrow svg { width: 16px; height: 16px; }
  .carousel-prev { left: 12px; }
  .carousel-next { right: 12px; }
  .nav-links { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
  .trust-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .detail-title { font-size: 22px; }
  .detail-price-now { font-size: 28px; }
  .stats-inner { flex-wrap: wrap; gap: var(--s5) var(--s6); padding: var(--s6) var(--s4); }
  .stat-item { padding: var(--s2) var(--s5); }
  .stat-num { font-size: 24px; }
  .stat-icon { width: 42px; height: 42px; border-radius: 10px; }
  .stat-divider { height: 28px; }
  /* Mobile: darker overlay for readability */
  .carousel-slide .slide-overlay { background: linear-gradient(90deg, rgba(10,10,12,.3) 0%, rgba(10,10,12,.2) 38%, rgba(10,10,12,.35) 55%, rgba(10,10,12,.15) 100%); }
  /* Mobile: shift left panel clip-path */
  .carousel-slide .slide-left-panel { clip-path: polygon(0 0, 36% 0, 28% 100%, 0 100%); }
}
@media (max-width: 480px) {
  .hero-carousel { height: 360px; padding: 0; }
  .carousel-slide h1 { font-size: 28px; letter-spacing: -.5px; }
  .carousel-slide .hero-btns { flex-direction: column; }
  .carousel-slide .slide-left-panel { clip-path: polygon(0 0, 30% 0, 22% 100%, 0 100%); }
  .carousel-arrow { display: none; }
  .carousel-dots { bottom: 16px; }
  .product-grid { grid-template-columns: 1fr; }
  .container { padding: 0 var(--s4); }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn,
  .auth-card .btn,
  .cart-summary-box .btn { width: 100%; }
  .stats-inner { flex-direction: column; gap: var(--s3); padding: var(--s5) var(--s4); }
  .stat-item { padding: var(--s2) 0; width: 100%; }
  .stat-divider { width: 40px; height: 1px; background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent); }
  .stat-num { font-size: 22px; }
}

/* ========== Navbar Scroll Effect ========== */
.navbar-scrolled {
  background: rgba(255,255,255,.98);
  box-shadow: 0 2px 24px rgba(0,0,0,.1);
  height: 56px;
}
.navbar-scrolled::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .4;
}

/* ========== Page Transition Keyframes ========== */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========== Main Entrance Animation ========== */
main {
  animation: mainSlideUp .4s .05s cubic-bezier(.4,0,.2,1) both;
}
@keyframes mainSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== Auth Card Animations ========== */
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== Form Label Float ========== */
.form-group:focus-within label {
  transform: translateY(-2px);
  color: var(--accent);
}

/* ========== Button Loading State ========== */
.btn-loading {
  transform: scale(.96) !important;
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
}
.btn-outline.btn-loading::after,
.btn-ghost.btn-loading::after {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--text-2);
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ========== Toast Progress Bar ========== */
.toast-bar {
  position: absolute; bottom: 0; left: 0;
  height: 3px; border-radius: 0 2px 2px 0;
  background: var(--accent);
  animation: toastBar 3s linear forwards;
}
.toast-success .toast-bar { background: rgba(22,163,74,.5); }
.toast-error   .toast-bar { background: rgba(220,38,38,.5); }
@keyframes toastBar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ========== Footer Particle Effect ========== */
.footer::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(2px 2px at 20% 25%, rgba(37,99,235,.25), transparent),
    radial-gradient(1.5px 1.5px at 72% 16%, rgba(255,255,255,.12), transparent),
    radial-gradient(2px 2px at 38% 72%, rgba(37,99,235,.18), transparent),
    radial-gradient(1.5px 1.5px at 82% 64%, rgba(255,255,255,.08), transparent),
    radial-gradient(1.5px 1.5px at 14% 52%, rgba(255,255,255,.1), transparent);
  animation: footerParticles 8s ease-in-out infinite alternate;
}
@keyframes footerParticles {
  0%   { opacity: .5; }
  50%  { opacity: 1; }
  100% { opacity: .5; }
}

/* ========== GPU Acceleration for Active Animations ========== */
.carousel-slide.active .slide-img,
.carousel-slide.active .kb-bg {
  will-change: transform;
}
.float-shape {
  will-change: transform;
}

/* ========== Focus Visible (Keyboard Navigation) ========== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========== Touch Optimization ========== */
a, button, .btn, .nav-cart, .cat-card, .product-card, .trust-item,
.carousel-arrow, .carousel-dots .dot, .spec-pill, .filter-chip {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-carousel, .carousel-slides, .carousel-slide,
  .scroll-animate, .float-shape {
    will-change: auto;
  }
}


/* ============================================
   Cart Page Enhancements
   ============================================ */

/* Empty state enhanced */
.cart-empty-enhanced { padding: var(--s12) 0; }
.cart-empty-illustration {
    width: 140px; height: 140px; margin: 0 auto var(--s5);
    animation: cartEmptyFloat 3s ease-in-out infinite;
}
.cart-empty-illustration svg { width: 100%; height: 100%; }
@keyframes cartEmptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.cart-empty-btn { gap: var(--s2); }
.cart-empty-btn svg { transition: transform .3s var(--ease); }
.cart-empty-btn:hover svg { transform: translateX(3px); }

/* Cart table row hover */
.cart-table tbody tr {
    transition: background .2s var(--ease);
    border-radius: var(--r-md);
}
.cart-table tbody tr:hover {
    background: rgba(37,99,235,.03);
}

/* Delete button with confirm tooltip */
.btn-rm {
    position: relative;
    font-size: 13px; color: var(--text-4); font-weight: 500;
    transition: all .2s var(--ease);
    padding: 6px 12px; border-radius: var(--r-sm);
    overflow: hidden; min-width: 72px; text-align: center;
}
.btn-rm:hover {
    background: var(--red-soft); color: var(--red);
}
.btn-rm .btn-rm-confirm {
    display: none;
    font-size: 12px; font-weight: 600;
}
.btn-rm:hover .btn-rm-text { display: none; }
.btn-rm:hover .btn-rm-confirm { display: inline; }

/* Quantity controller enhanced */
.cart-qty-ctrl {
    display: inline-flex; align-items: center;
    border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
.cart-qty-ctrl button {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--text-2);
    transition: all .15s var(--ease); background: #fff;
}
.cart-qty-ctrl button:hover { background: var(--surface); color: var(--accent); }
.cart-qty-ctrl button:active { background: var(--accent-soft); transform: scale(.92); }
.cart-qty-ctrl input {
    width: 40px; height: 32px; text-align: center;
    font-size: 14px; font-weight: 600; border: none;
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    background: #fff;
}

/* Subtotal flash animation */
.cart-sub-flash { transition: color .3s; }
.cart-sub-flash.flash { animation: subtotalFlash .4s ease; }
@keyframes subtotalFlash {
    0% { color: var(--red); text-shadow: 0 0 8px rgba(220,38,38,.3); }
    100% { color: var(--red); text-shadow: none; }
}

/* Summary box slide-in */
.cart-summary-slide {
    max-width: 380px; margin-left: auto; margin-top: var(--s6);
    background: var(--surface); border-radius: var(--r-xl); padding: var(--s6);
    animation: cartSummarySlide .6s var(--ease) both;
}
@keyframes cartSummarySlide {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Pulse glow button */
.btn-pulse-glow {
    animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
    50% { box-shadow: 0 0 0 10px rgba(37,99,235,0); }
}

/* Cart note */
.cart-note textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: var(--r-md); font-size: 14px; resize: vertical;
    transition: border-color .15s var(--ease); min-height: 64px;
    background: #fff;
}
.cart-note textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* Recommendations horizontal scroll */
.rec-scroll {
    display: flex; gap: var(--s4);
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: var(--s3); scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.rec-scroll::-webkit-scrollbar { height: 6px; }
.rec-scroll::-webkit-scrollbar-track { background: var(--surface); border-radius: var(--r-pill); }
.rec-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-pill); }
.rec-scroll .product-card {
    flex: 0 0 220px; scroll-snap-align: start;
}
.guess-like-title svg { color: var(--red); }

/* ============================================
   Category Page Enhancements
   ============================================ */

/* Search expand */
.cat-search-wrap { margin-bottom: var(--s4); }
.cat-search-form { position: relative; }
.cat-search-input-wrap {
    display: flex; align-items: center;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--r-pill); padding: 0 var(--s3) 0 var(--s4);
    transition: all .3s var(--ease); width: 200px;
}
.cat-search-input-wrap:focus-within {
    width: 100%; background: #fff; border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}
.cat-search-icon {
    width: 18px; height: 18px; color: var(--text-4); flex-shrink: 0;
    transition: transform .4s var(--ease), color .2s;
    margin-right: var(--s2);
}
.cat-search-input-wrap:focus-within .cat-search-icon {
    transform: rotate(90deg); color: var(--accent);
}
.cat-search-input-wrap input {
    flex: 1; border: none; background: transparent; padding: 10px 0;
    font-size: 14px; outline: none; min-width: 0;
}
.cat-search-submit {
    padding: 6px 16px; background: var(--accent); color: #fff;
    font-size: 13px; font-weight: 600; border-radius: var(--r-pill);
    opacity: 0; transform: scale(.9); pointer-events: none;
    transition: all .2s var(--ease);
}
.cat-search-input-wrap:focus-within .cat-search-submit {
    opacity: 1; transform: scale(1); pointer-events: auto;
}
.cat-search-suggestions {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border-light);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    z-index: 50; display: none; overflow: hidden;
    animation: suggDrop .2s var(--ease) both;
}
@keyframes suggDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.suggestion-item {
    padding: 10px 16px; font-size: 14px; color: var(--text-1);
    cursor: pointer; transition: background .15s;
    border-bottom: 1px solid var(--border-light);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--surface); }
.suggestion-item mark { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 2px; padding: 0 2px; }

/* List count bar */
.list-count-bar {
    font-size: 13px; color: var(--text-4); margin-bottom: var(--s3);
}

/* Sort tabs with slider */
.sort-tabs {
    position: relative; display: flex; gap: var(--s1);
    background: var(--surface); padding: 4px; border-radius: var(--r-pill);
}
.sort-tabs a {
    position: relative; z-index: 1;
    padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-3);
    border-radius: var(--r-pill); transition: color .2s var(--ease);
    display: inline-flex; align-items: center; gap: 4px;
}
.sort-tabs a:hover { color: var(--text-1); }
.sort-tabs a.active { color: var(--ink); font-weight: 600; }
.sort-slider {
    position: absolute; top: 4px; bottom: 4px;
    background: #fff; border-radius: var(--r-pill);
    box-shadow: var(--shadow-sm);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    z-index: 0;
}

/* Filter chip fill animation */
.filter-chip {
    position: relative; overflow: hidden; z-index: 1;
}
.filter-chip::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 100%);
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--ease);
    z-index: -1; border-radius: var(--r-pill);
}
.filter-chip.active::before { transform: scaleX(1); }
.filter-chip.active {
    background: transparent; color: #fff; border-color: var(--ink);
}

/* Filter card expand/collapse */
.filter-expandable { transition: all .3s var(--ease); }
.filter-expandable.collapsed .filter-toggle svg { transform: rotate(-90deg); }
.filter-expandable.collapsed > div,
.filter-expandable.collapsed > form {
    max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
    transition: all .3s var(--ease);
}
.filter-expandable > div,
.filter-expandable > form {
    max-height: 500px; opacity: 1;
    transition: all .3s var(--ease);
}
.filter-toggle {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none;
    transition: color .2s;
}
.filter-toggle svg { transition: transform .3s var(--ease); }
.filter-toggle:hover { color: var(--text-1); }

/* Price inputs enhanced */
.price-inputs-enhanced { display: flex; align-items: center; gap: var(--s2); }
.price-input-wrap {
    position: relative; flex: 1;
}
.price-input-wrap .price-currency {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: var(--text-4); pointer-events: none;
}
.price-input-wrap input {
    width: 100%; padding: 8px 10px 8px 24px;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    font-size: 13px; text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.price-input-wrap input:focus {
    border-color: var(--accent); outline: none;
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.price-sep { color: var(--text-4); font-size: 12px; font-weight: 600; }

/* Product grid stagger entrance */
.product-stagger .product-card {
    opacity: 0; transform: translateY(24px);
    animation: productStagger .5s var(--ease) forwards;
}
.product-stagger .product-card:nth-child(1)  { animation-delay: 0.00s; }
.product-stagger .product-card:nth-child(2)  { animation-delay: 0.06s; }
.product-stagger .product-card:nth-child(3)  { animation-delay: 0.12s; }
.product-stagger .product-card:nth-child(4)  { animation-delay: 0.18s; }
.product-stagger .product-card:nth-child(5)  { animation-delay: 0.24s; }
.product-stagger .product-card:nth-child(6)  { animation-delay: 0.30s; }
.product-stagger .product-card:nth-child(7)  { animation-delay: 0.36s; }
.product-stagger .product-card:nth-child(8)  { animation-delay: 0.42s; }
.product-stagger .product-card:nth-child(9)  { animation-delay: 0.48s; }
.product-stagger .product-card:nth-child(10) { animation-delay: 0.54s; }
.product-stagger .product-card:nth-child(11) { animation-delay: 0.60s; }
.product-stagger .product-card:nth-child(12) { animation-delay: 0.66s; }
@keyframes productStagger {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Load more button */
.load-more-wrap { text-align: center; margin-top: var(--s8); }
.load-more-btn {
    gap: var(--s2); min-width: 160px;
    transition: all .3s var(--ease);
}
.load-more-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.load-more-btn svg { transition: transform .3s var(--ease); }
.load-more-btn:hover svg { transform: rotate(180deg); }

/* ============================================
   Responsive Enhancements
   ============================================ */
@media (max-width: 1024px) {
    .cat-search-input-wrap { width: 100%; }
    .rec-scroll .product-card { flex: 0 0 180px; }
}
@media (max-width: 768px) {
    .cart-summary-slide { max-width: 100%; margin-left: 0; animation: none; }
    .cart-table th:nth-child(2), .cart-table td:nth-child(2),
    .cart-table th:nth-child(3), .cart-table td:nth-child(3) { display: none; }
    .rec-scroll .product-card { flex: 0 0 160px; }
    .sort-tabs a { padding: 5px 10px; font-size: 12px; }
    .sort-tabs a svg { display: none; }
}
