/* ===========================================================
   天鴻商行 — Mobile UX Enhancements (2026-04)
   - 修正 mobile back-to-top 與底部 CTA 嘅水平距離
   - Mobile drawer 服務分類加入摺疊式 accordion
   =========================================================== */

/* 1. mobile-back-to-top — right-3(12px) → right-4(16px)
      多 4px 視覺安全距離，並避開拇指誤觸右下 WhatsApp CTA。
      用 CSS 覆蓋而非改 HTML class，避免 Tailwind utility 衝突。
      按鈕本身有 lg:hidden（display:none），desktop 唔會見到此 rule。 */
#mobile-back-to-top {
  right: 1rem !important; /* 16px */
}

/* 2. Mobile drawer 服務分類 accordion ---------------------------- */
/* 由 mobile-enhance.js 動態加上 .menh-acc / .menh-acc-trigger / .menh-acc-panel
   class，CSS 只負責呈現。 */
.menh-acc {
  border-top: 1px dashed rgba(15, 23, 42, 0.10);
  margin-top: 8px;
  padding-top: 8px;
}
.menh-acc:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* 標題（原本係 .text-xs.font-semibold.text-gray-500 div，
   JS 注入後加 .menh-acc-trigger） */
.menh-acc-trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 4px !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menh-acc-trigger:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
  border-radius: 6px;
}
.menh-acc-trigger .menh-acc-caret {
  font-size: 10px;
  color: #94a3b8;
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
.menh-acc[data-open="true"] .menh-acc-caret {
  transform: rotate(180deg);
}

/* 內容面板：默認摺疊（max-height 0），data-open=true 時展開 */
.menh-acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.menh-acc[data-open="true"] .menh-acc-panel {
  /* 5 條 link × ~40px + buffer，足夠最長嗰個分類 */
  max-height: 480px;
}
.menh-acc-panel > a {
  display: block;
  padding: 8px 4px !important;
  color: #475569;
  font-size: 15px;
}
.menh-acc-panel > a:hover {
  color: #0369a1;
}

/* prefers-reduced-motion 友善 */
@media (prefers-reduced-motion: reduce) {
  .menh-acc-caret,
  .menh-acc-panel {
    transition: none !important;
  }
}
