/* Top Bar - JD Style */
.top-bar {
  background: var(--jd-topbar-bg);
  color: var(--jd-topbar-text);
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #d4d4d4;
}

.top-bar-inner {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: var(--jd-text-light);
  margin-left: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.top-bar a:hover {
  color: var(--jd-red);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn {
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
  color: var(--jd-text-light);
  background: transparent;
}

.lang-btn:hover {
  color: var(--jd-red);
}

.lang-btn.active {
  color: #fff;
  background: var(--primary);
}

/* Top Bar 红色主题 */
.top-bar {
  background: var(--primary) !important;
  color: #fff !important;
  border-bottom: none !important;
}

.top-bar a {
  color: rgba(255,255,255,0.9) !important;
}

.top-bar a:hover {
  color: #fff !important;
}

.lang-btn {
  color: rgba(255,255,255,0.8) !important;
}

.lang-btn:hover {
  color: #fff !important;
}

.lang-btn.active {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

/* Header - JD Style */
.header {
  background: var(--bg-white);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--jd-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--jd-red);
  letter-spacing: -1px;
}

.logo-sub {
  font-size: 11px;
  color: var(--jd-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Search Box - JD Style */
.search-box {
  flex: 1;
  max-width: 550px;
  display: flex;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--jd-red);
  border-right: none;
  border-radius: 0;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.search-input:focus {
  border-color: var(--jd-red);
}

.search-btn {
  width: 60px;
  background: var(--jd-red);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--jd-red-dark);
}

/* Navigation - JD Style */
.nav {
  background: var(--jd-red);
  color: #fff;
  font-size: 14px;
}

.nav-inner {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 40px;
}

.nav-all-cat {
  width: var(--sidebar-width);
  background: var(--jd-red-dark);
  padding: 0 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.nav-links {
  display: flex;
  gap: 32px;
  padding: 0 24px;
}

.nav-links a {
  color: #fff;
  font-weight: 500;
  transition: opacity 0.2s;
  line-height: 40px;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 0.9;
  text-decoration: none;
}

/* Main Layout */
.main-layout {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  gap: 16px;
  min-height: calc(100vh - 300px);
}

/* Sidebar - JD Style */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border: 1px solid var(--jd-border);
  border-top: none;
  flex-shrink: 0;
}

.sidebar-title {
  background: var(--jd-red-dark);
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-list {
  list-style: none;
  padding: 8px 0;
}

.cat-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--jd-text);
  border-left: 3px solid transparent;
}

.cat-item:hover {
  background: #f5f5f5;
  color: var(--jd-red);
}

.cat-item.active {
  background: #fff0f1;
  color: var(--jd-red);
  border-left-color: var(--jd-red);
  font-weight: 600;
}

.cat-item .emoji {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.cat-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--jd-text-muted);
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 2px;
}

.cat-item.active .count {
  background: rgba(241,2,21,0.1);
  color: var(--jd-red);
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
}

/* Filter Bar - JD Style */
.filter-bar {
  background: #fff;
  padding: 12px 16px;
  border: 1px solid var(--jd-border);
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.filter-label {
  color: var(--jd-text-light);
  font-weight: 500;
}

.filter-tag {
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--jd-text-light);
  border-radius: 2px;
}

.filter-tag:hover {
  color: var(--jd-red);
}

.filter-tag.active {
  color: #fff;
  background: var(--jd-red);
}

.sort-select {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--jd-border);
  border-radius: 2px;
  font-size: 13px;
  color: var(--jd-text);
  background: #fff;
  cursor: pointer;
}

.total-count {
  color: var(--jd-text-muted);
  font-size: 13px;
}

.total-count strong {
  color: var(--jd-red);
  font-weight: 600;
}

/* Product Grid - JD Style */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.product-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  border-color: var(--jd-red);
  box-shadow: 0 2px 12px rgba(241,2,21,0.1);
}

.product-img-wrap {
  position: relative;
  padding-top: 100%;
  background: #f8f8f8;
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-img {
  transform: scale(1.03);
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  z-index: 2;
}

.product-badge.hot {
  background: var(--jd-red);
  color: #fff;
}

.product-badge.new {
  background: #5cb85c;
  color: #fff;
}

.product-info {
  padding: 12px;
}

.product-cat {
  font-size: 11px;
  color: var(--jd-text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-name {
  font-size: 13px;
  color: var(--jd-text);
  line-height: 1.5;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.product-card:hover .product-name {
  color: var(--jd-red);
}

.product-price {
  margin-bottom: 8px;
}

.price-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--jd-red);
}

.price-main .yuan {
  font-size: 12px;
  font-weight: 400;
  margin-right: 2px;
}

.price-original {
  font-size: 12px;
  color: var(--jd-text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.price-unit {
  font-size: 11px;
  color: var(--jd-text-muted);
  margin-top: 4px;
}

.product-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.btn-sm {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  border: none;
}

.btn-cart {
  background: #fff;
  color: var(--jd-red);
  border: 1px solid var(--jd-red);
}

.btn-cart:hover {
  background: #fff0f1;
}

.btn-view {
  background: var(--jd-red);
  color: #fff;
}

.btn-view:hover {
  background: var(--jd-red-dark);
}

/* Pagination - JD Style */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 24px 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--jd-border);
  background: #fff;
  color: var(--jd-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 2px;
}

.page-btn:hover {
  border-color: var(--jd-red);
  color: var(--jd-red);
}

.page-btn.active {
  background: var(--jd-red);
  border-color: var(--jd-red);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hero Banner - JD Style */
.hero-banner {
  background: linear-gradient(135deg, #e4393c 0%, #f10215 100%);
  color: #fff;
  padding: 40px 0;
  margin-bottom: 16px;
}

.hero-inner {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-text h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-text p {
  font-size: 16px;
  opacity: 0.95;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat-num {
  font-size: 28px;
  font-weight: 700;
}

.hero-stat-label {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

.hero-badge {
  background: rgba(255,255,255,0.15);
  padding: 20px 32px;
  border-radius: 4px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.hero-badge-num {
  font-size: 24px;
  font-weight: 700;
}

/* Footer - JD Style */
.footer {
  background: #2e2e2e;
  color: #999;
  padding: 40px 0;
  margin-top: 40px;
}

.footer-inner {
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer p {
  font-size: 13px;
  line-height: 1.8;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: #999;
  font-size: 13px;
  padding: 6px 0;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--jd-red);
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--jd-text-muted);
  font-size: 14px;
  display: none;
}

.loading.show {
  display: block;
}

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

.header-cart-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  transition: all 0.2s;
}

.header-cart-btn:hover {
  background: var(--jd-red);
  color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  
  .main-layout {
    padding: 0 12px 40px;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sort-select {
    margin-left: 0;
    width: 100%;
  }
}
