/* 全局样式 */
body {
  font-family: 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f8f8;
  color: #333;
  line-height: 1.6;
}

h1, h2, h3 {
  margin: 0;
}

/* 頂部導航欄 */
.navbar {
  background-color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-logo h1 {
  font-size: 26px;
  font-weight: bold;
  color: #333;
}

.navbar-links {
  display: flex;
}

.menu-btn {
  background-color: transparent;
  border: none;
  margin-left: 30px;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
}

.menu-btn:hover {
  color: #ff4c4c;
}

.search-box {
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  margin-right: 5px;
}

.search-box button {
  padding: 8px;
  background-color: #ff4c4c;
  border: none;
  border-radius: 20px;
  cursor: pointer;
}

.search-box button i {
  color: white;
}

/* 商品分類區域 */
.category {
  padding: 40px 20px;
  text-align: center;
  background-color: #fff;
}

.category h2 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 30px;
}

.category-list {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  flex-wrap: wrap;
}

.category-item {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  width: 45%; /* 在小屏幕时自动换行 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.category-item h3 {
  font-size: 18px;
  margin: 0;
  font-weight: bold;
}

.category-item p {
  font-size: 14px;
  color: #666;
}

/* 促銷區域 */
.promotion {
  padding: 50px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.promo-banner {
  background: linear-gradient(45deg, #ff4c4c, #ff9a8b); /* 渐变背景 */
  color: white;
  padding: 50px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
  animation: slideIn 1s ease-out forwards; /* 文字滑入动画 */
}

.promo-banner h3 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 15px;
  letter-spacing: 2px;
  animation: fadeIn 1.5s ease-out forwards; /* 渐变文字效果 */
}

.promo-banner p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.8;
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(45deg, #ff4c4c, #ff9a8b); /* 渐变背景 */
  color: white;
  padding: 12px 30px;
  font-size: 1.2rem;
  border-radius: 30px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: scale(1.05); /* 按钮放大效果 */
  background: linear-gradient(45deg, #ff9a8b, #ff4c4c); /* 鼠标悬停时的渐变 */
}

.btn-primary:active {
  transform: scale(0.98); /* 点击时缩小效果 */
}

/* 文字渐变效果 */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 促销横幅文字滑入效果 */
@keyframes slideIn {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}


/* 最優惠商品展示區 */
.best-price {
  padding: 40px 20px;
  background-color: #fff;
  text-align: center;
}

.best-price h2 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 30px;
}

.product-list {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  flex-wrap: wrap;
}

.product-item {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  width: 45%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin-bottom: 10px;
}

.product-item h3 {
  font-size: 18px;
  margin: 0;
  font-weight: bold;
}

.product-item p {
  font-size: 14px;
  color: #666;
}

/* 底部導航欄 */
.bottom-nav {
  background-color: #fff;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #ddd;
}

.bottom-nav button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  transition: color 0.3s;
}

.bottom-nav button:hover {
  color: #ff4c4c;
}

/* ================== 响应式设计 ================== */

/* 手机设备（最大宽度 768px） */
@media (max-width: 768px) {

  .navbar-links.active {
    display: flex;
  }

  .hamburger-menu {
    display: block;
  }

  .category-item {
    width: 100%;
  }

  .product-item {
    width: 100%;
  }

  .product-item img {
    height: 120px;
  }
}

/* 平板设备（最大宽度 1024px） */
@media (max-width: 1024px) {
  .category-item {
    width: 48%;
  }

  .product-item {
    width: 48%;
  }
}
/* 页脚样式 */
.footer {
  background-color: #f9f9f9;
  padding: 40px 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
  border-top: 1px solid #ddd;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links li {
  display: inline-block;
}

.footer-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #ff4c4c;
}

.footer-info p {
  margin: 5px 0;
}

.footer-info a {
  color: #333;
  text-decoration: none;
}

.footer-info a:hover {
  color: #ff4c4c;
}

/* 响应式设计 - 在手机设备下优化页脚 */
@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  .footer-info p {
    font-size: 12px;
  }
}
/* 商品展示区样式 */
.best-price {
  padding: 40px 20px;
  background-color: #fff;
  text-align: center;
  margin-top: 20px;
}

.best-price h2 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 30px;
}

.product-list {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  flex-wrap: wrap;
}

.product-item {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  width: 45%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin-bottom: 10px;
}

.product-item h3 {
  font-size: 16px;
  margin: 0;
  font-weight: bold;
}

.product-item p {
  font-size: 14px;
  color: #666;
}

/* 立即購買按钮样式 */
.btn-buy {
  background-color: #ff4c4c;
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 16px;
  border: none;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s;
}

.btn-buy:hover {
  background-color: #e43e3e;
}
