/* ===== 懿泉茶业 全局样式 ===== */
/* 暖色国风配色 移动端优先 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  background-color: #FBF7F0;
  color: #4A2C2A;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #B8860B;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== 顶部导航 ===== */
.header {
  background: #4A2C2A;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header a {
  color: #fff;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

/* ===== 门头图 ===== */
.hero-image {
  width: 100%;
  display: block;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== 产品列表区 ===== */
.products-section {
  padding: 16px;
}

.products-section h2 {
  font-size: 20px;
  color: #4A2C2A;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
}

.products-section h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: #B8860B;
  margin: 8px auto 0;
}

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

/* ===== 产品卡片 ===== */
.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.product-card img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-card .card-info {
  padding: 10px 12px;
}

.product-card .card-name {
  font-size: 14px;
  color: #4A2C2A;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-price {
  font-size: 16px;
  color: #B8860B;
  font-weight: bold;
  margin-top: 6px;
}

/* ===== 产品详情页 ===== */
.back-link {
  display: inline-block;
  padding: 10px 16px;
  color: #B8860B;
  font-size: 16px;
}

/* 轮播图 */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f0e8d8;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4c4a8;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-dot.active {
  background: #B8860B;
  width: 20px;
  border-radius: 4px;
}

/* 产品详情信息 */
.product-detail-info {
  padding: 16px;
}

.product-detail-name {
  font-size: 22px;
  color: #4A2C2A;
  font-weight: bold;
  margin-bottom: 8px;
}

.product-detail-price {
  font-size: 24px;
  color: #B8860B;
  font-weight: bold;
  margin-bottom: 8px;
}

.product-detail-spec {
  font-size: 14px;
  color: #8B7355;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #FBF7F0;
  border-radius: 6px;
  display: inline-block;
}

.product-detail-desc {
  font-size: 15px;
  color: #4A2C2A;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* 联系区 */
.contact-bar {
  display: flex;
  gap: 12px;
  padding: 16px;
  position: sticky;
  bottom: 0;
  background: #FBF7F0;
  border-top: 1px solid #e8dcc8;
}

.contact-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.contact-btn.wechat {
  background: #07C160;
  color: #fff;
}

.contact-btn.phone {
  background: #B8860B;
  color: #fff;
}

/* ===== 微信弹窗 ===== */
.wechat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.wechat-popup {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
}

.wechat-popup img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}

.wechat-popup p {
  font-size: 14px;
  color: #4A2C2A;
  margin-bottom: 12px;
}

.wechat-popup .close-btn {
  padding: 8px 24px;
  background: #B8860B;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* ===== 加载提示 ===== */
.loading {
  text-align: center;
  padding: 40px 16px;
  font-size: 16px;
  color: #8B7355;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: #8B7355;
  border-top: 1px solid #e8dcc8;
  margin-top: 24px;
}

/* ===== 按钮通用样式 ===== */
.btn {
  padding: 10px 24px;
  background: #B8860B;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

/* ===== 表单通用 ===== */
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d4c4a8;
  border-radius: 6px;
  font-size: 15px;
  background: #fff;
  color: #4A2C2A;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #B8860B;
}

/* ===== 错误/空状态 ===== */
.not-found {
  text-align: center;
  padding: 60px 16px;
  font-size: 16px;
  color: #8B7355;
}

/* ========== 桌面端适配 ========== */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
  }

  .product-card .card-name {
    font-size: 15px;
  }

  .product-detail-info,
  .carousel,
  .contact-bar,
  .back-link {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  .carousel {
    border-radius: 8px;
    margin-top: 8px;
  }

  .carousel-slide img {
    aspect-ratio: 4 / 3;
  }

  .footer {
    max-width: 1200px;
    margin: 24px auto 0;
  }
}
