/* 设置全局样式 */
:root {
  --primary-color: #AAD4EE;
  --secondary-color: #008FD7;
  --background-color: linear-gradient(135deg, #AAD4EE, #008FD7);
  --text-color: #333;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --border-radius: 10px;
  --max-width: 1500px;
}

/* 全局 body 样式 */
body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  scroll-behavior: smooth;
  background: var(--background-color);
}

/* 设置滚动时的顶部填充 */
html {
  scroll-padding-top: 170px;
}

/* 超链接样式 */
a {
  text-decoration: none;
  color: inherit;
}

/* 图片样式 */
img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: var(--border-radius);
}

/* 导航图片样式 */
.navbar {
    width: 100%; /* 宽度占满父容器 */
    max-width: 1465px; /* 最大宽度限制 */
    height: 80px; /* 默认高度 */
    display: flex;
    align-items: center;
    padding-left: 35px; /* 调整文字位置 */
    overflow: hidden; /* 裁剪超出容器的内容 */
    position: relative; /* 为子元素定位提供参考 */
}

.navbar-image {
    width: 100%; /* 图片宽度占满容器 */
    height: 100%; /* 图片高度占满容器 */
    object-fit: cover; /* 保持图片比例，覆盖整个容器 */
    position: absolute; /* 使图片脱离文档流 */
    top: 0;
    left: 0;
    z-index: -1; /* 将图片置于文字下方 */
}

.navbar h1 {
    color: white; /* 根据背景调整文字颜色 */
    font-size: 20px;
    font-weight: bold;
    position: relative; /* 确保文字在图片上方 */
    z-index: 1; /* 确保文字在图片上方 */
}
/* 容器样式 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 文本框样式 */
.text-box {
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  margin-bottom: 15px;
}

/* 产品网格样式 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* 产品卡片样式 */
.product-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.product-card h3 {
  margin: 15px 0 10px;
}

.product-card p {
  font-size: 14px;
  color: #666;
}

.product-card .price {
  font-weight: bold;
  color: var(--secondary-color);
  margin-top: 10px;
}

/* 店铺区域样式 */
.shop-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* 店铺链接样式 */
.shopping-platforms {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* 图片浮动样式 */
.image-float {
  width: 250px;
  height: auto;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
}

.image-left {
  float: left;
  margin-right: 15px;
}

.image-right {
  float: right;
  margin-left: 15px;
}

/* 头部样式 */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header img {
  width: 280px;
  transform: translateY(10px);
  margin-bottom: 10px;
}

header nav {
  display: flex; /* 电脑端显示导航条 */
  gap: 20px;
}

header nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 16px;
}

.hamburger {
  display: none; /* 电脑端隐藏汉堡菜单 */
}

/* 购物车和 BPOM 图片的容器 */
.shopping-section {
  display: flex;
  justify-content: space-between;
  height: auto;
  position: relative;
}

/* BPOM 图片样式 */
.bpom-image img {
  height: auto;
margin-left: auto; 
margin-right: auto;
  position: relative;
}

/* 导航栏样式 */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 5px;
  padding: 5px 0;
}

nav a {
  margin: 0 5px;
  padding: 8px 10px;
  color: #444;
  font-weight: bold;
  text-transform: uppercase;
  transition: var(--transition);
  border-radius: 5px;
}

nav a:hover {
  background: var(--secondary-color);
  color: white;
  box-shadow: var(--shadow);
}

/* 轮播图容器 */
.carousel {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  height: 70vh; /* 使用视口高度单位 */
  min-height: 200px; /* 最小高度 */
  max-height: 1100px; /* 最大高度 */
}


/* 宽屏显示器（2560px 宽度） */
@media (min-width: 2560px) {
  .carousel {
    height: 1100px; /* 固定高度 */
  }
}

/* 轮播图中的图片 */
.carousel img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保图片填充容器并保持比例 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/* 当前活动的图片 */
.carousel img.active {
  opacity: 1;
  visibility: visible;
}

/* 轮播图指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicators .indicator {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-indicators .indicator.active {
  background: white;
}

/* 缩略图样式 */
.thumbnail {
  width: 100%;
  max-width: 450px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.thumbnail:hover {
  transform: scale(1.05);
}

/* 放大图片的遮罩层 */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.overlay img {
  max-width: 90%;
  max-height: 90%;
}

/* 关闭按钮 */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 30px;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* 底部样式 */
footer {
  background: rgba(173, 216, 230, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 20px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 14px;
}

.footer-content img {
  width: 250px;
  margin: 0 auto;
}

/* 社交图标样式 */
.social-icons {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-right: 20px;
}

.social-icons a {
  margin: 0 10px;
  color: var(--primary-color);
  font-size: 30px;
  transition: var(--transition);
}

.social-icons a:hover {
  color: var(--secondary-color);
}

.copyright {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .carousel {
    height: 220px; /* 手机端调整轮播图高度 */
  }

  .carousel-prev, .carousel-next {
    padding: 8px; /* 手机端调整按钮大小 */
    font-size: 16px;
  }

  .carousel-indicators .indicator {
    width: 8px;
    height: 8px; /* 手机端调整指示器大小 */
  }

/* 店铺链接样式 */
.shopping-platforms {
  display: flex;
  width: 120px; /* 设置图片宽度 */
}
.thumbnail {
  width: 100%;
  max-width: 250px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.thumbnail:hover {
  transform: scale(1.05);
}

  .shop-section {
    flex-direction: column;
    gap: 20px;
  }

  .shopping-section {
    flex-direction: column;
    gap: 15px;
  }

  .image-float {
    float: none;
    margin: 0 auto 15px; /* 修复：添加闭合括号 */
  }

  .navbar {
    height: 60px; /* 减小高度 */
    padding-left: 20px; /* 调整文字位置 */
  }

  .navbar-image {
    display: none; /* 在小屏幕下隐藏图片 */
  }

  .navbar h1 {
    font-size: 16px; /* 缩小文字 */
  }

  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    backdrop-filter: none;
    height: 40px; /* 减小导航条高度 */
  }

  header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 40px; /* 确保容器高度与导航条一致 */
  }

  header img {
    width: 160px;
    transform: translateY(0);
    margin-bottom: 0;
  }

  header nav {
    display: none; /* 移动端隐藏导航条 */
    flex-direction: column;
    position: absolute;
    top:50px; /* 导航项从导航条下方开始 */
    right: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
  }

  header nav.active {
    display: flex; /* 点击汉堡菜单时显示导航项 */
  }

  .hamburger {
    display: block; /* 移动端显示汉堡菜单 */
    font-size: 24px;
    cursor: pointer;
  }

  .carousel {
    margin-top: 60px; /* 调整轮播图的顶部间距 */
  }
}