/* Classe aplicada em JS quando a barra existe (evita :has para Safari antigo). */
@supports (scrollbar-gutter: stable) {
  html.ks-mfn-scrollbar-gutter {
    scrollbar-gutter: stable;
  }
}

.ks-mfn {
  /* Extra no translate ao esconder: item central (top:-14px + ícone 48px) fica fora da caixa do nav; 100% só não chega. */
  --ks-mfn-hide-overflow: 64px;
  --ks-mfn-bg: #ffffff;
  --ks-mfn-line: #e7e8ec;
  --ks-mfn-text: #797979;
  --ks-mfn-active: #2b59b0;
  --ks-mfn-center-ring: #2b59b0;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99980;
  /* Evita encadear overscroll do toque na barra para o documento (micro-rolagem em mobile). */
  overscroll-behavior-y: none;
  display: none;
  border-top: 1px solid var(--ks-mfn-line);
  background: var(--ks-mfn-bg);
  box-shadow: 0 -4px 18px rgba(9, 9, 9, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translate3d(0, 0, 0);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  .ks-mfn {
    transition-duration: 0.01ms;
  }
}

/* Rola para baixo: barra desce e some. Rola para cima: volta. */
.ks-mfn.ks-mfn--scroll-hidden {
  transform: translate3d(0, calc(100% + var(--ks-mfn-hide-overflow)), 0);
  pointer-events: none;
}

.ks-mfn__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  margin: 0;
  padding: 6px 8px 6px;
  list-style: none;
  gap: 2px;
}

.ks-mfn__item {
  min-width: 0;
  text-align: center;
}

.ks-mfn__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  min-height: 54px;
  width: 100%;
  max-width: 100%;
  text-decoration: none;
  color: var(--ks-mfn-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}

/* Não usar font: inherit aqui — anulava tipografia do .ks-mfn__link e o <li> pai não define tamanho/peso (item «Mais» com popup = <button>). */
button.ks-mfn__link {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

button.ks-mfn__link:focus-visible {
  outline: 2px solid var(--ks-mfn-active);
  outline-offset: 2px;
}

/* Evita gestos de scroll do browser no toque e micro-ajuste de viewport ao focar o item com popup. */
button.ks-mfn__link--popup {
  touch-action: manipulation;
  scroll-margin-block-end: 0;
  scroll-margin-block-start: 0;
}

/* Modal de login (#ks-auth-modal) — mesmo reset que o popup Elementor. */
button.ks-mfn__link--auth {
  touch-action: manipulation;
  scroll-margin-block-end: 0;
  scroll-margin-block-start: 0;
}

.ks-mfn__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ks-mfn__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Slot «Favoritos»: ícone estrela (traço + contorno; preenchimento vem do estado activo). */
.ks-mfn__item--favorite-slot .ks-mfn__icon svg {
  fill: none;
}

.ks-mfn__item--favorite-slot.is-active .ks-mfn__icon svg {
  fill: currentColor;
}

.ks-mfn__fav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ks-mfn-active);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.ks-mfn__item.is-active .ks-mfn__link {
  color: var(--ks-mfn-active);
}

.ks-mfn__item--center .ks-mfn__link {
  position: relative;
  top: -14px;
}

.ks-mfn__item--center .ks-mfn__icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(43, 89, 176, 0.65);
  box-shadow: 0 6px 14px rgba(43, 89, 176, 0.16);
}

.ks-mfn__item--center .ks-mfn__icon svg {
  width: 21px;
  height: 21px;
}

.ks-mfn__item--center .ks-mfn__label {
  margin-top: 3px;
}

body.ks-mfn-has-bar {
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0));
  transition: padding-bottom 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  body.ks-mfn-has-bar {
    transition-duration: 0.01ms;
  }
}

/* Com a barra recolhida pelo scroll, remove o respiro inferior para não ficar faixa vazia. */
body.ks-mfn-has-bar.ks-mfn-bar-scroll-hidden {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
  .ks-mfn {
    display: block;
  }
}

