/* ================= 全局變數與重置 (Global Styles) ================= */
:root {
  --primary-color: #3E5448;      /* 清新深苔綠 */
  --primary-light: #6A8273;      /* 柔和植物綠 */
  --accent-gold: #C5A880;        /* 典雅香檳金 */
  --bg-sand: #FAF9F6;            /* 溫暖有機暖白 */
  --bg-card: #FFFFFF;            /* 純白卡片 */
  --text-main: #2C302E;          /* 質感深灰文字 */
  --text-muted: #737875;         /* 柔和次要文字 */
  --border-color: #E8E6E1;       /* 極淺灰邊框 */
  --font-heading: 'Noto Serif TC', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1700px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-sand);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* 按鈕樣式 */
.btn-primary {
  display: inline-block;
  background-color: var(--primary-color);
  color: #fff;
  padding: 12px 32px;
  border-radius: 40px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(62, 84, 72, 0.2);
}

.btn-outline {
  display: inline-block;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 10px 28px;
  border-radius: 40px;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.full-width {
  width: 100%;
}


/* ================= 1. Header 樣式 (RWD) ================= */
/*鑽石*/
.header-top {
  padding: 8px;
  text-align: center;
  background-color: #e8e6e1;
}
/* 外層容器 flex 垂直置中 */
.member-status {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* 鑽石與文字之間的間距 */
}

/* 調整鑽石尺寸與垂直微調 */
.diamond-icon {
  display: block;
  flex-shrink: 0;
}

/* 文字樣式設定 */
.member-text {
  font-size: 0.9rem;
  color: #555555; /* 精緻灰色文字 */
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
}




.main-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}
.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LOGO (圖+文) */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .en {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
}

.logo-text .zh {
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 電腦版選單與展開效果 */
.desktop-nav .nav-list {
  display: flex;
  gap: 36px;
}

.desktop-nav .nav-item {
  position: relative;
  padding: 10px 0;
}

.desktop-nav .nav-item > a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav .nav-item > a i {
  font-size: 0.7rem;
  transition: var(--transition-smooth);
}

.desktop-nav .nav-item:hover > a {
  color: var(--primary-color);
}

.desktop-nav .nav-item:hover > a i {
  transform: rotate(180deg);
}

/* 下拉選單動畫 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  min-width: 180px;
  padding: 12px 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.desktop-nav .nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 24px;
  font-size: 1rem;
  color: var(--text-main);
}

.dropdown-menu a:hover {
  background-color: var(--bg-sand);
  color: var(--primary-color);
}

/* 右側功能按鈕 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #EFECE6;
  border-radius: 30px;
  padding: 10px 16px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 140px;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  width: 180px;
}

.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 20px;
  transition: var(--transition-smooth);
}

.action-btn:hover {
  color: var(--primary-color);
  background-color: rgba(62, 84, 72, 0.08);
}

.action-btn .btn-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--accent-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-main);
  cursor: pointer;
}

/* 手機版抽屜式選單 */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-card);
  z-index: 2000;
  padding: 30px;
  box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.close-drawer-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-list {
  margin-top: 20px;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-item .menu-title, .mobile-menu-item > a {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
}

.mobile-menu-item .submenu {
  display: none;
  background-color: var(--bg-sand);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.mobile-menu-item .submenu a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--text-muted);
}
.mobile-menu-item .submenu a:hover {
  background-color: rgba(62, 84, 72, 0.08);
  padding: 10px;
}

.mobile-contact-info {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mobile-contact-info h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.mobile-contact-info p {
  margin-bottom: 6px;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* ================= 1. 手機版搜尋列樣式 ================= */
.mobile-search-row {
  display: none; /* 電腦版隱藏 */
  padding: 8px 16px 12px;
  background-color: var(--bg-sand);
  border-top: 1px solid var(--border-color);
}

.mobile-search-box {
  display: flex;
  align-items: center;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.mobile-search-box input {
  flex-grow: 1;
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  background: transparent;
}

.mobile-search-box button {
  background-color: #EFECE6;
  border: none;
  padding: 11px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 1px solid var(--border-color);
}

/* RWD 斷點設定 */
@media (max-width: 1180px) {
  .desktop-search {
    display: none; /* 隱藏電腦版 Header 內的搜尋欄 */
  }
  .mobile-search-row {
    display: block; /* 手機與平板顯示獨立搜尋欄 */
  }
}

/* 1. 徹底防止手機版畫面產生橫向滾動/滑出側欄的效果 */
html, body {
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}


/* 2. 確保選單在隱藏狀態下完全不佔用空間，並關閉觸控滑動干擾 */
@media (max-width: 1180px) {
  /* 假設您的手機側欄選單 class 是 .mobile-nav 或 .desktop-nav */
  .desktop-nav:not(.active),
  .mobile-nav:not(.active) {
    visibility: hidden; /* 未開啟選單時徹底隱藏，防止手勢滑出 */
    pointer-events: none; /* 防止誤觸點擊 */
  }

  /* 當點擊漢堡選單展開時 (通常會加 .active) 再還原顯示 */
  .desktop-nav.active,
  .mobile-nav.active {
    visibility: visible;
    pointer-events: auto;
  }
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0px 40px;
}



/* ===中間 Content (max-width 1700px) === */
/* =====內容=========================================================================*/

/* ==========================================================================
   清新風格高質感購物車 - 全局與基礎樣式 (獨立選擇器，防止影響與覆蓋)
   ========================================================================== */
:root {
  --color-bg: #F9F9F8;
  --color-card-bg: #FFFFFF;
  --color-text-main: #2C302E;
  --color-text-muted: #8C928C;
  --color-primary: #768A76; /* 鼠尾草綠 (清新低飽和) */
  --color-primary-hover: #5C6E5C;
  --color-accent: #D4A373; /* 暖木質感色 */
  --color-border: #EAEAEA;
  --color-tag-bg: #F2F5F2;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);
  --transition-normal: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}


/* 頁面容器 */
.page-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

/* 面包屑 */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}

/* 抬頭 Header */
.page-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 1px;
}
.page-title span {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-left: 8px;
}

/* 主要雙欄排版 */
.content-wrapper {
  display: flex;
  gap: 32px;
}

/* ==========================================================================
   左側側邊欄：二層式選單
   ========================================================================== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
}
.sidebar-block {
  background: var(--color-card-bg);
  padding: 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 24px;
}
.sidebar-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 選單結構 */
.category-menu {
  list-style: none;
}
.menu-item {
  border-bottom: 1px dashed var(--color-border);
}
.menu-item:last-child {
  border-bottom: none;
}
.menu-item a, .menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--color-text-main);
  cursor: pointer;
  transition: var(--transition-normal);
}
.menu-item a:hover, .menu-header:hover {
  color: var(--color-primary);
}
.menu-item.active > a {
  color: var(--color-primary);
  font-weight: 600;
}
.toggle-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}
.menu-item.open .toggle-icon {
  transform: rotate(180deg);
}

/* 第二層子選單 */
.sub-menu {
  list-style: none;
  display: none; /* jQuery 控制展開 */
  padding-left: 16px;
  padding-bottom: 8px;
  background-color: var(--color-tag-bg);
  border-radius: var(--border-radius-sm);
}
.sub-menu li a {
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.sub-menu li a:hover {
  color: #38483e;
  font-weight: 600;
}

/* ==========================================================================
   右側商品區 & 工具列
   ========================================================================== */
.products-section {
  flex-grow: 1;
  width: calc(100% - 272px);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-card-bg);
  padding: 16px 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

/* 搜尋欄位 */
.search-box2 {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 30px;
  padding: 16px 16px;
  width: 280px;
  transition: var(--transition-normal);
}
.search-box2:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(118, 138, 118, 0.15);
}
.search-box2 input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--color-text-main);
}
.btn-search {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 下拉排序 */
.sort-box select {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  color: var(--color-text-main);
  outline: none;
  cursor: pointer;
}

/* 視圖切換按鈕 */
.view-switch {
  display: flex;
  gap: 4px;
}
.btn-view {
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-normal);
}
.btn-view.active, .btn-view:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   商品列表網格 (5欄 x 6排 佈局)
   ========================================================================== */
.products-grid {
  display: grid;
  gap: 20px;
  transition: var(--transition-normal);
}

/* 預設: 棋盤式 CSS Grid 精確設為 4 縱欄 (5-columns) */
.products-grid.view-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* 商品卡片本體 */
.product-card {
  background: var(--color-card-bg);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 圖片區塊 */
.img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 正方形 */
  overflow: hidden;
  background-color: #f5f5f5;
}
.img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .img-wrapper img {
  transform: scale(1.06);
}

/* 標籤 (RANK / HOT / NEW) */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.badge-rank { background: #E2E8F0; color: #475569; }
.badge-hot { background: #FEE2E2; color: #EF4444; }
.badge-new { background: #E0E7FF; color: #4338CA; }

/* 懸浮覆蓋層特效 */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-normal);
}
.card-overlay span {
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}
.product-card:hover .card-overlay {
  opacity: 1;
}

/* 商品資訊區塊 */
.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-main);
  margin-bottom: 8px;
  line-height: 1.4;
  height: 2.8em; /* 固定兩行高度 */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 銷量與折價券 */
.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.75rem;
}
.product-sales {
  color: var(--color-text-muted);
}
.coupon-tag {
  background-color: #FFF2E8;
  color: #FA541C;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* 價格與按鈕 */
.product-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.price-box {
  color: var(--color-text-main);
  font-weight: 600;
}
.price-box .currency {
  font-size: 0.75rem;
  margin-right: 2px;
}
.price-box .price {
  font-size: 1.05rem;
}

.action-btns {
  display: flex;
  gap: 6px;
}
.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 0.8rem;
}
.btn-icon:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   條列式 View (List View Style)
   ========================================================================== */
.products-grid.view-list {
  grid-template-columns: 1fr !important;
}
.products-grid.view-list .product-card {
  height: auto;
}
.products-grid.view-list .product-link {
  flex-direction: row;
  align-items: center;
}
.products-grid.view-list .img-wrapper {
  width: 160px;
  height: 160px;
  padding-top: 0;
  flex-shrink: 0;
}
.products-grid.view-list .product-info {
  padding: 20px;
}
.products-grid.view-list .product-title {
  font-size: 1.1rem;
  height: auto;
  margin-bottom: 12px;
}

/* ==========================================================================
   分頁功能
   ========================================================================== */
.pagination-wrapper {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}
.pagination {
  display: flex;
  list-style: none;
  gap: 8px;
}
.page-item .page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-card-bg);
  color: var(--color-text-main);
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-normal);
}
.page-item.active .page-link, .page-item .page-link:hover {
  background: var(--color-primary);
  color: #fff;
}
.page-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   回到頁首按鈕
   ========================================================================== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 99;
  transition: var(--transition-normal);
}
#back-to-top:hover {
  background: var(--color-primary-hover);
  transform: translateY(-3px);
}

/* ==========================================================================
   響應式排版 (RWD Optimization - 無捲軸、手機嚴格 2 排展示)
   ========================================================================== */
/* 平板尺寸 */
@media (max-width: 1024px) {
  .products-grid.view-grid {
    grid-template-columns: repeat(3, 1fr); /* 降為 3 欄 */
  }
  .sidebar {
    width: 200px;
  }
  .products-section {
    width: calc(100% - 232px);
  }
}

/* 平板直向 / 大手機尺寸 */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }
  .sidebar, .products-section {
    width: 100%;
  }
  .sidebar-block {
    position: static;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .search-box2 {
    display: none;

}
  .toolbar-right {
    justify-content: space-between;
  }
}

/* 手機版 (手機嚴格要求：2排橫向，不產生水平橫向捲軸，完美等高) */
@media (max-width: 576px) {
  .page-container {
    padding: 16px 12px 40px; /* 縮小邊距 */
  }

  .products-grid.view-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 強制保持兩排 */
    gap: 10px; /* 縮小網格間距防止擠壓 overflow */
  }

  .product-card {
    border-radius: var(--border-radius-sm); /* 手機端採用稍小圓角更精緻 */
  }

  .product-info {
    padding: 10px;
  }

  .product-title {
    font-size: 0.8rem;
    height: 2.6em;
  }

  .price-box .price {
    font-size: 0.95rem;
  }

  .action-btns .btn-icon {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  /* 條列式在手機版自動退化為雙排以維持美觀 */
  .products-grid.view-list .product-link {
    flex-direction: column;
  }
  .products-grid.view-list .img-wrapper {
    width: 100%;
    height: auto;
    padding-top: 100%;
  }
}

/* =====內容=========================================================================*/





/* ================= 4. Footer 樣式 ================= */
.main-footer {
  background-color: #24332B;
  color: #E2E8E4;
  padding-top: 80px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 60px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 50px;
}

.footer-logo {
  color: #fff;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 0.9rem;
  color: #A3B0A7;
  margin-bottom: 24px;
  max-width: 320px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.social-links a:hover {
  background-color: var(--accent-gold);
  transform: translateY(-3px);
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.footer-col ul li a {
  color: #A3B0A7;
}

.footer-col ul li a:hover {
  color: var(--accent-gold);
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #A3B0A7;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
  background-color: #1B2721;
}

.footer-bottom-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #839187;
}

.payment-logistics-badges {
  display: block;
  gap: 20px;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ================= 5. Modal 彈出視窗 ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--bg-card);
  width: 90%;
  max-width: 440px;
  padding: 40px;
  border-radius: 20px;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-box h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  font-size: 0.9rem;
}

.form-group input:focus {
  border-color: var(--primary-color);
}
/* 分隔線與文字 */
.social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0 16px;
  color: #a0a0a0;
  font-size: 12px;
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.social-divider span {
  padding: 0 10px;
}

/* 快速登入按鈕容器 */
.social-login-group {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* 按鈕通用基礎樣式 */
.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  background-color: #ffffff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

/* 各別品牌顏色樣式 */
/* 1. Google 帳號 */
.btn-social.btn-google {
  border: 1px solid #d1d5db;
  color: #333333;
}
.btn-social.btn-google:hover {
  background-color: #f9fafb;
}

/* 2. LINE 登入 */
.btn-social.btn-line {
  border: 1px solid #00c300;
  color: #00c300;
}
.btn-social.btn-line:hover {
  background-color: #f0fdf4;
}

/* 3. Facebook */
.btn-social.btn-fb {
  border: 1px solid #1877f2;
  color: #1877f2;
}
.btn-social.btn-fb:hover {
  background-color: #f0f6ff;
}

/* 購物車 Modal 特殊設定 */
.cart-modal-box {
  max-width: 500px;
}

.cart-items-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.item-detail {
  flex-grow: 1;
}

.item-detail h4 {
  font-size: 0.9rem;
}

.item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.remove-item {
  background: none;
  border: none;
  color: #d9534f;
  cursor: pointer;
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.summary-line.highlight {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 20px;
}
/* 上方紅框：忘記密碼 | 驗證信補發 */
.form-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px;
  font-size: 0.9rem;
}

.form-links a {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-links a:hover {
  color: #2b2b2b;
}

.form-links .divider {
  color: #cccccc;
  font-size: 0.8rem;
}

/* 下方紅框：還不是會員嗎？立即註冊 */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #333333;
}

.form-footer .register-link {
  color: #c4a482; /* 棕金色連結 */
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
  transition: opacity 0.2s ease;
}

.form-footer .register-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* 購物車 Modal 特殊設定 */
.cart-modal-box {
  max-width: 500px;
}

.cart-items-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.item-detail {
  flex-grow: 1;
}

.item-detail h4 {
  font-size: 0.9rem;
}

.item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.remove-item {
  background: none;
  border: none;
  color: #d9534f;
  cursor: pointer;
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.summary-line.highlight {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 20px;
}
/* 上方紅框：忘記密碼 | 驗證信補發 */
.form-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px;
  font-size: 0.9rem;
}

.form-links a {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-links a:hover {
  color: #2b2b2b;
}

.form-links .divider {
  color: #cccccc;
  font-size: 0.8rem;
}

/* 下方紅框：還不是會員嗎？立即註冊 */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #333333;
}

.form-footer .register-link {
  color: #c4a482; /* 棕金色連結 */
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
  transition: opacity 0.2s ease;
}

.form-footer .register-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ================= 6. GO TOP 按鈕 ================= */
.go-top-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.go-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.go-top-btn:hover {
  background-color: var(--accent-gold);
  transform: translateY(-4px);
}


/* ================= 滾動顯現特效 Class ================= */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================= 響應式 RWD Media Queries ================= */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr); /* 平板改為 3 行 */
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1180px) {
  .desktop-nav, .search-box {
    display: none; /* 隱藏電腦版選單與搜尋列 */
  }
  .mobile-toggle-btn {
    display: block; /* 顯示手機版漢堡按鈕 */
  }
  .story-grid, .course-card {
    grid-template-columns: 1fr;
  }
  .slide-content h2 {
    font-size: 2.2rem;
  }
  .news-desc {
    max-width: 400px;
  }
}

/* 電腦版隱藏手機專用的會員/訂單按鈕列 */
@media (min-width: 769px) {
  .mobile-member-tabs {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* 1. 外層容器設為多層 Flex 佈局 */
  .header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0; /* 滿版樣式，由各子元素自訂內邊距 */
  }

  /* 2. 第一列：LOGO 靠左 (order: 1) */
  .brand-logo {
    order: 1;
    padding: 12px 16px;
  }

  /* 3. 第一列右側：只保留 購物車 與 漢堡按鈕 (order: 2) */
  .header-actions {
    order: 2;
    margin-left: auto; /* 擠向最右側 */
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    width: auto; /* 取消滿版 */
  }

  /* 隱藏第一列原本的會員登入與訂單按鈕 (只留購物車與漢堡) */
  .header-actions .action-btn:not(.cart-btn) {
    display: none;
  }

  /* 4. 第二列：會員登入與訂單按鈕列 (order: 3) */
  .mobile-member-tabs {
    order: 3;
    width: 100%;
    display: flex;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
  }

  .mobile-member-tabs .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
  }

  /* 左側：會員登入（深綠底白字） */
  .mobile-member-tabs .tab-login {
    background-color: #3d5346;
    color: #ffffff;
  }

  /* 右側：訂單查詢（淺灰底黑字） */
  .mobile-member-tabs .tab-order {
    background-color: #e0ded9;
    color: #333333;
  }

  /* 5. 第三列：搜尋欄位 (order: 4) */
  .search-box {
    order: 4;
    width: 100%;
    padding: 12px 16px;
  }


  .main-content {
    padding: 50px 20px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr); /* 手機改為 2 行 */
    gap: 16px;
  }
  .slider-arrow {
    display: none; /* 手機隱藏課程滑動箭頭 */
  }
  /* 1. 調整外框容器：增加上方內邊距 (Padding)，確保第一張圖不被裁切 */
  .news-vertical-carousel {
    height: 580px;         /* 保持固定輪播高度 */
    padding: 24px 16px;    /* 稍微加大上下 padding 留出安全邊界 */
    box-sizing: border-box;
  }
  
  /* 2. 內部軌道容器與滑動區塊 */
  .news-track-wrapper {
    height: 100%;
    overflow: hidden;      /* 確保超出範圍隱藏，但內部足夠容納 3 筆 */
  }

  .news-block {
    height: 332px;         /* 精確設定三筆項目的總高度 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
  }

  .news-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .news-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .news-title {
    font-size: 0.9rem;
    line-height: 1.35;
    margin: 2px 0 0 0;
  }

  .news-desc {
    display: none; /* 手機版隱藏簡述，保持三筆畫面的整潔與高度精準 */
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 0 20px 40px;
  }
  .footer-bottom-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
/* Product links and controls remain separate in both card views. */
.product-image-link { display: block; flex-shrink: 0; }
.product-title a { color: inherit; text-decoration: none; }
.product-title a:hover { color: var(--color-primary); }
.product-sales, .coupon-tag { white-space: nowrap; }
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }
.api-toggle-wishlist.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.products-grid.view-list .product-image-link { width: 160px; }
.products-grid.view-list .img-wrapper { width: 100%; }
@media (max-width: 576px) {
  .products-grid.view-list .product-image-link { width: 100%; }
}
