/*
 * Назначение файла: Стили для мобильной навигационной панели (плашки)
 */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-light);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08); /* Тень сверху */
  z-index: 1060;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767px) {
  .mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Добавляем отступ снизу для body, чтобы плашка не перекрывала контент */
  body,
  .catalog__sidebar.offcanvas,
  .catalog-tags-offcanvas.offcanvas {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  background-color: transparent;
  border: none;
  color: var(--color-gray);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  flex: 1;
}

.mobile-nav__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: filter 0.2s ease;
}

/* Обёртка нужна счётчику: бейдж позиционируется от иконки, а не от всего
   пункта, иначе он уезжает к краю подписи. */
.mobile-nav__item-icon {
  position: relative;
  display: block;
  line-height: 0;
}

.mobile-nav__badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: var(--color-accent);
  color: var(--color-light);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 15px;
  text-align: center;
  transition: transform 220ms var(--ease-out);
}

/* Пустой счётчик не показываем — ноль в кружке читается как ошибка */
.mobile-nav__badge:empty,
.mobile-nav__badge[data-count="0"] {
  display: none;
}

.mobile-nav__badge.is-bumped {
  transform: scale(1.35);
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav__badge.is-bumped {
    transform: none;
  }
}

/* Отличие от эталона: у активного пункта иконка не перекрашивается — правило
   .is-active .mobile-nav__icon { filter: ... } снято по решению заказчика.
   Класс is-active на пункте остаётся: за него цепляется скрипт открытия каталога. */
