/* ============================================================================
 * themes/kgtwbeef/sidebar.css — kgtwbeef 主題 sidebar 層完整抽取
 * ============================================================================
 *
 * 用途：
 *   完整承接舊 kgtwbeef.css 的 mobile-sidebar 段落內容（含 overlay / aside /
 *   header / content / multi-level menu / member center bottom logout-btn），
 *   作為 kgtwbeef 主題對 common/sidebar.css 的覆寫與補充層。
 *
 * 抽取策略（按 dgfactor 模式 — 完整段落抽取）：
 *   舊 kgtwbeef.css 已凍結停用（css.blade.php 改用 themeCssUrls 模組化載入，不再直接載入舊單檔），其 mobile-sidebar
 *   段落 SHALL 完整抽到本檔。本檔載入順序在 common/sidebar.css 之後。
 *
 * 抽取來源：public/web/css/kgtwbeef.css line 7420-7884
 *   - line 7420-7424：原檔「10. 行動裝置側邊欄」section comment
 *   - line 7425-7856：mobile-sidebar overlay / aside / header / content /
 *                     multi-level menu（Level 1/2/3 含 flexbox 跳轉 + 展開按鈕分離 +
 *                     .menu-icon-l1 多層 icon）
 *   - line 7857-7884：.logout-btn-container / .logout-btn / .logout-btn:hover
 *                     （會員中心側邊欄底部登出按鈕）
 *
 * 載入順序：
 *   common/sidebar.css -> themes/kgtwbeef/sidebar.css（本檔）-> 其他
 *
 * 詳細規格：openspec/specs/web-theme-css/spec.md（Requirement R.FUNC.1 / R.FUNC.8）
 * 變更記錄：openspec/changes/issue518-web-theme-css-modularization/（task 9.3）
 * ============================================================================
 */

/* ============================================================
   10. 行動裝置側邊欄 (Mobile Sidebar)
   ============================================================ */

/* 遮罩層 */

/* Sidebar 主體 */

/* 標頭 */

.sidebar-title {
  font-size: 13px;
  font-weight: 900;
  color: #C3996B;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.sidebar-close-btn:hover {
  color: #573700;
}

.sidebar-divider {
  height: 2px;
  width: 2rem;
  background-color: #C3996B;
}

/* 可捲動內容區 */
.sidebar-content {
  /* #548 對齊 common 新版「整支單一捲動」模型：取消內捲與 flex:1，改隨內容流動，
     讓會員中心緊接在 Language 之後、不再遮蔽上方區塊 */
  flex: 0 0 auto;
  overflow: visible;
  padding: 0.5rem 1rem;
}

/* 第 1 層選單 */

.menu-item-l1-wrapper:hover {
  background-color: #faebd7;
}

/* 左側：跳轉連結區域 */

.menu-btn-l1-link:hover {
  color: #573700;
}

/* 右側：展開按鈕區域 */

.menu-btn-l1-toggle.active {
  background-color: #f0e0c8;
  color: #573700;
}

/* #548 展開狀態改淡奶油底（原深棕 #573700 太深、配深字對比僅 1.64 看不清）；文字用品牌深棕 */
.menu-btn-l1-toggle.active~.menu-btn-l1-link,
.menu-item-l1-wrapper:has(.menu-btn-l1-toggle.active) {
  background-color: #f0e0c8;
}

/* #548 權重對齊 common 的 (0,4,0)，讓展開連結文字/圖示用品牌深棕（壓過 default 的 #111827） */
.menu-item-l1-wrapper:has(.menu-btn-l1-toggle.active) .menu-btn-l1-link,
.menu-item-l1-wrapper:has(.menu-btn-l1-toggle.active) .menu-icon-l1 {
  color: #573700;
}

/* 第 2 層選單 */

/* 左側：跳轉連結區域 */

.menu-btn-l2-link:hover {
  color: #573700;
}

/* 右側：展開按鈕區域 */

.menu-btn-l2-toggle.active {
  background-color: rgba(0, 0, 0, 0.1);
  color: #573700;
}

/* 第 3 層選單 */
.menu-container-l3 {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease-in-out;
  border-left: 2px solid #C3996B;
  margin-left: 0.5rem;
}

.menu-link-l3:hover {
  color: #573700;
}

/* 系統選單 */

/* 底部 */

.user-info-section:hover {
  background-color: #faebd7;
}

.user-info-section.active {
  background-color: #faebd7;
}

.user-name {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  color: #573700;
  letter-spacing: 0.025em;
}

.user-role {
  font-size: 10px;
  color: #C3996B;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-top: 0.125rem;
}

/* 會員中心選單 */

.member-menu-header {
  font-size: 14px;
  color: #C3996B;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.member-group-title {
  font-size: 14px;
  font-weight: 900;
  color: #573700;
  margin-bottom: 1rem;
}

.member-menu-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  border-left: 1px solid #C3996B;
}

.member-menu-list a:hover {
  color: #573700;
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #C3996B;
  background: transparent;
  color: #573700;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
  border-radius: 99rem;
}

.logout-btn:hover {
  background-color: #E8380C;
  color: #fff;
  border-color: #E8380C;
}

/* ============================================================================
 * .product-side-menu kgtwbeef 品牌覆寫（kgtwbeef.css line 7016-7172）
 * ----------------------------------------------------------------------------
 * 商品分類側欄 kgtwbeef 專屬樣式（米色 #faebd7 底 / 金色 #D1AD4B 邊框 /
 * 深棕字 / 多層展開 + Font Awesome 箭頭）。common/sidebar.css 已含
 * 對應 .product-side-menu 基底，本檔覆寫 kgtwbeef 品牌色票。
 *
 * 包含：.product-side-menu / .widget-title (含 ::before) / .product-cat /
 *       .product-cat-item / 各層 ul / hover / .is-active / .has-children
 *       a::after Font Awesome 展開箭頭 / 991↓ padding RWD
 * ============================================================================ */

/* cascade specificity 修補：模組化載入順序 sidebar.css → widget.css，導致
 * widget.css 內 .widget { padding: 20px 16px } 與 .widget-categories { background: #eae2d8 }
 * 兩條同 specificity 規則蓋過本檔的 .product-side-menu（DOM 元素同時帶 widget /
 * widget-categories / product-side-menu 三個 class）。改用 .widget.product-side-menu
 * 雙 class 選擇器（specificity 0,2,0）擊敗單 class .widget / .widget-categories（0,1,0）。
 * 原 cm12 單檔以 source order 解決，模組化後需明確提升 specificity。 */
.widget.product-side-menu {
  background: #ffffff;
  border-left: 4px solid #D1AD4B;
  padding: 24px 20px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
}

.product-side-menu .widget-title {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 800;
  text-transform: none;
  padding-left: 0;
  color: #5a4a32;
}

.product-side-menu .product-cat-item>a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 0;
  border: 1px solid transparent;
  text-decoration: none;
  color: #5a4a32;
  font-weight: 600;
  background: transparent;
  border-bottom: 1px solid #f1f1f1;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

/* .product-cat-item>a::after content:none 與 .product-cat>ul>.product-cat-item>a
 * background:transparent 與 common/sidebar.css 語意相同（combinator 空白差異），已移除由
 * common 托底；保留下方 brand 色 hover/is-active 覆寫。issue #562 */

.product-side-menu .product-cat-item>a:hover {
  background: #fbf4e8;
  border-color: transparent;
}

.product-side-menu .product-cat>ul>.product-cat-item>a:hover {
  background: #f6eddc;
}

.product-side-menu .product-cat>ul>.product-cat-item.is-active>a {
  background: #B8892E;
  color: #ffffff;
}

.product-side-menu .product-cat-item span,
.product-side-menu .product-cat-item li span {
  color: inherit;
  font-weight: inherit;
}

.product-side-menu .product-cat-item ul {
  margin-top: 0;
  padding-left: 16px;
  border-left: 1px solid #efe6d6;
}

.product-side-menu .product-cat-item ul .product-cat-item>a,
.product-side-menu .product-cat-item ul .product-cat-item ul .product-cat-item>a {
  font-size: 13px;
  padding: 10px 8px 10px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-weight: 500;
  line-height: 1.4;
  border-bottom: 1px solid #f5f5f5;
  color: #8a6c3d;
  position: relative;
}

.product-side-menu .product-cat-item ul .product-cat-item.is-active>a,
.product-side-menu .product-cat-item ul .product-cat-item ul .product-cat-item.is-active>a {
  background: transparent;
  color: #E8380C;
  font-weight: 700;
}

.product-side-menu .product-cat-item ul .product-cat-item.is-active>a::before,
.product-side-menu .product-cat-item ul .product-cat-item ul .product-cat-item.is-active>a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background-color: #E8380C;
  border-radius: 4px;
}

.product-side-menu .product-cat-item.has-children>a::after {
  /* 商品分類改為手風琴後，展開指示改由共用 .product-cat-toggle 箭頭鈕提供；
     關閉本主題舊有的連結箭頭，避免與新箭頭鈕重疊成雙箭頭。 */
  content: none;
}

.product-side-menu .product-cat-item.is-active.has-children>a::after {
  color: #ffffff;
}

@media (max-width: 991px) {
  .product-side-menu {
    padding: 20px 16px;
  }
}

/* 新版手風琴側欄 — kgtwbeef 主題色：覆寫 common 的 --cat-* 變數，使箭頭鈕 /
   子選單導引線 / 標題裝飾 / active 等新元素套用 kgtwbeef 金棕色系（連結與 active
   既有色由上方既有規則維持，本區只補新元素的品牌色）。 */
.product-side-menu {
  --cat-accent: #B8892E;       /* 金，與 active 連結底色一致 */
  --cat-accent-text: #ffffff;
  --cat-text: #5a4a32;         /* 深棕 */
  --cat-sub-text: #8a6c3d;     /* 中棕 */
  --cat-border: #efe6d6;       /* 米色邊 */
  --cat-hover: #faf3e6;        /* 淺米 hover */
  --cat-chevron: #b9986a;      /* 棕金箭頭 */
}
