/* ==========================================================================
   NANDNEE MOBILE BOTTOM NAV
   Home · Shop · Cart · Profile — floating pill bar.
   MOBILE ONLY — nothing renders on tablet or desktop.
   ========================================================================== */

.nd-btm {
  display: none;
}

/* ---------- Mobile only ---------- */

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

  /* Clear room so the bar never covers page content or the footer */
  body.nd-btm-ready {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  /* Lift existing floating buttons clear of the bar */
  .whatsapp-floater {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    right: 1rem !important;
    width: 52px !important;
    height: 52px !important;
  }

  .cart-floater {
    display: none !important;
  }

  /* ---------- The pill bar ---------- */

  .nd-btm-bar {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 3500;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 28px));
    display: grid;
    /* minmax(0, 1fr) lets each slot shrink below its content width,
       otherwise long labels blow the grid wider than the bar */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(14, 44, 51, 0.08);
    box-shadow:
      0 18px 38px -10px rgba(4, 22, 27, 0.35),
      0 4px 14px rgba(4, 22, 27, 0.1);
    overflow: hidden;
  }

  /* ---------- Tabs ---------- */

  .nd-btm-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.55rem 0.15rem;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: #64748b;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.22s ease, background 0.22s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .nd-btm-tab svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nd-btm-tab-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .nd-btm-tab.is-active {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
  }

  .nd-btm-tab.is-active svg {
    transform: translateY(-1px) scale(1.08);
  }

  .nd-btm-tab:active svg {
    transform: scale(0.88);
  }

  /* ---------- Cart bubble ---------- */

  .nd-btm-badge {
    position: absolute;
    top: 0.25rem;
    left: calc(50% + 0.5rem);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.5625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
  }

  .nd-btm-tab.has-items .nd-btm-badge {
    opacity: 1;
    transform: scale(1);
  }

  .nd-btm-tab.has-items {
    color: #0284c7;
  }
}