/* 华见跨境电商平台新版样式 */
/* 主题配色 */
:root {
  --hj-primary: #ff6a00;
  --hj-secondary: #2c3e50;
  --hj-accent: #2ecc71;
  --hj-light: #f8f9fa;
  --hj-dark: #343a40;
  --hj-danger: #e74c3c;
  --hj-info: #3498db;
  --hj-text: #333;
  --hj-text-light: #6c757d;
  --hj-border: #e1e1e1;
  --hj-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --hj-radius: 6px;
  --hj-transition: all 0.3s ease;
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--hj-text);
  background-color: #f6f6f6;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--hj-text);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==================== 头部样式 ==================== */
.hj-toolbar {
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: #666;
}

.hj-toolbar-con {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  height: 36px;
  line-height: 36px;
}

.hj-toolbar-left {
  display: flex;
}

.hj-toolbar-right {
  display: flex;
}

.hj-bar-node {
  position: relative;
  padding: 0 10px;
  color: #666;
}

.hj-bar-node:hover {
  color: var(--hj-primary);
}

.hj-bar-node-box {
  position: relative;
  margin-left: 10px;
}

.hj-bar-node-divider {
  width: 1px;
  height: 14px;
  background-color: #ddd;
  margin: 11px 5px;
}

.hj-login, .hj-register {
  padding: 0 10px;
  color: #666;
}

.hj-login:hover, .hj-register:hover {
  color: var(--hj-primary);
}

.hj-register {
  position: relative;
}

.hj-register::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background-color: #ddd;
}

/* 头部主区域 */
.hj-header-wrap {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 100;
}

.hj-header {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hj-logo {
  display: flex;
  align-items: center;
}

.hj-logo-img {
  height: 50px;
}

.hj-cart-btn {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--hj-light);
  border-radius: 4px;
  margin-left: 15px;
  color: var(--hj-text);
  font-weight: 500;
}

.hj-cart-btn:hover {
  background-color: var(--hj-primary);
  color: #fff;
}

.hj-cart-btn i {
  margin-right: 5px;
  font-size: 16px;
}

/* 主导航 */
.hj-main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 30px;
}

.hj-category {
  position: relative;
  margin-right: 20px;
}

.hj-category-title {
  display: flex;
  align-items: center;
  background-color: var(--hj-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}

.hj-category-title i {
  margin-right: 5px;
}

.hj-category-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  background-color: #fff;
  box-shadow: var(--hj-shadow);
  border-radius: 0 0 4px 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.hj-category:hover .hj-category-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hj-category-item {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
}

.hj-category-item a {
  display: block;
  color: var(--hj-text);
  font-size: 14px;
}

.hj-category-item:hover {
  background-color: #f8f9fa;
}

.hj-category-item:hover a {
  color: var(--hj-primary);
}

.hj-nav-list {
  display: flex;
  margin-left: 20px;
}

.hj-nav-item {
  margin: 0 15px;
  position: relative;
}

.hj-nav-item a {
  display: block;
  padding: 10px 0;
  color: var(--hj-text);
  font-size: 16px;
  font-weight: 500;
  position: relative;
}

.hj-nav-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--hj-primary);
  transition: all 0.3s ease;
}

.hj-nav-item:hover a {
  color: var(--hj-primary);
}

.hj-nav-item:hover a::after,
.hj-nav-item.active a::after {
  width: 100%;
}

/* 移动端菜单按钮 */
.hj-mobile-menu {
  display: none;
  width: 30px;
  height: 30px;
  flex-direction: column;
  justify-content: space-around;
  cursor: pointer;
}

.hj-mobile-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--hj-dark);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* ==================== 底部样式 ==================== */
.hj-footer {
  background-color: var(--hj-secondary);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 50px;
}

.hj-footer-content {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
}

.hj-footer-info {
  text-align: center;
  line-height: 1.8;
  font-size: 14px;
}

.hj-footer-info p {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.hj-footer-info a {
  color: rgba(255, 255, 255, 0.8);
}

.hj-footer-info a:hover {
  color: var(--hj-primary);
  text-decoration: underline;
}

.hj-footer-divider {
  width: 50px;
  height: 2px;
  background-color: var(--hj-primary);
  margin: 20px auto;
  opacity: 0.5;
}

.hj-copyright {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* 响应式布局 - 头部和底部 */
@media (max-width: 992px) {
  .hj-header {
    padding: 10px 0;
  }
  
  .hj-logo-img {
    height: 40px;
  }
  
  .hj-main-nav {
    padding: 0 15px;
  }
  
  .hj-nav-item {
    margin: 0 10px;
  }
  
  .hj-nav-item a {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .hj-mobile-menu {
    display: flex;
  }
  
  .hj-main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 100;
  }
  
  .hj-main-nav.active {
    max-height: 500px;
  }
  
  .hj-category {
    width: 100%;
    margin-right: 0;
  }
  
  .hj-category-title {
    border-radius: 0;
    padding: 15px 20px;
  }
  
  .hj-category-menu {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    display: none;
  }
  
  .hj-category.active .hj-category-menu {
    display: block;
  }
  
  .hj-category-item {
    padding-left: 40px;
  }
  
  .hj-nav-list {
    width: 100%;
    flex-direction: column;
    margin-left: 0;
  }
  
  .hj-nav-item {
    margin: 0;
    width: 100%;
    border-bottom: 1px solid #eee;
  }
  
  .hj-nav-item a {
    padding: 15px 20px;
  }
  
  .hj-toolbar-con {
    flex-direction: column;
    height: auto;
    padding: 10px 0;
  }
  
  .hj-toolbar-left, .hj-toolbar-right {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 576px) {
  .hj-header {
    flex-wrap: wrap;
  }
  
  .hj-logo {
    margin-bottom: 10px;
  }
  
  .hj-bar-node {
    padding: 0 5px;
    font-size: 12px;
  }
  
  .hj-new-products .hj-products-row {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .hj-new-arrivals .hj-product-img-container {
    height: auto;
    padding-top: 100%;
  }
}

/* 全局容器 */
.hj-container {
  width: 90%;
  max-width: 1280px;
  margin: 50px auto;
}

.hj-section {
  margin-bottom: 50px;
}

.hj-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.hj-section-title-wrap {
  margin-bottom: 5px;
}

.hj-section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--hj-secondary);
  margin-bottom: 5px;
}

.hj-section-subtitle {
  font-size: 14px;
  color: var(--hj-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hj-section-more {
  font-size: 14px;
  color: var(--hj-primary);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: var(--hj-transition);
}

.hj-section-more:hover {
  color: var(--hj-dark);
}

.hj-view-all {
  font-size: 14px;
  color: var(--hj-primary);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--hj-primary);
  border-radius: 4px;
  transition: var(--hj-transition);
}

.hj-view-all:hover {
  background-color: var(--hj-primary);
  color: #fff;
}

/* Banner区域 */
.hj-banner-container {
  position: relative;
  width: 100%;
  margin-bottom: 40px;
}

.hj-banner-wrapper {
  position: relative;
  overflow: hidden;
  height: 460px;
}

.hj-banner-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

.hj-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hj-banner-content {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  max-width: 500px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hj-banner-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 15px;
}

.hj-banner-subtitle {
  font-size: 24px;
  margin-bottom: 30px;
}

.hj-banner-btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 18px;
  font-weight: 600;
  background-color: var(--hj-primary);
  color: #fff;
  border-radius: 30px;
  transition: var(--hj-transition);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

.hj-banner-btn:hover {
  background-color: #ff8124;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(255, 106, 0, 0.4);
}

/* 服务优势模块 */
.hj-services {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  background-color: #fff;
  border-radius: var(--hj-radius);
  margin: -40px auto 0;
  width: 90%;
  max-width: 1280px;
  box-shadow: var(--hj-shadow);
  position: relative;
  z-index: 10;
  padding: 20px 30px;
}

.hj-service-item {
  display: flex;
  align-items: center;
  padding: 15px;
  flex: 1;
  min-width: 200px;
}

.hj-service-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hj-primary);
  position: relative;
  background-color: rgba(255, 106, 0, 0.1);
  overflow: hidden;
}

.hj-service-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.hj-service-info h3 {
  font-size: 16px;
  margin-bottom: 5px;
  color: var(--hj-dark);
}

.hj-service-info p {
  font-size: 14px;
  color: var(--hj-text-light);
}

/* 特惠区域样式 */
.hj-featured {
  background-color: #fff;
  border-radius: var(--hj-radius);
  padding: 30px;
  box-shadow: var(--hj-shadow);
}

.hj-countdown {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--hj-text-light);
}

.hj-timer {
  margin-left: 10px;
  background-color: var(--hj-secondary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hj-products-slider {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* 产品卡片样式 */
.hj-product-card {
  background-color: #fff;
  border-radius: var(--hj-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--hj-transition);
  position: relative;
}

.hj-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.hj-product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--hj-primary);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 3px;
  z-index: 10;
}

.hj-product-img-container {
  height: 200px;
  overflow: hidden;
  position: relative;
}

/* 新品推荐模块的图片容器特殊样式 */
.hj-new-arrivals .hj-product-img-container {
  height: 240px;
  width: 100%;
  padding-top: 100%; /* 创建1:1的正方形比例 */
  position: relative;
  overflow: hidden;
}

.hj-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* 新品推荐模块的图片特殊样式 */
.hj-new-arrivals .hj-product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 保持图片原始比例，确保完整显示图片 */
  padding: 10px; /* 添加内边距，避免图片紧贴边缘 */
  background-color: #fff; /* 确保背景是白色 */
}

.hj-product-card:hover .hj-product-img {
  transform: scale(1.05);
}

.hj-product-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--hj-transition);
}

.hj-product-hover span {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #fff;
  border-radius: 4px;
}

.hj-product-card:hover .hj-product-hover {
  opacity: 1;
}

.hj-product-info {
  padding: 15px;
}

.hj-product-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hj-product-shop {
  font-size: 12px;
  color: var(--hj-text-light);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hj-product-price-box {
  display: flex;
  align-items: center;
}

.hj-product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--hj-primary);
  margin-right: 8px;
}

.hj-product-market-price {
  font-size: 12px;
  color: var(--hj-text-light);
  text-decoration: line-through;
}

.hj-product-btn {
  margin-top: 10px;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  background-color: var(--hj-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: var(--hj-transition);
}

.hj-product-btn:hover {
  background-color: #ff8124;
}

/* 分类标签页 */
.hj-category-tabs {
  background-color: #fff;
  border-radius: var(--hj-radius);
  padding: 30px;
  box-shadow: var(--hj-shadow);
  margin-bottom: 50px;
}

.hj-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--hj-border);
  margin-bottom: 30px;
}

.hj-tab-item {
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 500;
  color: var(--hj-text);
  cursor: pointer;
  position: relative;
  transition: var(--hj-transition);
}

.hj-tab-item.hj-active {
  color: var(--hj-primary);
}

.hj-tab-item.hj-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--hj-primary);
}

.hj-tab-content {
  display: none;
}

.hj-tab-content.hj-active {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
}

.hj-tab-intro {
  padding: 20px;
  background-color: var(--hj-light);
  border-radius: var(--hj-radius);
  height: fit-content;
}

.hj-tab-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--hj-secondary);
}

.hj-tab-desc {
  font-size: 14px;
  color: var(--hj-text-light);
  margin-bottom: 20px;
}

.hj-tab-more {
  display: inline-block;
  padding: 8px 20px;
  background-color: var(--hj-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: var(--hj-transition);
}

.hj-tab-more:hover {
  background-color: #ff8124;
}

.hj-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* 品牌展示 */
.hj-brands {
  margin-bottom: 50px;
}

.hj-brands-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.hj-brand-card {
  background-color: #fff;
  border-radius: var(--hj-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--hj-transition);
  padding: 20px;
  text-align: center;
}

.hj-brand-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.hj-brand-img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
}

.hj-brand-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--hj-text);
  margin-bottom: 5px;
}

.hj-brand-desc {
  font-size: 12px;
  color: var(--hj-text-light);
}

/* 新品推荐 */
.hj-new-arrivals {
  background-color: #fff;
  border-radius: var(--hj-radius);
  padding: 30px;
  box-shadow: var(--hj-shadow);
  margin-bottom: 50px;
}

/* 响应式布局 */
@media (max-width: 1200px) {
  .hj-products-slider,
  .hj-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hj-brands-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .hj-container {
    width: 95%;
  }
  
  .hj-tab-content.hj-active {
    grid-template-columns: 1fr;
  }
  
  .hj-tab-intro {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .hj-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hj-section-title-wrap {
    margin-bottom: 10px;
  }
  
  .hj-products-slider,
  .hj-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hj-brands-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hj-tabs-header {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .hj-tab-item {
    padding: 10px 15px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .hj-featured,
  .hj-category-tabs,
  .hj-new-arrivals {
    padding: 15px;
  }
  
  .hj-products-slider,
  .hj-products-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .hj-brands-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hj-product-img-container {
    height: 180px;
  }
}

/* FontAwesome图标替换 */
.hj-icon-quality:before, 
.hj-icon-shipping:before, 
.hj-icon-price:before, 
.hj-icon-service:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 20px;
}

.hj-icon-quality:before {
  content: "\f14a"; /* 对勾方框 */
}

.hj-icon-shipping:before {
  content: "\f48b"; /* 快递卡车 */
}

.hj-icon-price:before {
  content: "\f155"; /* 货币符号 */
}

.hj-icon-service:before {
  content: "\f095"; /* 电话 */
}

/* JavaScript功能脚本 */
document.addEventListener('DOMContentLoaded', function() {
  // 标签页切换
  const tabItems = document.querySelectorAll('.hj-tab-item');
  if(tabItems.length > 0) {
    tabItems.forEach(tab => {
      tab.addEventListener('click', function() {
        // 移除所有标签页活跃状态
        tabItems.forEach(t => t.classList.remove('hj-active'));
        // 移除所有内容区活跃状态
        document.querySelectorAll('.hj-tab-content').forEach(c => c.classList.remove('hj-active'));
        
        // 为当前标签添加活跃状态
        this.classList.add('hj-active');
        // 显示对应内容区
        const target = this.getAttribute('data-target');
        document.getElementById(target).classList.add('hj-active');
      });
    });
  }
  
  // 倒计时功能
  function updateCountdown() {
    const hoursEl = document.getElementById('hours');
    const minutesEl = document.getElementById('minutes');
    const secondsEl = document.getElementById('seconds');
    
    if(hoursEl && minutesEl && secondsEl) {
      let hours = parseInt(hoursEl.textContent);
      let minutes = parseInt(minutesEl.textContent);
      let seconds = parseInt(secondsEl.textContent);
      
      seconds--;
      
      if(seconds < 0) {
        seconds = 59;
        minutes--;
      }
      
      if(minutes < 0) {
        minutes = 59;
        hours--;
      }
      
      if(hours < 0) {
        hours = 24;
      }
      
      hoursEl.textContent = hours.toString().padStart(2, '0');
      minutesEl.textContent = minutes.toString().padStart(2, '0');
      secondsEl.textContent = seconds.toString().padStart(2, '0');
    }
  }
  
  // 每秒更新倒计时
  setInterval(updateCountdown, 1000);
  
  // 返回顶部按钮
  const backTopBtn = document.querySelector('.hj-back-top');
  if(backTopBtn) {
    window.addEventListener('scroll', function() {
      if(window.scrollY > 300) {
        backTopBtn.classList.add('hj-visible');
      } else {
        backTopBtn.classList.remove('hj-visible');
      }
    });
    
    backTopBtn.addEventListener('click', function() {
      window.scrollTo({
        top: 0,
        behavior: 'smooth'
      });
    });
  }
}); 