/* Legina 浮動工具列 v4 — 棒狀結構，點對話鈕三顆圖示換成聯絡選項，不伸長
   所有樣式只寫在 nav.lg-bar 底下，除了下面一條指名道姓的退役規則。
   沒有改 legina-odaline.css。圖示用 inline SVG，不用 emoji。 */

/* 退役：Flatsome 原生回到頂部 #top-link.back-to-top（唯一一個 ID，v4 長條底已有回到頂部）。
   注意：Flatsome 3.20.13 的 #top-link 是 <button> 不是 <a>，之前寫 a#top-link 根本選不到，
   所以頁尾抬升時它會露出來，跟 v4 的回到頂部重複。改成不寫元素名，只用 ID。 */
#top-link.back-to-top { display: none !important; }

/* 退役：PushEngage 原生鈴鐺小工具 #pushengage-subscriber-recovery-widget-bell。
   它是 PushEngage JS 注入的，位置在右 23px、下 78px，剛好蓋在工具列中間，
   捲到底、工具列抬升時會露出來，跟工具列裡的鈴鐺重複。
   工具列裡的鈴鐺已經用 window._peq.push(['subscribe']) 做訂閱，
   所以這顆原生鈴鐺直接藏掉，不影響新產品自動推播（那是 PushEngage 後台設定）。 */
#pushengage-subscriber-recovery-widget,
#pushengage-subscriber-recovery-widget-bell { display: none !important; }

/* 手機版：浮動工具列不顯示，改放進手機選單裡點（見 PHP 的 wp_nav_menu_items，primary_mobile）。
   斷點用 849px，跟 Flatsome 的 hide-for-medium 同一個斷點。 */
@media (max-width: 849px) {
  nav.lg-bar { display: none !important; }
}

/* 手機選單裡的聯絡項目：跟選單其他項目同一個樣式，只在訂閱通知前面加一個藍點做區分 */
li.lg-mobile-menu-item a { display: block; }
li.lg-mobile-menu-subscribe a::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8C6D46;
  margin-right: 8px;
  vertical-align: middle;
}

/* 棒狀長條底：64px 寬、圓角 pill、深色底，剛好包住 3 顆 48px 圓鈕。
   置中一定要明確寫死：nav 用 box-sizing:border-box，裡面的 set 寬度 100%，
   按鈕 margin: 0 auto。之前只靠 align-items:center，實機量到按鈕偏左，
   左邊深色邊約一半、右邊深色邊約兩倍，看起來就是歪的。 */
nav.lg-bar {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 999;
  width: 64px;
  box-sizing: border-box;
  padding: 12px 0;
  border-radius: 999px;
  background: rgba(26,25,24,.92);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 32px -12px rgba(26,25,24,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: bottom .25s ease;
}
/* 滑到底、接近頁尾時整排往上抬，不蓋頁尾連結（由 JS 加 .is-lifted） */
nav.lg-bar.is-lifted { bottom: 110px; }
/* 注意：不要用 padding-top 把長條撐開給 × 留空間，Chang 說不行，長條不能變長。
   × 改成坐在長條右上角的外面斜角上，長條長度完全不變。 */

/* 兩組圖示：平常只顯示主組，點對話鈕後換成聯絡組，長條長度不變。
   set 一定要 width:100%，不然它的寬度由內容決定，置中會飄。 */
nav.lg-bar .lg-bar-set {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}
nav.lg-bar .lg-bar-set-contact { display: none; }
nav.lg-bar.open .lg-bar-set-main { display: none; }
nav.lg-bar.open .lg-bar-set-contact { display: flex; animation: lg-bar-fade .25s ease; }
@keyframes lg-bar-fade { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }

/* 圓鈕：48px，跟 Chat Bubble 內層按鈕原尺寸一樣 */
nav.lg-bar .lg-bar-btn {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
  position: relative;
  flex-shrink: 0;
}
nav.lg-bar .lg-bar-btn:hover { transform: translateY(-2px); }
nav.lg-bar .lg-bar-btn svg { width: 22px; height: 22px; }
/* 主按鈕配色（2026-12-01 Chang 說他指的就是右下角這顆按鈕）：
   鈴鐺和對話原本是藍色（#2563eb / #0a7cff），改成網站強調色銅金 #8C6D46，
   跟加入購物車同一個色，hover 用深銅金 #75593A。
   LINE 綠 #06c755、Messenger 藍 #0084ff 是品牌色，認得出才好點，所以不動。 */
nav.lg-bar .lg-bar-bell { background: #8C6D46; }
nav.lg-bar .lg-bar-chat { background: #8C6D46; }
nav.lg-bar .lg-bar-bell:hover,
nav.lg-bar .lg-bar-chat:hover { background: #75593A; }
nav.lg-bar .lg-bar-line,
nav.lg-bar .lg-bar-msg,
nav.lg-bar .lg-bar-mail {
  background: #262422;
  border: 1px solid rgba(255,255,255,.18);
}
nav.lg-bar .lg-bar-line { letter-spacing: -.5px; }
nav.lg-bar .lg-bar-msg { font-size: 22px; }
nav.lg-bar .lg-bar-line:hover,
nav.lg-bar .lg-bar-msg:hover,
nav.lg-bar .lg-bar-mail:hover {
  background: #8C6D46;
  border-color: rgba(255,255,255,.28);
}

/* 回到頂部：白色圓 + 深色 SVG 箭頭，捲 600px 後 JS 才加 .is-visible。
   一定要用 display:none 藏，不能只用 opacity:0 —— 只用 opacity 的話，
   按鈕還佔 48px 高，長條底下會留一段空的深色，第一層看起來就變形。 */
nav.lg-bar .lg-bar-top {
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  display: none;
}
nav.lg-bar .lg-bar-top.is-visible { display: flex; }

/* 滑過按鈕，左邊出小標籤 */
nav.lg-bar .lg-bar-label {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #222;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 5px 9px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
nav.lg-bar .lg-bar-btn:hover .lg-bar-label,
nav.lg-bar .lg-bar-btn:focus-visible .lg-bar-label { opacity: 1; }

/* 關閉鈕：聯絡組開啟時就固定（fix）在長條右上角，不會跟著 hover 跑、
   也不會因為滑鼠移開就消失、移去點 × 時又不見。
   紅色 × 照導航列語言鈕 .lg-tr-reset（#C4533E、白 ×、圓形），
   close 小字才是 hover × 時才出現，放在 × 的左邊。
   注意：千萬不要對整顆按鈕用 transform: translate(50%, -50%)，也不要用
   top:-8px、right:-8px —— 按鈕包含 close 小字，寬度約 70px，往右推一點
   × 就會被視窗右緣截掉一半（瀏覽器實測 02:38 確認：只剩左半約 10px）。
   改成 top:0、right:0，× 完全貼在長條右上角裡面，保證不會被截。
   但實機又發現：× 貼在圓角邊緣會被長條的圓角切掉一半，看起來變形，
   而且 20px 太小不好點。× 加大到 28px、字 18px。
   位置最後定在 top:-20px、right:-8px：× 往上、往左移了一點，底邊在 LINE 上方 4px，
   完全不蓋 LINE，長條長度不變；長條離視窗右緣 18px，× 伸出 8px，還有 10px 餘裕。 */
nav.lg-bar .lg-bar-close {
  position: absolute;
  top: -20px;
  right: -8px;
  display: none;
  align-items: center;
  gap: 5px;
  z-index: 7;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
nav.lg-bar.open .lg-bar-close { display: flex; }
nav.lg-bar .lg-bar-close-txt {
  font-size: 11px;
  color: #fff;
  background: rgba(26,25,24,.92);
  border: 1px solid rgba(255,255,255,.2);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
nav.lg-bar .lg-bar-close:hover .lg-bar-close-txt,
nav.lg-bar .lg-bar-close:focus-visible .lg-bar-close-txt { opacity: 1; }
nav.lg-bar .lg-bar-close-x {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #B54A3A;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  flex-shrink: 0;
}

@media (max-width: 549px) {
  nav.lg-bar { right: 12px; bottom: 12px; }
  nav.lg-bar.is-lifted { bottom: 96px; }
}
