/* tabbar.css — нижняя навигация на мобиле (до 900px) */

.c-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
}

.c-tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: var(--tap);
  min-height: var(--tabbar-h);
  padding: 6px 2px;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  line-height: 1.1;
  text-decoration: none;
}

.c-tabbar__item svg {
  width: 22px;
  height: 22px;
}

/* Подписи переносятся: при системном увеличении шрифта пункты не наезжают */
.c-tabbar__item span {
  max-width: 100%;
  hyphens: auto;
  overflow-wrap: break-word;
  text-align: center;
  line-height: 1.15;
}

.c-tabbar__item[aria-current="page"] {
  color: var(--accent-text);
  font-weight: var(--fw-semibold);
}

/* Активный раздел: цвет + полоска (не только цветом) */
.c-tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.c-tabbar__item:focus-visible {
  outline-offset: -4px;
}

@media (hover: hover) {
  .c-tabbar__item:hover {
    color: var(--text);
  }
}

@media (min-width: 900px) {
  .c-tabbar {
    display: none;
  }
}

/* Планшет: фон панели на всю ширину, пункты — компактной группой в центре */
@media (min-width: 600px) and (max-width: 899px) {
  .c-tabbar {
    grid-template-columns: repeat(4, minmax(0, 132px));
    justify-content: center;
  }
}
