/*
Theme Name: NOVATECH
Theme URI: https://yourbrand.com
Author: NOVATECH
Description: Custom theme for NOVATECH B2C cross-border e-commerce store (headphones, mobile & 3C accessories). Built for WooCommerce, SEO-friendly, responsive from 375px. Replace brand placeholders before going live.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: novatech
Tags: e-commerce, woocommerce, responsive, blog, custom-logo
*/

/* ============ 品牌视觉变量 ============ */
:root {
  --ink: #0B2545;        /* 深墨蓝：主色 */
  --accent: #1B6FD8;     /* 电光蓝：强调色 */
  --accent-soft: #E8F1FD;
  --bg: #FFFFFF;
  --bg-soft: #F5F8FC;
  --line: #E5EAF1;
  --ink-2: #4A5568;
  --ink-3: #7A8699;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============ 基础 ============ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ============ 顶部栏 ============ */
.site-topbar {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 8px 0;
}
.site-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.site-topbar .topbar-free-ship { opacity: .85; }

/* ============ 头部导航 ============ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}
.site-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: .5px;
}
.site-brand span { color: var(--accent); }
.main-nav { display: flex; gap: 22px; }
.main-nav a {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-cart {
  position: relative;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-toggle {
  display: inline-flex;
  background: none;
  border: 0;
  font-size: 24px;
  color: var(--ink);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 16px 14px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 10px 0; font-size: 15px; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, var(--ink) 0%, #123a6e 100%);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}
.hero h1 { font-size: 2rem; margin: 0 0 12px; }
.hero p { font-size: 1.05rem; opacity: .9; max-width: 640px; margin: 0 auto 24px; }

/* ============ 区块 ============ */
.section { padding: 44px 0; }
.section-title { font-size: 1.5rem; margin: 0 0 22px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.section-head .section-title { margin: 0; }

/* ============ 产品网格（WooCommerce） ============ */
ul.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
li.product {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s;
}
li.product:hover { box-shadow: 0 6px 18px rgba(11,37,69,.08); }
li.product a { color: var(--ink); }
li.product a:hover { text-decoration: none; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px 2px;
  color: var(--ink);
}
.woocommerce ul.products li.product .price {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  padding: 0 14px 12px;
}
.woocommerce ul.products li.product .button {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  padding: 8px 14px;
  margin: 0 14px 14px;
}
.woocommerce ul.products li.product .button:hover { background: var(--ink); }
.woocommerce ul.products li.product .star-rating { margin: 0 14px 6px; }

/* ============ 通用按钮 ============ */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--ink); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.7);
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }

/* ============ 博客 ============ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
}
.post-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.post-card h3 a { color: var(--ink); }
.post-card .post-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }

/* ============ 订阅 ============ */
.newsletter {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.newsletter h3 { margin: 0 0 8px; }
.newsletter form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 18px auto 0;
}
.newsletter input[type=email] {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}
.newsletter .btn { min-height: 44px; }

/* ============ 页脚 ============ */
.site-footer {
  background: var(--ink);
  color: #c8d3e0;
  padding: 40px 0 0;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: 28px;
}
.footer-col h4 { color: #fff; margin: 0 0 12px; font-size: 15px; }
.footer-col a { display: block; color: #c8d3e0; margin-bottom: 8px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============ 内容区（文章/页面） ============ */
.page-content, .single-content { max-width: 780px; }
.entry-content img { border-radius: var(--radius); }
.entry-content h2 { margin-top: 2rem; }

/* ============ 响应式 ============ */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  ul.products { grid-template-columns: repeat(3, 1fr); }
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 2.6rem; }
}
@media (min-width: 1024px) {
  ul.products { grid-template-columns: repeat(4, 1fr); }
}

/* ============ WooCommerce 商店页微调 ============ */
.woocommerce .woocommerce-breadcrumb { color: var(--ink-3); font-size: 14px; }
.woocommerce .woocommerce-ordering select,
.woocommerce .woocommerce-result-count { font-size: 14px; }
.woocommerce div.product .product_title { font-size: 1.7rem; }
.woocommerce div.product p.price { color: var(--ink); font-weight: 700; font-size: 1.4rem; }
.woocommerce div.product .single_add_to_cart_button {
  background: var(--accent);
  border-radius: 8px;
}
.woocommerce div.product .single_add_to_cart_button:hover { background: var(--ink); }
.woocommerce .woocommerce-message { border-top-color: var(--accent); }
