/* ================= 全局變數與重置 (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;
  }
}


/* =====內容=========================================================================*/



/* ================= 2. 滿版自動輪播 Hero Banner ================= */
.hero-carousel-section {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 550px;
  overflow: hidden;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out, transform 8s ease;
  transform: scale(1.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
}

.carousel-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
}

.slide-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  max-width: 800px;
  padding: 0 20px;
}

.slide-content .sub-title {
  font-size: 0.9rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
  color: var(--accent-gold);
}

.slide-content h2 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 24px;
}

.carousel-controls {
  position: absolute;
  bottom: 40px;
  right: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 40px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.carousel-controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.carousel-controls button:hover {
  color: var(--accent-gold);
}

.slide-counter {
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.slide-counter .current-num {
  font-weight: 700;
  color: var(--accent-gold);
}


/* ================= 3. 中間 Content (max-width 1700px) ================= */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 40px;
}

/* 標題共用樣式 */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: var(--accent-gold);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* (1) 品牌故事 */
.brand-story-section {
  margin-bottom: 120px;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.story-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.story-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.story-image:hover img {
  transform: scale(1.03);
}

.image-badge {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background-color: var(--bg-card);
  color: var(--primary-color);
  padding: 10px 20px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.story-text-content h2 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  color: var(--primary-color);
  line-height: 1.4;
  margin: 16px 0 24px;
}

.story-text-content p {
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 1rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 10px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 4px;
}

.link-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}


/* (2) 精選推薦商品熱銷排行 (橫向4個 縱向3排) */
.products-section {
  margin-bottom: 120px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.product-card {
  background-color: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.06);
}

.product-img-wrap {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 100%; /* 1:1 正方形 */
  overflow: hidden;
  background-color: #f5f5f5;
}

.product-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.08);
}

.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--accent-gold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.product-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.4;
}

.product-title a:hover {
  color: var(--primary-color);
}

.price-and-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.add-cart-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-sand);
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.add-cart-icon-btn:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* 外層容器確保內容垂直置中，並讓按鈕們靠右對齊（若原本已有設定可忽略） */
/* 電腦版 / 通用基本樣式 */
.price-and-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-btns {
  display: flex;
  align-items: center;
  gap: 8px; /* 愛心與加號按鈕之間的距離 */
}

/* 追蹤按鈕基礎樣式 */
.wishlist-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  color: #e84c5f; /* 愛心顏色 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.wishlist-icon-btn:hover {
  transform: scale(1.15);
}

/* 📱 手機版 RWD 調整 (768px 以下) */
@media (max-width: 768px) {
  .price-and-action {
    flex-direction: column;  /* 讓價格和按鈕變成上下垂直排列 */
    align-items: flex-start; /* 價格靠左 */
    gap: 8px;                /* 上下間距 */
  }

  .action-btns {
    align-self: flex-end;   /* 強制將按鈕群組推到右邊 */
  }
}



/* (3) 課程資訊 左右自動輪播 */
.courses-section {
  margin-bottom: 120px;
}

.course-slider-container {
  position: relative;
  display: flex;
  align-items: center;
}

.course-slider-track-wrap {
  width: 100%;
  overflow: hidden;
}

.course-slider-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.course-slide {
  min-width: 100%;
  padding: 0 10px;
}

.course-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background-color: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.course-img img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.course-content {
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.course-content .date {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
  margin-bottom: 12px;
}

.course-content h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.course-content p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: var(--transition-smooth);
}

.slider-arrow:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.slider-arrow.prev { left: -25px; }
.slider-arrow.next { right: -25px; }


/* (4) 最新消息 (三則為一區塊 上下自動輪播) */
.news-section {
  margin-bottom: 80px;
}

.news-vertical-carousel {
  height: 420px;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 30px;
}

.news-track-wrapper {
  height: 100%;
  overflow: hidden;
}

.news-track {
  transition: transform 0.6s ease-in-out;
}

.news-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 360px; /* 保持每組 3 筆資料的固定容器高度 */
  justify-content: space-between;
}

.news-item {
  display: flex;
  gap: 16px;
  align-items: center;
}

.news-img {
  width: 90px;
  height: 75px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-info {
  flex-grow: 1;
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-title {
  font-size: 1.05rem;
  margin: 4px 0;
}

.news-title a:hover {
  color: var(--primary-color);
}

.news-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 900px;
}

.news-action {
  text-align: center;
  margin-top: 40px;
}

.btn-view-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 12px 36px;
  border-radius: 40px;
  font-weight: 600;
  letter-spacing: 1px;
}

.btn-view-more:hover {
  background-color: var(--primary-color);
  color: #fff;
}



/* 外層總容器 */
.news-vertical-carousel {
  display: flex;
  align-items: center;
  gap: 30px;
  background-color: #FFFFFF;
  border: 1px solid #E8E5DF;
  border-radius: 20px;
  padding: 30px;
  position: relative;
  box-sizing: border-box;
}

/* 1. 左側小輪播圖區域 (約佔 42%) */
.news-banner-slider {
  width: 42%;
  height: 380px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.banner-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.6s ease-in-out;
}

.banner-slide {
  width: 33.333%;
  height: 100%;
}
.banner-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 小輪播圓點指示器 */
.banner-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.banner-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.banner-dots .dot.active {
  background-color: #FFFFFF;
  width: 20px;
  border-radius: 10px;
}

/* 2. 中間垂直分隔線 */
.news-divider-vertical {
  width: 1px;
  height: 340px;
  background-color: #EFECE6;
  flex-shrink: 0;
}

/* 3. 右側新聞清單滾動區 (佔剩餘寬度) */
.news-track-wrapper {
  flex-grow: 1;
  height: 380px;
  overflow: hidden;
}

.news-track {
  transition: transform 0.6s ease-in-out;
}

.news-block {
  height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.news-item {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* 4. 右側新聞項目之間的橫向分隔線 */
.news-item-divider {
  width: 100%;
  height: 1px;
  background-color: #EFECE6;
  margin: 4px 0;
}

/* RWD 手機版設定 (768px 以下) */
@media (max-width: 768px) {
  /* 1. 外層容器：允許高度根據內容擴展 */
  .news-vertical-carousel {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  /* 2. 上方小輪播圖固定高度 */
  .news-banner-slider {
    width: 100%;
    height: 180px;
  }

  /* 隱藏中間垂直線 */
  .news-divider-vertical {
    display: none;
  }

  /* 3. 右側/下方新聞可視區域：設定高度足以完整容納 3 筆新聞 + 2 條分隔線 */
  .news-track-wrapper {
    width: 100%;
    height: 270px; /* 容納 3 筆項目的高度 */
    overflow: hidden;
    position: relative;
  }

  /* 4. 每組區塊 (.news-block) 包含 3 筆消息，高度固定與可視區域相同 */
  .news-block {
    height: 270px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 2px 0;
  }

  /* 5. 單一新聞項目排版與圖片大小 */
  .news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 70px; /* 每筆高度 */
  }

  .news-img {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .news-info {
    flex-grow: 1;
    overflow: hidden;
  }

  .news-date {
    font-size: 0.75rem;
    color: #888888;
    margin-bottom: 2px;
    display: block;
  }

  .news-title {
    font-size: 0.85rem;
    line-height: 1.3;
    margin: 0;
    /* 限制最多顯示兩行，超出顯示 ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-desc {
    display: none; /* 手機版隱藏繁雜內文，精簡呈現 3 筆 */
  }

  /* 6. 項目之間分隔線的間距調整 */
  .news-item-divider {
    width: 100%;
    height: 1px;
    background-color: #EFECE6;
    margin: 4px 0;
  }
}



/* =====內容=========================================================================*/








/* ================= 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;
}

/* ================= 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;
  }
}
/* Home products: accessible action targets and loading feedback. */
#home-products-container .wishlist-icon-btn {
  min-width: 38px;
  min-height: 38px;
}
#home-products-container button:focus-visible {
  outline: 2px solid var(--primary-color, #40594c);
  outline-offset: 3px;
}
#home-products-container button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}
.home-products-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
}
.home-products-status {
  color: var(--primary-color, #40594c);
  margin: 16px 0 0;
}
.home-products-status:empty { margin: 0; }
