    

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #fff;
  color: #333;
}

header {
  background-color: #C86F4A;
  color: white;
  padding: 1em 0;

  }
  header > div {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 2px;
}

.logo-img {
  height: 150px;
  width: auto;
}

.logo {
  font-family: 'Noto Sans TC', '微軟正黑體', sans-serif;
  font-size: 3.5em;
  font-weight: bold;
  letter-spacing: 2px;
  margin: 0;
  padding: 0.2em 0;
  animation: bounceIn 0.8s ease forwards;

}

nav {
  margin-top: 0.3em;
}

nav a {
  margin: 0 10px;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8em;
  color: white;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
}

.menu {
  display: flex;
  gap: 15px;
}

@media (min-width: 768px) {
  nav .menu {
    display: flex;
    justify-content: center; /* ✅ 將 menu 選單置中 */
    gap: 20px;                /* ✅ 間距可微調 */
  }

  nav {
    width: 100%;
    display: flex;
    justify-content: center; /* ✅ nav 容器本身也置中 */
  }
}

.menu a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* RWD 手機版 */
@media (max-width: 768px) {
  .menu {
    display: none;
    flex-direction: column;
    background-color: #C86F4A;
    position: absolute;
    top: 60px;
    right: 10px;
    width: 150px;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 10000;
  }

  .menu-toggle {
    display: block;
    position: flex;
    z-index: 500;
  }

  .menu.show {
    display: flex;
    position: flex;
    
  }
}
@media (max-width: 768px) {
  .logo-img {
    height: 26px; /* 手機版 LOGO 高度 */
  }
  header {
    padding: 0.2em 0;
  }

  .header-inner {
    display: flex;
  align-items: center;
  justify-content: space-between; /* LOGO 左、三條線右 */
  max-width: 960px;
  margin: 0 auto;
  position: relative; /* 給 menu-toggle 定位依據 */
  }
}

@media (max-width: 768px) {
  .logo{
    font-size: 1em; /* 與 LOGO 大小比例接近 */
  }
}

/* 手機版滑動輪播 */
.card-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  padding: 1em;
  width: 100%; /* ✅ 這行是讓手機可滑動的關鍵 */
  box-sizing: border-box; /* ✅ 加在這裡！ */
    
}

.card-slider::-webkit-scrollbar {
  display: none;
}

/* 每一張卡片 */
.product-card {
  flex: 0 0 auto;
  min-width: auto; /* ✅ 關鍵，保證每張卡片超過螢幕寬度，觸發滑動 */
  max-width: 220px;      /* ✅ 將最大寬度收斂，避免卡片太大 */
  padding: 0.5em 0.5em;  /* ✅ 左右 padding 減少 */
  margin: 0 auto;        /* ✅ 置中 */
  scroll-snap-align: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 0.5em;
  border: 1px solid #ddd;
}
.product-card img {
  width: 100% ;
  max-width: 240px;
  max-height: auto;
  height: auto;
  display: block;
  object-fit: contain;
}


/* 桌機版恢復三欄排版 */
@media (min-width: 768px) {
  .card-slider {
    display: flex;
    justify-content: center;
    gap: 40px;            /* 控制小豬之間距離 */
    max-width: 960px;     /* ✅ 限制總寬度 */
    margin: 0 auto;       /* ✅ 讓整排置中 */
    padding: 2em 0;
    flex-wrap: wrap;      /* ✅ 換行（可選） */
  }

  .product-card {
    flex: none;                 /* ✅ 不讓卡片被撐開 */
    max-width: 240px;           /* ✅ 固定寬度讓間距一致 */
    margin: 0 auto;             /* ✅ 卡片本身置中（保險） */
  }
}
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85); /* 背景黑+半透明 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup-content {
  position: relative;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
}

.popup-img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  border: none;
  margin: 0;
  padding: 0;
  object-fit: contain;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 2em;
  font-weight: bold;
  color: white;
  cursor: pointer;
  z-index: 10000;
}

/* 手機版彈窗圖片尺寸調整 */
@media (max-width: 768px) {
  .popup-content {
    width: 90vw;
    height: auto;
    padding: 0;
    border-radius: 0;
  }

  .popup-img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  .popup-close {
    top: 10px;
    right: 10px;
    font-size: 1.5em;
  }
}

.countdown {
  margin: 20px 0;
  font-size: 1.1em;
  color: #ff6600;
  font-weight: bold;
}
/* 新增 */
.swiper {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}
.swiper-slide img {
  width: 100%;
  display: block;
  border-radius: 10px;
  z-index: 1;
}
/* 新增 */

/* 新增 */
.vote-container {
  margin-top: 10px;
  text-align: center;
}
.vote-container button {
  margin: 0 5px;
  padding: 6px 12px;
  font-size: 1em;
  cursor: pointer;
}
#vote-result {
  margin-top: 8px;
  font-weight: bold;
  color: #ff6600;
}
/* 新增 */

@media (max-width: 768px) {
  .banner {
    padding: 0.5em 1em; /* ✅ 減少高度 */
  }

  .banner h2 {
    font-size: 1.1em;   /* ✅ 縮小🔥本週團購精選🔥 */
    margin: 0.2em 0;
  }

  .banner p {
    font-size: 0.9em;   /* ✅ 縮小限時特賣文字 */
    line-height: 1.4;
    margin: 0.2em 0;
  }
}

@media (max-width: 768px) {
  .product-card {
    max-width: 140px;
    padding: 0.2em 0.2em;
  }

  .product-card img {
    max-width: 120px;
    height: auto;
  }

  .product-card h3 {
    font-size: 0.85em;
    margin-top: 0.3em;
    margin-bottom: 0.2em;
  }

  .product-card button {
    font-size: 0.75em;
    padding: 4px 8px;
    margin-top: 0.2em;
  }
}

.product-card {
  text-decoration: none;
  color: inherit;
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
}

.banner {
  background-color: #E1C9B0;
  text-align: center;
  padding: 0.1em ;
}

.product-list {
  padding: 2em;
}

.product-card h3 {
  margin-top: 1em;
  font-size: 1.2em;
}

.product-card p {
  margin: 0.5em 0;
  font-size: 1em;
}

button {
  background: #C86F4A;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 5px;
  cursor: pointer;
}

footer {
  text-align: center;
  background: #333;
  color: white;
  padding: 1em;
  margin-top: 2em;
}