/*
Theme Name: 佳诚贸易
Theme URI: https://jiacheng-trade.com
Author: 佳诚贸易有限公司
Author URI: https://jiacheng-trade.com
Description: 佳诚贸易有限公司官方主题 — 简约大气运动鞋商城风格。支持 WooCommerce，响应式设计，移动端优化。
Version: 1.0.1
License: GPL v3
Text Domain: jiacheng
*/

/* === DESIGN TOKENS === */
:root {
  --color-black: #0A0A0A;
  --color-white: #FFFFFF;
  --color-accent: #FF5A1F;
  --color-accent-hover: #E04D14;
  --color-text: #1A1A1A;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-border: #E5E5E5;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F7F7;
  --color-bg-dark: #0A0A0A;
  --color-success: #10B981;
  --color-error: #EF4444;

  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --max-width: 1280px;
  --header-height: 72px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-accent); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { margin-bottom: 12px; }
.section-title p { color: var(--color-text-secondary); font-size: 1.1rem; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 36px; font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition-fast); text-transform: uppercase;
}
.btn-primary { background: var(--color-accent); color: var(--color-white); }
.btn-primary:hover { background: var(--color-accent-hover); color: var(--color-white); }
.btn-outline { background: transparent; color: var(--color-white); border: 1.5px solid rgba(255,255,255,0.5); }
.btn-outline:hover { border-color: var(--color-white); color: var(--color-white); }
.btn-dark { background: var(--color-black); color: var(--color-white); }
.btn-dark:hover { background: #333; color: var(--color-white); }
.btn-lg { padding: 18px 48px; font-size: 1rem; }

/* === HEADER === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-height); background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent; transition: all var(--transition-base);
}
.site-header.scrolled { border-bottom-color: var(--color-border); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px; height: 100%;
}
.custom-logo-link { display: flex; align-items: center; }
.custom-logo-link img { height: 36px; width: auto; }

/* === LANGUAGE SWITCHER === */
.lang-switcher { display: flex; align-items: center; gap: 4px; margin-right: 8px; }
.lang-switcher .lang-item { display: inline-flex; align-items: center; }
.lang-switcher .lang-item a {
  display: inline-block; padding: 4px 10px; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; border-radius: var(--radius-sm);
  color: var(--color-text-light); transition: all var(--transition-fast);
}
.lang-switcher .lang-item a:hover { color: var(--color-text); background: var(--color-bg-alt); }
.lang-switcher .lang-item.current-lang a { color: var(--color-accent); background: rgba(255,90,31,0.08); }
.site-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--color-black); }
.site-logo span { color: var(--color-accent); }
.main-nav { display: flex; align-items: center; gap: 40px; }
.main-nav a { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--color-text); position: relative; }
.main-nav a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--color-accent); transition: width var(--transition-fast);
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions .cart-count {
  background: var(--color-accent); color: white; font-size: 0.6875rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  position: absolute; top: -8px; right: -10px;
}
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: var(--color-black); margin: 5px 0; transition: var(--transition-fast); }

/* === HERO === */
.hero {
  min-height: 90vh; display: flex; align-items: center; position: relative;
  background: var(--color-bg-dark); overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; opacity: 0.6; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,0.3) 0%, rgba(10,10,10,0.7) 100%); }
.hero-content { position: relative; z-index: 1; max-width: 720px; padding: 120px 24px 80px; }
.hero-content h1 { color: var(--color-white); margin-bottom: 20px; font-weight: 800; }
.hero-content p { color: rgba(255,255,255,0.8); font-size: 1.25rem; margin-bottom: 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* === PRODUCT GRID === */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-card { position: relative; }
.product-card-image {
  position: relative; overflow: hidden; aspect-ratio: 1; background: var(--color-bg-alt);
  border-radius: var(--radius-md); margin-bottom: 16px;
}
.product-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition-slow);
}
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-overlay {
  position: absolute; inset: 0; background: rgba(10,10,10,0.2);
  opacity: 0; transition: opacity var(--transition-base);
  display: flex; align-items: center; justify-content: center;
}
.product-card:hover .product-card-overlay { opacity: 1; }
.product-card-overlay .btn { padding: 12px 28px; font-size: 0.8125rem; }
.product-card-tag {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: var(--color-accent); color: var(--color-white); font-size: 0.6875rem;
  font-weight: 700; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}
.product-card-info { padding: 0 4px; }
.product-card-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.product-card-info .price { font-weight: 700; font-size: 1.0625rem; color: var(--color-accent); }
.product-card-info .price del { color: var(--color-text-light); font-weight: 400; font-size: 0.875rem; margin-left: 8px; }

/* === SECTIONS === */
.section { padding: 100px 0; }
.section-alt { background: var(--color-bg-alt); }

/* === FEATURES BAR === */
.features-bar { border-bottom: 1px solid var(--color-border); padding: 24px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; text-align: center; }
.feature-item i { font-size: 1.5rem; color: var(--color-accent); margin-bottom: 8px; }
.feature-item h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 4px; }
.feature-item p { font-size: 0.8125rem; color: var(--color-text-secondary); }

/* === STORY SECTION === */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.story-image { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/3; }
.story-image img { width: 100%; height: 100%; object-fit: cover; }
.story-text h2 { margin-bottom: 24px; }
.story-text p { color: var(--color-text-secondary); font-size: 1.0625rem; line-height: 1.8; margin-bottom: 16px; }
.story-text .btn { margin-top: 16px; }

/* === CTA BANNER === */
.cta-banner {
  background: var(--color-accent); color: var(--color-white);
  padding: 80px 24px; text-align: center;
}
.cta-banner h2 { margin-bottom: 12px; }
.cta-banner p { font-size: 1.125rem; opacity: 0.9; margin-bottom: 32px; }
.cta-banner .btn { background: var(--color-white); color: var(--color-accent); }
.cta-banner .btn:hover { background: var(--color-black); color: var(--color-white); }

/* === FOOTER === */
.site-footer { background: var(--color-bg-dark); color: rgba(255,255,255,0.7); padding: 80px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 64px; }
.footer-brand .site-logo { color: var(--color-white); font-size: 1.5rem; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 0.9375rem; line-height: 1.7; }
.footer-col h4 { color: var(--color-white); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 20px; font-weight: 700; }
.footer-col a { display: block; font-size: 0.9375rem; margin-bottom: 10px; color: rgba(255,255,255,0.6); transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--color-white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; }

/* === PAGE HEADER === */
.page-header { background: var(--color-bg-alt); padding: 120px 0 60px; text-align: center; margin-top: var(--header-height); }
.page-header h1 { margin-bottom: 8px; }
.page-header p { color: var(--color-text-secondary); }

/* === BLOG === */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.post-card { border-radius: var(--radius-md); overflow: hidden; transition: transform var(--transition-base); }
.post-card:hover { transform: translateY(-4px); }
.post-card-image { aspect-ratio: 16/10; overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-body { padding: 20px 0; }
.post-card-body .date { font-size: 0.8125rem; color: var(--color-text-light); margin-bottom: 8px; }
.post-card-body h3 { font-size: 1.125rem; margin-bottom: 8px; }

/* === WOOCOMMERCE === */
.woocommerce .products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.woocommerce .product { position: relative; }
.woocommerce .product .onsale {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: var(--color-accent); color: var(--color-white); font-size: 0.6875rem;
  font-weight: 700; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-sm);
}
.woo-sidebar-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; margin-top: 40px; }

/* === SINGLE PRODUCT === */
.single-product .product { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.single-product .product_title { font-size: 2rem; margin-bottom: 12px; }
.single-product .price { font-size: 1.5rem; font-weight: 700; color: var(--color-accent); margin-bottom: 24px; }
.single-product .cart { display: flex; gap: 12px; margin-bottom: 24px; }
.single-product .quantity input { width: 70px; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); text-align: center; }
.single-product .single_add_to_cart_button {
  flex: 1; background: var(--color-accent); color: var(--color-white);
  font-weight: 700; text-transform: uppercase; padding: 12px 32px;
  border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.single-product .single_add_to_cart_button:hover { background: var(--color-accent-hover); }
.woocommerce-tabs { margin-top: 60px; }
.woocommerce-tabs .tabs { display: flex; gap: 0; border-bottom: 1px solid var(--color-border); margin-bottom: 32px; }
.woocommerce-tabs .tabs li { margin: 0; }
.woocommerce-tabs .tabs li a {
  display: block; padding: 12px 24px; font-weight: 600; font-size: 0.9375rem;
  color: var(--color-text-secondary); border-bottom: 2px solid transparent;
}
.woocommerce-tabs .tabs li.active a { color: var(--color-text); border-bottom-color: var(--color-accent); }

/* === CART PAGE === */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 12px; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border); }
.cart-table td { padding: 20px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.cart-table .product-thumbnail img { width: 80px; border-radius: var(--radius-sm); }
.cart-actions { display: flex; justify-content: space-between; margin-top: 32px; }
.cart-totals { background: var(--color-bg-alt); padding: 32px; border-radius: var(--radius-md); margin-top: 32px; }
.cart-totals h2 { margin-bottom: 20px; }
.checkout-button {
  display: block; width: 100%; text-align: center; background: var(--color-accent); color: var(--color-white);
  font-weight: 700; text-transform: uppercase; padding: 16px; border-radius: var(--radius-sm);
  font-size: 1rem; letter-spacing: 0.02em; margin-top: 16px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .product-grid, .woocommerce .products { grid-template-columns: repeat(3, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .story-grid { gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .single-product .product { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  :root { --header-height: 60px; }
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--color-white); padding: 24px; gap: 20px; border-bottom: 1px solid var(--color-border); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
  .mobile-menu-btn { display: block; }
  .hero-content { padding: 100px 24px 60px; }
  .product-grid, .woocommerce .products { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .post-grid { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .section { padding: 60px 0; }
  .woo-sidebar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .product-grid, .woocommerce .products { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
}

/* === 2026-08-30 产品卡片标题字号修正 ===
   全局 h2 为区块大标题字号(clamp 最大48px)，产品卡片标题是 h2，
   会被错误继承导致 48px 爆大。此规则覆写为卡片字号。 */
.woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
  font-size: 1rem !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;
}
