/* ============================================
   瞳泽行 - 纯静态产品展示网站样式
   现代简约电商风格 | 浅白底色 | 低饱和度辅助色
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --bg-primary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-light: #f0f0f0;
  --border-medium: #e5e5e5;
  --accent: #4ECDC4;
  --accent-hover: #3BA99E;
  --accent-light: #f0faf9;
  --whatsapp: #25D366;
  --whatsapp-hover: #1DA851;
  --price-color: #e85d3c;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --nav-height: 64px;
  --container-max: 1280px;
}

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input {
  font-family: inherit;
  outline: none;
}

/* ---------- 通用容器 ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(10px);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  white-space: nowrap;
}

.logo::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.nav-menu {
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-contact {
  font-size: 14px;
  color: var(--accent);
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-contact:hover {
  background: var(--accent);
  color: #fff;
}

.nav-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  border-color: var(--whatsapp);
}

.nav-whatsapp:hover {
  background: var(--whatsapp-hover);
  border-color: var(--whatsapp-hover);
  color: #fff;
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: 0.2s;
}

/* ---------- Hero 首屏 ---------- */
.hero {
  padding: calc(var(--nav-height) + 80px) 24px 70px;
  text-align: center;
  background: linear-gradient(180deg, #fafbfb 0%, var(--bg-primary) 100%);
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
}

.search-input {
  flex: 1;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--border-medium);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.2s;
}

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

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  height: 46px;
  padding: 0 28px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--accent-hover);
}

/* ---------- 商品列表区域 ---------- */
.products-section {
  padding: 50px 0 80px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 32px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ---------- 商品卡片 ---------- */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f8f8;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.card-tag {
  font-size: 11px;
  color: var(--accent-hover);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.card-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--price-color);
}

.card-price .currency {
  font-size: 13px;
  font-weight: 500;
  margin-right: 1px;
}

.card-stock {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-stock.in-stock {
  color: var(--accent-hover);
}

.card-stock.low-stock {
  color: #e8a33c;
}

.card-stock.out-of-stock {
  color: #ccc;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ---------- 详情页 ---------- */
.product-detail {
  padding: calc(var(--nav-height) + 30px) 0 60px;
  min-height: calc(100vh - var(--nav-height));
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  color: var(--text-primary);
}

/* 左右分栏 */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

/* 图片画廊 */
.product-gallery {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
}

.main-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f8f8f8;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.thumbnail {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #f8f8f8;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail.active {
  border-color: var(--accent);
}

.thumbnail:hover {
  border-color: var(--border-medium);
}

.thumbnail.active:hover {
  border-color: var(--accent);
}

/* 商品信息 */
.product-info {
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 14px;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.product-tag {
  font-size: 12px;
  color: var(--accent-hover);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 6px;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 24px;
  background: #fafafa;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.product-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--price-color);
}

.product-price .currency {
  font-size: 18px;
  font-weight: 500;
}

.product-stock {
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 6px;
}

.product-stock.in-stock {
  color: var(--accent-hover);
  background: var(--accent-light);
}

.product-stock.low-stock {
  color: #b8860b;
  background: #fef8e8;
}

.product-stock.out-of-stock {
  color: #999;
  background: #f0f0f0;
}

.product-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

.product-spec {
  margin-bottom: 32px;
}

.spec-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 14px;
}

.spec-label {
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.spec-value {
  color: var(--text-primary);
  flex: 1;
}

/* 按钮 */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  background: var(--whatsapp);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  transition: background 0.2s;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
}

.whatsapp-icon {
  font-size: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 详情卡片 */
.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 32px;
  margin-bottom: 24px;
}

.detail-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.detail-card-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 2;
}

.detail-card-body p {
  margin-bottom: 12px;
}

.detail-card-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

/* 规格参数表 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spec-table tr {
  border-bottom: 1px solid var(--border-light);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table td {
  padding: 14px 12px;
}

.spec-table td:first-child {
  color: var(--text-muted);
  width: 140px;
  background: #fafafa;
}

.spec-table td:last-child {
  color: var(--text-primary);
}

/* ---------- 页脚 ---------- */
.footer {
  background: #fafafa;
  border-top: 1px solid var(--border-light);
  padding: 48px 0 24px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-brand h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-contact p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-contact a {
  color: var(--accent);
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-notice {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  opacity: 0.8;
}

/* ---------- 加载状态 ---------- */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- 响应式：平板 ---------- */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* ---------- 响应式：PC 小屏 ---------- */
@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- 响应式：PC 大屏 ---------- */
@media (min-width: 1280px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ---------- 响应式：手机端详情页上下堆叠 ---------- */
@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-gallery {
    position: static;
  }
}

/* ---------- 响应式：手机端导航 ---------- */
@media (max-width: 640px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu .nav-link {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .nav-menu .nav-link:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-contact {
    padding: 6px 12px;
    font-size: 12px;
  }

  .hero {
    padding: calc(var(--nav-height) + 50px) 20px 50px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 28px;
  }

  .hero-search {
    flex-direction: column;
    gap: 10px;
  }

  .search-input {
    border-right: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
  }

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

  .search-btn {
    border-radius: var(--radius-sm);
  }

  .products-section {
    padding: 30px 0 50px;
  }

  .section-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .products-grid {
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-summary {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .card-price {
    font-size: 17px;
  }

  .product-detail {
    padding: calc(var(--nav-height) + 20px) 0 40px;
  }

  .product-title {
    font-size: 22px;
  }

  .product-price {
    font-size: 28px;
  }

  .detail-card {
    padding: 20px;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}
