/* ================================================================
   mobile-bottom-nav.css — native mobile tab bar (Material / iOS style)
   ================================================================ */

:root {
  --mbn-active: #0f8f72;
  --mbn-inactive: #94a3b8;
  --mbn-label: #64748b;
  --mbn-surface: #ffffff;
  --mbn-border: #e2e8f0;
  --mbn-bar-h: 56px;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    position: fixed !important;
    z-index: 100 !important;
    inset-inline: 0 !important;
    bottom: 0 !important;
    display: block !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    pointer-events: none;
    grid-auto-flow: unset !important;
    grid-auto-columns: unset !important;
    align-items: unset !important;
    gap: 0 !important;
  }

  .mobile-bottom-nav__bar {
    pointer-events: auto;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: var(--mbn-bar-h);
    padding: 0 max(.25rem, env(safe-area-inset-left)) env(safe-area-inset-bottom, 0px) max(.25rem, env(safe-area-inset-right));
    background: var(--mbn-surface) !important;
    border-top: 1px solid var(--mbn-border) !important;
    box-shadow: 0 -1px 3px rgba(15, 23, 42, .06) !important;
  }

  .mobile-bottom-nav__bar::before {
    display: none;
  }

  .mobile-bottom-nav__item,
  .mobile-bottom-nav .lang-toggle {
    position: relative;
    min-width: 0;
    min-height: var(--mbn-bar-h) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .35rem .15rem .4rem !important;
    border: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--mbn-label) !important;
    text-decoration: none;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0;
    transition: color .15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }

  .mobile-bottom-nav__icon,
  .mobile-bottom-nav .lang-toggle__mark {
    position: relative;
    display: grid !important;
    place-items: center;
    width: 3.5rem !important;
    height: 2rem !important;
    border-radius: 1rem !important;
    background: transparent !important;
    color: var(--mbn-inactive) !important;
    font-size: .78rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease;
  }

  .mobile-bottom-nav__icon svg {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
  }

  .mobile-bottom-nav__icon::after {
    display: none !important;
  }

  /* Active tab — M3 indicator pill behind icon */
  .mobile-bottom-nav__item.is-active,
  .mobile-bottom-nav__item--primary.is-active {
    color: var(--mbn-active) !important;
    background: transparent !important;
    font-weight: 600;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon,
  .mobile-bottom-nav__item--primary.is-active .mobile-bottom-nav__icon {
    background: rgba(15, 143, 114, .14) !important;
    color: var(--mbn-active) !important;
  }

  .mobile-bottom-nav__item--primary {
    margin-top: 0 !important;
    color: var(--mbn-label) !important;
    font-weight: 500;
  }

  .mobile-bottom-nav__item--primary .mobile-bottom-nav__icon {
    width: 3.5rem !important;
    height: 2rem !important;
    border-radius: 1rem !important;
    background: transparent !important;
    color: var(--mbn-inactive) !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .mobile-bottom-nav__item--primary .mobile-bottom-nav__icon svg {
    width: 1.375rem;
    height: 1.375rem;
  }

  .mobile-bottom-nav__item:active .mobile-bottom-nav__icon {
    opacity: .72;
  }

  .mobile-bottom-nav .lang-form {
    min-width: 0;
    display: flex;
  }

  .mobile-bottom-nav .lang-toggle {
    width: 100%;
    cursor: pointer;
  }

  .mobile-bottom-nav .lang-toggle:hover {
    color: var(--mbn-active) !important;
    background: transparent !important;
  }

  .mobile-bottom-nav .lang-toggle__text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-body {
    padding-bottom: calc(var(--mbn-bar-h) + env(safe-area-inset-bottom, 0px)) !important;
  }

  .site-body--marketing .site-main--marketing {
    padding-bottom: calc(var(--mbn-bar-h) + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }

  .site-body--marketing .site-main--marketing {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 380px) {
  .mobile-bottom-nav__item,
  .mobile-bottom-nav .lang-toggle {
    font-size: .625rem;
    gap: .15rem;
  }

  .mobile-bottom-nav__icon,
  .mobile-bottom-nav .lang-toggle__mark {
    width: 3.1rem !important;
    height: 1.85rem !important;
  }

  .mobile-bottom-nav__icon svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav__item,
  .mobile-bottom-nav__icon {
    transition: none;
  }
}
