/* ===== 모바일 하단 탭바 ===== */
.m-tabbar {
  --tabbar-height: 60px;
  --tabbar-bg: #fff;
  --tabbar-blur-bg: rgba(255, 255, 255, 0.9);
  --tabbar-border: #e5e7eb;
  --tabbar-color: #6b7280;
  --tabbar-active: #111827;

  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 0 15px;
  z-index: 1000;

  display: flex;
  align-items: center;                 /* 좌/우/센터 수직 정렬 */
  justify-content: space-between;      /* 좌/우는 내용만, 센터는 flex로 채움 */
  gap: 0;

  background: var(--tabbar-bg);
  border-top: 1px solid var(--tabbar-border);

  /* iOS 홈 인디케이터 여백 */
  padding-bottom: env(safe-area-inset-bottom, 0);
  min-height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0));
}

.m-tabbar.blur {
  backdrop-filter: blur(15px);
  background: var(--tabbar-blur-bg);
}

/* 좌/우 컨트롤 영역 */
.m-tabbar__side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 6px;
}
.m-tabbar__side--left  { order: 0; }
.m-tabbar__side--right { order: 2; }

/* 중앙 탭 영역 */
.m-tabbar__center {
  order: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0; /* 라벨 말줄임 대비 */
}

/* 각 탭 링크 */
.m-tabbar__item {
  flex: 1 1 0;
  text-decoration: none;
  color: var(--tabbar-color);

  display: flex;
  align-items: center;
  justify-content: center;

  height: var(--tabbar-height);
  min-width: 0;
}

/* 내부 래퍼: 아이콘 위 / 타이틀 아래 */
.m-tabbar__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
  min-width: 0;
}

/* 아이콘 컨테이너 */
.m-tabbar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* 인라인 SVG를 직접 넣을 때 */
.m-tabbar__icon > svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* 마스크 아이콘(외부 SVG URL) */
.m-tabbar__icon > .i {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: currentColor; /* 텍스트 색상 = 아이콘 색상 */
  -webkit-mask: var(--i) no-repeat center / contain;
          mask: var(--i) no-repeat center / contain;
  vertical-align: -0.125em;
}

/* 라벨 */
.m-tabbar__label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  color: currentColor;
}

/* 활성 상태 */
.m-tabbar__item.is-active,
.m-tabbar__item[aria-current="page"] {
  color: var(--tabbar-active);
}

/* 접근성 포커스 */
.m-tabbar__item:focus-visible,
.m-tabbar__ctrl:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  border-radius: 8px;
}

/* ===== 좌/우/새로고침 아이콘 전용 버튼 ===== */
.m-tabbar__ctrl {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--tabbar-color);
  width: 36px;
  height: 36px;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  cursor: pointer;
  line-height: 0;
}
@media (hover:hover) {
  .m-tabbar__ctrl:hover {
    background: rgba(17, 24, 39, 0.06); /* #111827 6% */
  }
}
.m-tabbar__ctrl:active {
  transform: translateY(1px);
  background: rgba(17, 24, 39, 0.09);
  color: var(--tabbar-active);
}

/* 아이콘/텍스트 폴백(‹, ›, ↻) */
.m-tabbar__fallback {
  font-size: 16px;
  line-height: 1;
  color: currentColor;
}

/* 터치 영역 확보(버튼/링크 모두) */
.m-tabbar__ctrl,
.m-tabbar__item {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* 데스크탑에서는 탭바 숨김(기존 로직 유지) + spacer 제거 */
@media (min-width: 1024px) {
  body { padding-bottom: 60px; } /* 필요 시 데스크탑 보정 */
  .m-tabbar { display: none; }
  .mobile-tabbar { display: none; }
}
