body {
  font-family: sans-serif;
  margin: 0;
  background-color: #333;
  color: #fff;
}

/* 選擇 header 元素 */
header {
  background-color: #ccc;
  padding: 10px 20px;
  border-radius: 150px;
  width: 50%;
  min-width: 35%;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* 選擇 class 為 header-content 的元素 */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* 選擇 nav 元素下的 ul 元素 */
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 15px;
  justify-content: flex-end; /* 將連結靠右對齊 */
  margin-left: 15px; /* 距離左邊緣 15px */
}

/* 選擇 nav 元素下的 li 元素 */
nav li {
  margin-left: 20px;
}

/* 選擇 nav 元素下的 a 元素 */
nav a {
  text-decoration: none;
  color: #444;
}

/* 選擇 class 為 dropdown 的元素 */
.dropdown {
  position: relative;
  display: inline-block;
}

/* 選擇 class 為 dropdown-content 的元素 */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ccc;
  color: #000;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* 選擇 class 為 dropdown-content 的元素下的 a 元素 */
.dropdown-content a {
  color: #000;
  padding: 5px 5px;
  text-decoration: none;
  display: block;
}

/* 滑鼠懸停在 dropdown 項目上時 */
.dropdown:hover .dropdown-content {
  display: block;
  border-radius: 15px;
}

/* 商品容器樣式 */
#product-list { /* 使用 id 選擇器 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 80%;
  max-width: 700px;
  margin: 30px auto;
  margin-top: 100px;
}

/* 商品項目樣式 */
.product-item {
  background-color: #444;
  color: white;
  border-radius: 10px;
  display: grid;
  /* 使用 grid 佈局 */
  grid-template-rows: auto auto;
  /* 設定兩列 */
  align-items: center;
  /* 垂直置中 */
  text-align: center;
}

/* 商品圖片樣式 */
.product-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  /* 保持圖片比例 */
  border-radius: 10px;
}

/* 商品資訊樣式 */
.product-item .item-content {
  font-size: 16px;
  padding: 0 0 20px;
}

/* 分頁樣式 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* 分頁按鈕樣式 */
.page-button {
  background-color: #cccccc;
  color: black;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  margin: 0 10px;
  cursor: pointer;
}

.page-button:hover {
  background-color: #999;
}

/* 選擇 footer 元素 */
footer {
  background-color: #222; /* 設定背景顏色為 #222 */
  text-align: center; /* 設定文字水平居中 */
  padding: 10px; /* 設定內邊距為 10px */
  position: fixed; /* 使用固定定位 */
  bottom: 0; /* 距離底部 0px */
  width: 100%; /* 設定寬度為 100% */
}

.loader {
  text-align: center; 
  font-size: 18px; 
  margin-top: 20px; 
}

@media (max-width: 1000px) {
  nav ul {
    display: block;
    position: fixed;
    top: 40px;
    right: 1px;
    width: 16.666%; /* 設定 width 為 100% */
    background-color: #ccc;
    padding: 15px 20px; /* 設定內邊距為上下 12px、左右 16px */

  }
  
  nav li {
      margin-top: 15px; /* 將項目之間的間距調整為 5px */
    }
  
  .dropdown-content {
    position: static;
    display: none;
    background-color: #ccc;
    color: #fff;
  }

  .burger {
    display: block;
  }
}