/* ==========================================================================
   全站導航重構（載入於 main.css 之後，覆蓋 .nav 相關規則）
   --------------------------------------------------------------------------
   桌面（≥821px）：兩個下拉選單（關於白鹿 / 產品項目）+ 兩個直達連結
   手機（≤820px）：漢堡面板；下拉改為可折疊手風琴
   ========================================================================== */

/* ---- 下拉箭頭 ---- */
.nav__caret {
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}
.nav__item.is-open .nav__caret { transform: rotate(-135deg) translateY(-1px); }

/* ---- 父層用 button：保留 .nav__link 外觀 ---- */
button.nav__link {
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* ====================== 桌面 ====================== */
@media (min-width: 821px) {
  /* 導覽整體靠右：品牌靠左，選單＋語言＋CTA 成組靠右 */
  .site-header__inner { justify-content: flex-start; }
  .site-header .nav { margin-left: auto; }
  /* 點擊展開後，維持可見（除了 hover 之外） */
  .nav__item.is-open .nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  /* 寬下拉：關於白鹿（10 項）排成兩欄 */
  .nav__sub--wide {
    min-width: 430px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 4px;
  }
  .nav__sub--wide a { white-space: nowrap; }
}

/* ====================== 手機 ====================== */
@media (max-width: 820px) {
  /* 父層按鈕佔滿整列，箭頭推到右側 */
  button.nav__link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 4px;
  }
  /* 二級選單：強制靜態全寬 + 白字深底（不依賴 main.css 的版本） */
  .site-header .nav__item { position: static; }
  .site-header .nav__sub {
    position: static !important;
    left: auto; right: auto; top: auto;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-width: 0 !important;
    width: 100%;
    display: block !important;
    box-shadow: none;
    border: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, .18);
    padding: 4px 0;
    margin: 2px 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s var(--ease);
  }
  .site-header .nav__item.is-open .nav__sub { max-height: 1200px; }
  .site-header .nav__sub a {
    display: block;
    color: #fff;
    padding: 12px 16px;
    font-size: 14.5px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
  }
  .site-header .nav__sub a:last-child { border-bottom: 0; }
  .site-header .nav__sub a:hover,
  .site-header .nav__sub a:focus-visible {
    background: rgba(255, 255, 255, .16);
    color: #fff;
  }
}
