/* ============================================================
   頁首 Header + 手機版選單 Overlay
   來源 style.css 行 272-700（純搬移，內容未改）
   ============================================================ */

/* ============================================================
   01 HEADER
   ============================================================ */
/* Header 預設透明（最上方狀態）。
   滾動超過 threshold → .is-scrolled → 加上毛玻璃
   .is-dark / .is-dark.is-scrolled → 深色模式變體（白文字 + 深色毛玻璃） */
.site-header {
  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  height: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
}

.site-header .container {
  position: relative;
  z-index: 2;
}

/* 淺色（預設）滾動後：白色毛玻璃 */
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

/* 深色模式：頂端透明 + 白文字（文字相關規則於下方） */
.site-header.is-dark {
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

/* 深色模式滾動後：深色毛玻璃 */
.site-header.is-dark.is-scrolled {
  background: rgba(25, 25, 25, 0.45);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

/* ---- 頂部資訊 bar（深→橘漸層、靠右；手機版隱藏）---- */
.site-topbar {
  height: 36px;
  background: linear-gradient(to right, var(--c-text-2) 86%, var(--c-yellow));
  display: flex;
  align-items: center;
}

.site-topbar .container {
  display: flex;
  justify-content: space-between;
}

.topbar-icon-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.topbar-icon-links a {
  width: 20px;
  transition: opacity .2s;
}

.topbar-icon-links a:first-child {
  width: 10px;
}

.topbar-icon-links a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-links {
  display: flex;
  gap: 40px;
}

.topbar-links a {
  color: var(--c-on-dark);
  font-size: var(--fs-sm);
  letter-spacing: 0.8px;
  transition: opacity .2s;
}

.topbar-links a:hover {
  opacity: .75;
  color: var(--c-on-dark);
}

@media (max-width: 991.98px) {
  .site-topbar {
    display: none;
  }
}

/* ---- 主導覽列 ---- */
.site-header-main {
  height: 78px;
}

/* Logo */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
}

.site-logo-image {
  width: 196px;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

@media (max-width: 1400px) {
  .main-nav {
    display: none!important;
  }
}

.main-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  letter-spacing: 0.9px;
  color: var(--c-text);
  font-weight: 400;
  padding: .5rem .25rem;
  position: relative;
  transition: color .25s;
  white-space: nowrap;
}

.site-header.is-dark .main-nav-link {
  color: var(--c-on-dark);
}

/* hover / 目前頁 → 橘色（深淺模式皆然） */
.main-nav-link:hover,
.nav-item:hover > .main-nav-link,
.main-nav-link.is-active,
.nav-item.is-active > .main-nav-link,
.site-header.is-dark .main-nav-link:hover,
.site-header.is-dark .nav-item:hover > .main-nav-link,
.site-header.is-dark .main-nav-link.is-active {
  color: var(--c-brand);
}

/* 下拉箭頭 */
.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .75;
  transition: transform .25s;
}

.nav-item:hover .nav-caret,
.nav-item.is-open .nav-caret {
  transform: rotate(180deg);
}

/* ---- 下拉子選單 ---- */
.nav-item.has-dropdown {
  position: relative;
}

/* hover 橋接：滑鼠由項目移到下拉時不中斷 */
.nav-item.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 168px;
  padding: 8px 0;
  background: var(--c-bg-page);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10;
}

.nav-item:hover .nav-dropdown,
.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  position: relative;
  padding: 12px 28px;
  font-size: var(--fs-sm);
  letter-spacing: .5px;
  color: var(--c-text);
  text-align: center;
  white-space: nowrap;
  transition: color .2s;
}

.nav-dropdown a:hover,
.nav-dropdown a.is-active {
  color: var(--c-brand);
  font-weight: 500;
}

/* 子項分隔線（橘→透明，呼應 Figma） */
.nav-dropdown a:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-brand), transparent);
  opacity: .5;
}

.hamburger {
  width: 40px;
  height: 40px;
  border: 0;
  /* background: transparent; */
  background-color: transparent;
  background-image: url(../../img/hamburger_black.png);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

@media(max-width: 1400px) {
  .hamburger {
    display: flex!important;
  }
}

.site-header.is-dark .hamburger {
  background-image: url(../../img/hamburger_white.png);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--c-text);
}

.site-header.is-dark .hamburger span {
  background: var(--c-bg-white);
}

/* ============ 手機版全螢幕主選單 Overlay（Figma 1284:18092 / 1284:18478） ============ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--c-text-2);
  color: var(--c-on-dark);
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(to top left, var(--c-brand) 0%,  var(--c-text-2) 34%,  var(--c-text-2) 35%,  var(--c-text-2) 70%);
}

/* is-open 僅作為「開啟中」狀態旗標；顯示／隱藏改由 jQuery slideDown/slideUp 控制（見 js/main.js） */

/* 背景裝飾層（底部波紋） */
.mobile-nav-wave {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 130px;
  background: url('../../img/contact_img.svg') no-repeat center top;
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.5;
}

.mobile-nav-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 15px 40px;
  /* 上方留白改由 .mobile-nav-top 提供，使其 sticky 置頂時仍保有間距 */
}

/* 頂部 logo + 關閉（overlay 內部捲動時固定釘在頂部） */
.mobile-nav-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -15px 32px;
  /* 負左右邊距抵銷 inner 內距，讓底色滿版；捲動時遮住下方選單 */
  padding: 24px 15px 16px;
  background: var(--c-text-2);
}

.mobile-nav-logo img {
  width: 196px;
  display: block;
}

.mobile-nav-close {
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.mobile-nav-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 1.5px;
  background: var(--c-bg-white);
}

.mobile-nav-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-nav-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 主選單列表 */
.mobile-nav-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}

.mobile-nav-list > a,
.mobile-nav-trigger {
  display: flex;
  align-items: center;
  padding: 18px 0;
  color: var(--c-on-dark);
  text-align: center;
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: var(--fs-base);
  font-weight: 400;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
  position: relative;
  transition: color .2s;
}

.mobile-nav-list > a.is-active,
.mobile-nav-trigger.is-active {
  font-weight: 700;
}

/* 服務項目下拉箭頭（CSS 三角） */
.mobile-nav-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--c-on-dark);
  border-bottom: 1.5px solid var(--c-on-dark);
  transform: translateY(-75%) rotate(45deg);
  transition: transform .25s;
}

.mobile-nav-group.is-open .mobile-nav-arrow {
  transform: translateY(-25%) rotate(-135deg);
}

/* 服務項目子清單（預設隱藏，展開／收合由 jQuery slideToggle 控制，見 js/main.js） */
.mobile-nav-sublist {
  display: none;
  padding: 0 35px;
}

.mobile-nav-sublist a {
  display: block;
  padding: 14px 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-sm);
  letter-spacing: 0.5px;
  text-decoration: none;
  border-bottom: 1px solid #F3981C;
  position: relative;
}

.mobile-nav-sublist a.is-active {
  color: var(--c-on-dark);
  font-weight: 700;
}

.mobile-nav-sublist a.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--c-brand);
}

/* 底部 CTA 與社群 */
.mobile-nav-bottom {
  margin-top: 25px;
}

.mobile-nav-ctas {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 28px;
}

.mobile-nav-pill {
  flex: 1;
  max-width: 160px;
  border-radius: 999px;
  text-align: center;
  color: var(--c-on-dark);
  text-decoration: none;
  font-size: var(--fs-sm);
  letter-spacing: 1px;
  transition: background .25s, color .25s;
}

@media(max-width: 767px) {
  .mobile-nav-pill {
    font-size: 13px;
  }
}

.mobile-nav-pill.is-active,
.mobile-nav-pill:hover {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-on-dark);
}

.mobile-nav-social {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.mobile-nav-social a {
  display: inline-flex;
}

.mobile-nav-social img {
  height: 22px;
  object-fit: contain;
}

/* overlay 開啟時鎖定背景滾動 */
body.no-scroll {
  overflow: hidden;
}

@media (max-width: 1199.98px) {
  .main-nav {
    display: none;
    position: absolute;
    inset: 72px 0 auto 0;
    background: rgba(236, 236, 236, .95);
    backdrop-filter: blur(12px);
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav.open {
    display: flex;
  }
}


