/* ========================================= */
/* Navigation - App Bar & Bottom Nav        */
/* ========================================= */

/* App bar */
.appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: 54px;   /* 56 → 48 (10-19) → 54 (10-20 사용자 "54로 세팅해") */
  background: var(--bg-default);
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}
.appbar-left { display: flex; align-items: center; }
.appbar-title { display: flex; justify-content: center; min-width: 0; transition: opacity .2s; }
body.head-in-view .appbar-title { opacity: 0; }
body.head-in-view .appbar { border-bottom-color: transparent; }   /* 제목이 숨은 동안은 바 아래 선도 숨겨 본문과 한 면으로 */   /* 본문 큰 제목(.page-head)이 보이는 동안 앱바 제목은 숨김 — 스크롤로 지나가면 나타남 (10-25) */
.appbar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 다국어: 번역이 길어도 한 줄 말줄임 — 두 줄이면 바가 커져 아래 탭을 덮는다 (10-20, 슈퍼패스 08-27 규칙을 공통으로) */
.appbar-right { display: flex; align-items: center; justify-content: flex-end; }

/* Bottom nav — 기본: 꽉 찬 바 (26-08-31 확정, 일반적인 탭바). (부유 알약 변형은 10-23 폐기) */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  min-height: 56px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));   /* 6 + 44 + 6 = 56 */
  background: var(--bg-default);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 2px;
  min-height: 44px;   /* 터치 영역 */
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s ease;
}
/* 눌린 티 — 없을 땐 이동이 되든 안 되든 죽은 버튼으로 느껴졌다.
   특히 현재 탭을 누르면 화면이 그대로라 아무 반응이 없었다 (26-09-02 사용자) */
.bottomnav a:active { opacity: .45; }
.bottomnav a .icon { color: var(--fg-primary); }   /* 하단 탭바는 비활성도 검정 (26-08-31 사용자), 활성 = 채운 아이콘 + 볼드 */
.bottomnav a.primary .icon { color: var(--fg-primary); }   /* 26-08-31 활성 = 검정 채움 (빨강 폐기, 상단 탭과 동일 규칙) */
.nav-text { font-size: 11px; line-height: 12px; }   /* lint-allow: L16 하단 탭바 라벨 — 탭바 높이 고정, 전 화면 공통 (26-09-17) */
.bottomnav a.primary .nav-text { color: var(--fg-primary); font-weight: 700; }

body.has-bottomnav { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }   /* 바 56 + 위 16 (26-08-31 꽉 찬 바) */
body.has-actionbar { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }   /* 12+52+12 + 여유 16 (10-18 L 52) */
body.has-appbar { padding-top: 54px; }
body.has-appbar.has-fixed-tabs { padding-top: 99px; } /* appbar(54px) + fixed-tabs(45px) (10-20) */
body.has-fixed-tabs .appbar { border-bottom: none; }

/* 페이지 푸터 — 링크 한 줄 + 운영사·사업자 정보 (10-23 사용자 "볼륨 줄이고 레이아웃 개선", 라이브 풋터 = 약관·개인정보 한 줄) */
.page-footer { --pf-bar: 0px; --pf-push: 0px; margin-top: calc(24px + var(--pf-push)); padding: 8px 16px 16px; background: var(--bg-muted); color: var(--fg-secondary); }
.pf-links { display: flex; flex-wrap: wrap; align-items: center; }
.pf-links a { display: inline-flex; align-items: center; padding: 8px 0; font: var(--t-caption); color: var(--fg-secondary); text-decoration: none; }   /* 히트 32 */
.pf-links a + a::before { content: ''; width: 1px; height: 10px; margin: 0 10px; background: var(--border-control); }   /* 라이브처럼 세로 구분선 */
.pf-links b { font-weight: 600; color: var(--fg-primary); }   /* 개인정보처리방침 굵게 — 국내 표기 관례 */
.pf-biz { margin-top: 4px; }   /* 사업자 정보 늘 노출 (10-23 사용자 "그냥 노출해") · 소셜 아이콘은 상담 버튼(fab-chat)과 겹쳐 뺌 */
.pf-biz-name { margin-bottom: 4px; font: var(--t-caption-xs); font-weight: 600; color: var(--fg-secondary); }
.pf-biz p { margin: 0; font: var(--t-caption-xs); color: var(--fg-secondary); }
/* 누르는 영역만 위아래 9 넓힘 (26-10-18) */
.pf-biz p a { color: inherit; text-decoration: underline; position: relative; }
.pf-biz p a::after { content: ''; position: absolute; inset: -9px 0; }

/* ---- 홈: 헤더는 스크롤에 밀려 올라가고 카테고리 탭만 상단 고정 (26-08-31 사용자) ---- */
body.has-appbar.has-fixed-tabs.has-scroll-appbar { padding-top: 0; }
body.has-scroll-appbar .appbar { position: static; }
body.has-scroll-appbar.is-searching .appbar { position: fixed; }   /* 검색 모드는 기존대로 상단 고정 */
/* html/body 의 overflow-x:hidden 때문에 sticky 가 안 먹음 → 스크롤이 헤더 높이를 넘으면 JS 가 .is-stuck 을 붙여 fixed 로 전환 */
body.has-scroll-appbar .fixed-tabs { position: static; transition: box-shadow .2s ease; }
body.has-scroll-appbar .fixed-tabs.is-stuck { position: fixed; top: 0; left: 0; right: 0; box-shadow: var(--shadow-1); }
body.has-appbar.has-fixed-tabs.has-scroll-appbar.tabs-stuck { padding-top: 45px; }   /* 탭이 flow 에서 빠진 만큼 보정 → 점프 없음 */
body.has-scroll-appbar .sub-tabs { position: static; }   /* 서브 칩은 흐름대로 (상단 고정은 카테고리 탭만) */

/* 하단 탭바는 스크롤해도 늘 고정 (10-23 사용자, 26-08-31 내리면 숨김 폐기) */

/* 하단 탭 안 읽은 개수 (26-10-18) — 라이브 탭의 (58)·(1) 숫자를 아이콘 오른쪽 위 배지로. 1~99, 넘으면 99+, 0이면 없음.
   색 = 안 읽음 점과 같은 --mark-brand. 이름은 .badge(SNS·상태 칩)와 겹치지 않게 nav- 접두사. 마크업은 src/components/BottomNav.astro 에서만 */
.nav-ico { position: relative; display: inline-flex; }
.nav-count {
  position: absolute;
  top: -4px;
  left: calc(100% - 8px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--mark-brand);
  color: var(--fg-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;   /* 원 16 안 가운데는 정렬로 */
  font: var(--t-tag-11);
  font-weight: 700;
  /* 배지 글자 = 줄높이 100% (10-21). 옛 11/14 는 숫자가 0.9px 떠 보였다 */
}
/* 풋터가 화면 맨 끝 (10-23 모든 화면 공통) — 하단 고정 바 자리는 몸통 흰 여백 대신 풋터 회색이 채운다(높이 --pf-bar 는 PageFooter 스크립트가 잼) */
html body.has-page-footer.has-page-footer { padding-bottom: 0; }   /* 화면별 body.page-superpass.has-actionbar(132) 등보다 우선 */
body.has-page-footer .page-footer { padding-bottom: calc(24px + var(--pf-bar)); }   /* 아래 고정 바 자리만 회색. 내용이 짧을 때 남는 높이는 --pf-push 로 풋터 위 본문이 갖는다 (10-25) */
.pl-wrap:has(+ .page-footer) { padding-bottom: 32px; }   /* 하단 바 비켜 두던 112 → 풋터가 대신 비킴 */
