/* ============================================
   GoodsSources.com - Global Product Sourcing
   Style: Clean, Modern, Trustworthy
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #FF6A00;
  --primary-dark: #E55D00;
  --secondary: #1E3A6F;
  --secondary-light: #2C5282;
  --accent: #00A650;
  --bg-white: #FFFFFF;
  --bg-light: #F5F7FA;
  --bg-gray: #EDF0F5;
  --bg-dark: #1A1A2E;
  --text-primary: #1A1A2E;
  --text-secondary: #555770;
  --text-light: #8E90A6;
  --text-white: #FFFFFF;
  --border-color: #E2E6ED;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --max-width: 1280px;
  --header-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Top Announcement Bar --- */
.announcement-bar {
  background: var(--secondary);
  color: var(--text-white);
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}
.announcement-bar a {
  color: #FFB800;
  font-weight: 600;
  text-decoration: underline;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #FF8C38);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  line-height: 1;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-text .logo-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.logo-text .logo-brand span {
  color: var(--primary);
}
.logo-text .logo-slogan {
  font-size: 0.65rem;
  color: #666;
  letter-spacing: 0.8px;
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
}

/* Search */
.search-bar {
  flex: 1;
  max-width: 580px;
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  transition: var(--transition);
  overflow: hidden;
}
.search-bar:focus-within {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.1);
}
.search-bar select {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  min-width: 80px;
}
.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-light); }
.search-bar .search-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  margin: 3px;
  transition: var(--transition);
  white-space: nowrap;
}
.search-bar .search-btn:hover { background: var(--primary-dark); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-light);
  border-radius: var(--radius-full);
  padding: 3px;
}
.lang-btn {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: var(--secondary);
  color: white;
}

/* Nav Links */
.header-actions .nav-link {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.header-actions .nav-link:hover { color: var(--primary); background: rgba(255,106,0,0.06); }

/* Cart Icon */
.cart-btn {
  position: relative;
  padding: 8px 12px;
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.cart-btn:hover { color: var(--primary); }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Main Navigation --- */
.main-nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

/* --- Main Navigation Inner --- */
.main-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-nav-inner::-webkit-scrollbar { display: none; }
.main-nav-inner a {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.main-nav-inner a:hover,
.main-nav-inner a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* --- Main Navigation Inner (Taobao section) ---- */
/* These are merged with above */

/* Special: all-cat-trigger overrides */
.main-nav-inner .all-cat-trigger {
  border-bottom: 2px solid transparent !important;
}
.main-nav-inner .all-cat-trigger:hover,
.main-nav-inner .all-cat-trigger.active {
  border-bottom-color: transparent !important;
}

/* --- Header APP Download Link (prominent) --- */
.header-app-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 8px 14px;
  background: linear-gradient(135deg, #FF416C, #FF4B2B);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(255,65,108,0.35);
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.header-app-link::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.15) 50%,
    transparent 70%
  );
  animation: appShine 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes appShine {
  0% { transform: translateX(-100%) rotate(25deg); }
  60% { transform: translateX(100%) rotate(25deg); }
  100% { transform: translateX(100%) rotate(25deg); }
}
.header-app-link:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(255,65,108,0.5);
  color: white;
  text-decoration: none;
}
.header-app-link:active {
  transform: translateY(0) scale(0.98);
}
.header-app-link .app-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.header-app-link .app-text {
  letter-spacing: 0.3px;
}
.header-app-link .app-badge {
  font-size: 0.55rem;
  font-weight: 800;
  background: #FFD700;
  color: #d63031;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: appPulse 1.5s ease-in-out infinite;
  position: relative;
}
@keyframes appPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #FF6A00 0%, #FF8C38 30%, #1E3A6F 70%, #2C5282 100%);
  padding: 80px 24px 100px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.hero-content p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-primary {
  padding: 14px 36px;
  background: var(--text-white);
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--text-white);
  color: var(--primary-dark);
}
.btn-secondary {
  padding: 14px 36px;
  background: transparent;
  color: var(--text-white);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.4);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover {
  border-color: white;
  background: rgba(255,255,255,0.1);
}

/* Hero Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.stat-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.stat-card .number {
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}
.stat-card .label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}

/* --- Section Common Styles --- */
.section {
  padding: 80px 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.section-header p {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Categories Section --- */
.categories {
  background: var(--bg-white);
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-color);
  background: var(--bg-white);
}
.category-icon {
  width: 56px;
  height: 56px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.category-card span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Featured Products --- */
.featured {
  background: var(--bg-light);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  color: white;
  z-index: 2;
}
.product-badge.hot { background: #FF4757; }
.product-badge.new { background: var(--accent); }
.product-badge.sale { background: var(--primary); }
.product-img {
  height: 220px;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}
.product-img .placeholder-icon {
  opacity: 0.3;
}
.product-info {
  padding: 20px;
}
.product-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em;
}
.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-light);
}
.product-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.product-price .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}
.product-price .moq {
  font-size: 0.8rem;
  color: var(--text-light);
}
.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.product-actions a {
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-detail {
  background: var(--bg-light);
  color: var(--text-secondary);
}
.btn-detail:hover { background: var(--border-color); }
.btn-contact {
  background: var(--primary);
  color: white;
}
.btn-contact:hover { background: var(--primary-dark); }

/* --- Why Us Section --- */
.why-us {
  background: var(--bg-white);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.why-card {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.why-card:hover {
  background: var(--bg-light);
  transform: translateY(-4px);
}
.why-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), #FF8C38);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
}
.why-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.why-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* --- Partners Section --- */
.partners {
  background: var(--bg-light);
}
.partner-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.partner-item {
  padding: 20px 32px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  transition: var(--transition);
  opacity: 0.7;
}
.partner-item:hover {
  opacity: 1;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

/* --- Newsletter Section --- */
.newsletter {
  background: var(--secondary);
  padding: 64px 24px;
  text-align: center;
}
.newsletter h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.newsletter p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
  font-size: 1rem;
}
.newsletter-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.newsletter-form input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  font-size: 1rem;
  background: white;
}
.newsletter-form button {
  padding: 16px 32px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}
.newsletter-form button:hover {
  background: var(--primary-dark);
}

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.8);
  padding: 60px 24px 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .logo-text {
  color: white;
  margin-bottom: 16px;
  display: inline-block;
}
.footer-brand .logo-text span { color: var(--primary); }
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  max-width: 300px;
  margin-bottom: 20px;
}
.footer-social {
  display: flex;
  gap: 12px;
}
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  transition: var(--transition);
}
.footer-social a:hover {
  background: var(--primary);
  color: white;
}
.footer-col h4 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--primary);
  padding-left: 4px;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: rgba(255,255,255,0.4);
  transition: var(--transition);
}
.footer-links a:hover { color: white; }

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  background: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  cursor: pointer;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Page Header (inner pages) --- */
.page-header {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  padding: 40px 24px;
  text-align: center;
  color: white;
}
.page-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.page-header p {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
}
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}
.breadcrumb a {
  color: rgba(255,255,255,0.7);
}
.breadcrumb a:hover { color: white; }
.breadcrumb .sep { color: rgba(255,255,255,0.4); }

/* --- Filter Bar --- */
.filter-bar {
  background: var(--bg-white);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}
.filter-group select:focus {
  border-color: var(--primary);
}
.filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-content p { margin: 0 auto 32px; }
  .hero-buttons { justify-content: center; }
  .hero-stats { max-width: 500px; margin: 0 auto; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --header-height: 64px; }
  .mobile-toggle { display: flex; }

  .search-bar { display: none; }
  .header-actions .nav-link { display: none; }
  .lang-switcher { display: none; }

  .hero { padding: 48px 16px 64px; }
  .hero-content h1 { font-size: 2rem; }
  .hero-content p { font-size: 0.95rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .number { font-size: 1.6rem; }

  .section { padding: 48px 16px; }
  .section-header h2 { font-size: 1.5rem; }

  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-card { padding: 20px 12px; }
  .category-icon { width: 44px; height: 44px; font-size: 1.3rem; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .product-img { height: 160px; }

  .why-grid { grid-template-columns: 1fr; gap: 16px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .newsletter-form { flex-direction: column; border-radius: var(--radius-md); }
  .newsletter-form input { border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .newsletter-form button { border-radius: 0 0 var(--radius-md) var(--radius-md); }

  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 1.6rem; }
}

/* --- Utility Animations --- */
.fade-in { animation: fadeIn 0.6s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp 0.6s ease forwards; }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-gray) 25%, #f0f1f5 50%, var(--bg-gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-light);
  transition: var(--transition);
  cursor: pointer;
}
.modal-close:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.modal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal .subtitle {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,106,0,0.1);
}
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.btn-block {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-top: 8px;
}
.btn-block:hover {
  background: var(--primary-dark);
}
.form-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-light);
}
.form-footer a {
  color: var(--primary);
  font-weight: 600;
}
.form-footer a:hover { text-decoration: underline; }

/* --- Toast Notification --- */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: var(--accent);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 3000;
  opacity: 0;
  transform: translateX(100%);
  transition: var(--transition);
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   Taobao-style Mega Menu
   Left sidebar (一级类目) + Right flyout (二级/三级)
   ============================================ */

.main-nav-wrapper {
  position: relative;
  z-index: 100;
}

.main-nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  position: relative;
  z-index: 101;
}

/* --- "全部商品分类" trigger button --- */
.all-cat-trigger {
  display: flex !important;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), #FF8C38) !important;
  color: white !important;
  padding: 10px 18px !important;
  border-radius: var(--radius-sm);
  font-weight: 700 !important;
  border-bottom: none !important;
  margin: 4px 8px 4px 0;
  transition: var(--transition);
}

.all-cat-trigger:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(255,106,0,0.3);
}

.all-cat-trigger .trigger-icon {
  font-size: 1.1rem;
}

.all-cat-trigger .trigger-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.all-cat-trigger.active .trigger-arrow {
  transform: rotate(180deg);
}

/* --- Main Menu Panel (Taobao style) --- */
.taobao-menu.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  pointer-events: none;
  margin-top: -1px;
}

.taobao-menu.mega-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
  pointer-events: auto;
}

/* Two-column layout: sidebar + detail */
.taobao-inner {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 420px;
  max-height: 560px;
}

/* ============================================
   Left Sidebar — 一级类目
   ============================================ */
.taobao-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-light);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 8px 0;
}

.taobao-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.taobao-sidebar-item:hover,
.taobao-sidebar-item.active {
  background: #ffffff;
  color: var(--primary);
  border-left-color: var(--primary);
}

.taobao-sidebar-item.active {
  font-weight: 700;
}

.taobao-sidebar-item .s-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.taobao-sidebar-item .s-arrow {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--text-light);
  opacity: 0;
  transition: opacity 0.2s;
}

.taobao-sidebar-item:hover .s-arrow,
.taobao-sidebar-item.active .s-arrow {
  opacity: 1;
  color: var(--primary);
}

/* ============================================
   Right Detail Panel — 二级/三级类目
   ============================================ */
.taobao-detail {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  transition: opacity 0.12s ease;
}

.taobao-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

/* Category group row in detail panel */
.taobao-detail-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #f0f0f0;
}

.taobao-detail-group:last-child {
  border-bottom: none;
}

.taobao-detail-group .group-label {
  min-width: 80px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  padding-top: 3px;
  line-height: 1.6;
}

.taobao-detail-group .group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  flex: 1;
}

.taobao-detail-group .group-items a {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-right: 1px solid #eee;
  transition: all 0.15s ease;
  line-height: 1.6;
  white-space: nowrap;
}

.taobao-detail-group .group-items a:last-child {
  border-right: none;
}

.taobao-detail-group .group-items a:hover {
  color: var(--primary);
  background: rgba(255,106,0,0.05);
}

/* Badge in detail items */
.taobao-detail-group .group-items .td-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.taobao-detail-group .group-items .td-badge.hot {
  background: #fff0f0;
  color: #e53e3e;
}

.taobao-detail-group .group-items .td-badge.new {
  background: #f0fff4;
  color: #38a169;
}

/* Separator line between groups */
.taobao-detail-sep {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ============================================
   Detail panel — Bottom Promo Banner
   ============================================ */
.taobao-detail-promo {
  margin-top: auto;
  background: linear-gradient(135deg, #fff5ed, #fff0e6);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #ffdcc4;
}

.taobao-detail-promo .promo-tag {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.taobao-detail-promo .promo-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex: 1;
}

.taobao-detail-promo .promo-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.taobao-detail-promo .promo-link:hover {
  text-decoration: underline;
}

/* ============================================
   Detail panel — Empty state (first load)
   ============================================ */
.taobao-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--text-light);
  gap: 12px;
}

.taobao-detail-placeholder .ph-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.taobao-detail-placeholder .ph-text {
  font-size: 0.9rem;
  opacity: 0.5;
}

/* ============================================
   Mobile — collapse
   ============================================ */
@media (max-width: 768px) {
  .main-nav-wrapper {
    position: static;
  }

  .main-nav {
    display: none;
  }

  .main-nav.open {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 999;
    overflow-y: auto;
    padding: 20px;
  }

  .main-nav.open .main-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open .main-nav-inner a {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
  }

  .main-nav.open .all-cat-trigger {
    margin: 0 0 8px 0;
    justify-content: center;
  }

  .taobao-menu.mega-menu {
    display: none;
    position: static;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    pointer-events: auto;
    background: var(--bg-light);
  }

  .taobao-menu.mega-menu.active {
    display: block;
  }

  .taobao-inner {
    flex-direction: column;
    min-height: auto;
    max-height: none;
  }

  .taobao-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    overflow-y: visible;
  }

  .taobao-sidebar-item {
    flex: 1 1 33%;
    padding: 8px 10px;
    font-size: 0.82rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    justify-content: center;
  }

  .taobao-sidebar-item:hover,
  .taobao-sidebar-item.active {
    border-left: none;
    border-bottom-color: var(--primary);
  }

  .taobao-sidebar-item .s-arrow {
    display: none;
  }

  .taobao-detail {
    padding: 12px 16px;
    overflow-y: visible;
  }

  .taobao-detail-group {
    flex-direction: column;
    gap: 6px;
  }

  .taobao-detail-group .group-label {
    min-width: auto;
    text-align: left;
    font-size: 0.82rem;
  }

  .taobao-detail-group .group-items a {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .taobao-detail-promo {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .taobao-sidebar-item {
    flex: 1 1 50%;
    font-size: 0.78rem;
  }
}
