/* ── 하단 내비게이션 바 ── */

/* 하단 내비가 가려지지 않도록 body 하단 여백 확보 */
body {
  padding-bottom: calc(52px + env(safe-area-inset-bottom));
}

/* 내비게이션 바 컨테이너 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;

  /* ── VT API: 페이지 전환 중 nav를 별도 레이어로 분리하여 제자리 고정 ── */
  view-transition-name: bottom-nav;

  display: flex;
  align-items: stretch;

  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.07);

  /* iOS Safe Area 대응 */
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(52px + env(safe-area-inset-bottom));
}

/* 각 탭 아이템 */
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 0 4px;
  cursor: pointer;
  text-decoration: none;
  color: #9ca3af; /* 기본: 회색 */
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent; /* 모바일 탭 하이라이트 제거 */
  user-select: none;
}

/* 탭 아이콘 래퍼 (5개 탭 대응: 22px) */
.bottom-nav__icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Material Symbols Rounded 아이콘 — 비활성 상태 (5개 탭 대응: 22px) */
.bottom-nav__icon .material-symbols-rounded {
  font-family: 'Material Symbols Rounded'; /* 폰트 패밀리 명시 */
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  /* FILL 0: 외곽선(outlined) 스타일, 얇은 굵기 */
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  transition:
    font-variation-settings 0.2s ease,
    transform 0.18s ease;
  /* ── 영어 fallback 텍스트 완전 차단 ──────────────────────────────
     폰트 로드 전 "home", "location_on" 등 영어 아이콘명이
     overflow:hidden + 고정 width/height 조합으로 fallback 글꼴의
     텍스트가 아이콘 영역 밖으로 삐져나오는 현상을 방지.
     주요 차단은 Google Fonts display=block 설정으로 처리됨.     ── */
  overflow: hidden;
  width: 22px;
  height: 22px;
}

/* 탭 레이블 — 기본 opacity:0으로 숨김 (아이콘 폰트 로드 전 텍스트만 먼저 보이는 현상 방지)
   폰트 로드 완료 시 JS에서 .bottom-nav에 .font-loaded 클래스 추가 → 함께 표시
   5개 탭 대응: font-size 9px, letter-spacing 타이트 */
.bottom-nav__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

/* 아이콘 폰트 로드 완료 → 레이블 표시 */
.bottom-nav.font-loaded .bottom-nav__label {
  opacity: 1;
}

/* 활성 탭 — 색상 */
.bottom-nav__item.active {
  color: #3D9EDB;
}

/* 활성 탭 아이콘 — FILL 1(채움) + 굵은 weight + 살짝 커지는 효과 */
.bottom-nav__item.active .bottom-nav__icon .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  transform: scale(1.08);
}

/* 탭 클릭 시 피드백 */
.bottom-nav__item:active .bottom-nav__icon .material-symbols-rounded {
  transform: scale(0.9);
}

/* 찜 탭 — 뱃지 (찜 개수 표시) */
.bottom-nav__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  display: none; /* JS로 카운트 있을 때만 표시 */
  /* ── 탭 선택 시 아이콘(transform: scale 적용) 위로 뱃지가 노출되도록 ── */
  z-index: 5;
}
.bottom-nav__badge.visible {
  display: block;
}

/* ── 프로필 아바타 (로그인 상태) ── */
.bottom-nav__avatar {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  object-fit: cover;
  border: 1.5px solid #e5e7eb;
  display: block;
}
/* 활성 탭: 아바타 테두리를 활성 컬러로 강조 */
.bottom-nav__avatar.active {
  border-color: #3D9EDB;
}

/* ── PC/모바일 모두 표시 ── */
